Only pass -W (warnings are fatal) to Sphinx if we've set Werror in
Meson.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Closes: wayland/weston#917
When a commit fails, then only the outputs that where part of this commit should
be reset or restarted.
Otherwise an unrelated output that has another successful pending commit may be
restarted incorrectly. Then the output is in an inconsistent state and will
trigger an assertion:
weston: ../libweston/backend-drm/state-propose.c:627: drm_output_propose_state: Assertion `!output->state_last' failed.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Currently only the return value of the last backend that implements
repaint_flush() is actually used. That only works because the drm backend is the
only backend that implements repaint_flush().
In the drm backend only the return value of the last device is used. And if a
failure is actually detected, then all repainted outputs of all backends are
reset. This can trigger asserts:
weston_output_schedule_repaint_reset() (or _restart()) will change the state of
the output but the backend that did not cause the failure will still call
weston_output_finish_frame().
The same thing can happen with multiple devices in the drm backend. Or outputs
get stuck if an error is dropped.
Since the drm backend is the only one that implements repaint_flush() anyways,
move the failure handling into the backend and make it device specific.
This way only the outputs that need it are reset.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
With multiple backends or devices repaint_begin/repaint_flush may be called even
if no outout of a device will be repainted. This results in an "empty" drm state
without any output.
The actual commit to the kernel is already skipped but the drm-backend log is
still filled with "Beginning repaint"/"repaint-flush" messages and the scene
graph.
Use the new prepare_repaint() callback to determine if a backend needs to be
repainted and only create the pending_state if necessary.
Exit early in repaint_flush()/repaint_cancel() when no pending_state was created.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
When a repaint is triggered then not all backends may have outputs that need to
be repainted.
Check which outputs will be repainted first and then repaint only the backends
that need it.
This way unnecessary repaint_begin() and repaint_flush()/repaint_cancel() can
be skipped and errors are handled for each backend separately.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
We're now using EGL_EXT_present_opaque and EGL_EXT_surface_compression
in weston-simple-egl, but this breaks the build for people that don't have
them in their system headers.
Pull them in from the khronos headers.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
And use it to perform keyboard activation on the currently focused
window. Similar to what kiosk-shell does, with the note that we go
over all seats in the system rather than picking the first one
available.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Similarly to all the other back-ends do the same for the RDP one.
With this change the remote output will be placed, similar to the
VNC/PipeWire on the right side from the native one, when both backends
are loaded.
But ultimately this patch is about having all backends share the same
code path.
Fixes: #820
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Stop writing weston_buffer::shm_buffer when weston_buffer::type is not
WESTON_BUFFER_SHM. Instead, explicitly write to the union field
that corresponds to the buffer type.
Also add a comment why we clear the shm_buffer/dmabuf/legacy_buffer
pointer here.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Makes things clearer which planes we have been skipped due to fmt/modifier.
All other debug sites print out the plane id, and the assumption might
be that we retried the same plane when it fact is a different one.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
When option "-c <bpc>" is specified, the application uses
EGL_EXT_surface_compression extension to compress the window
surface to the given bitrate (bits per component).
Signed-off-by: Louis-Francis Ratté-Boulianne <lfrb@collabora.com>
If section is NULL, weston_config_section_get_*() will assign the given
default value and return -1 with ENOENT. Hence, checking for NULL
section is unnecessary.
This cleans up only the simple cases.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Clear the selected buffer pointer immediately before the array walk to
pick a new buffer so we don't accidentally re-use the attached buffer
when it's already in use.
Set the buffer used bit only when we attach and commit a buffer - this way
we don't accidentally consume all our buffers with no way to have them
released.
Clean up buffers based on wl_buffer presence instead of used at end of
run.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
With attach only being called at render time, the dmabuf can be deleted
along with its private data before we attach for the first time.
Let's move the first-time logic into its own callback to call at
buffer setup time instead.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Seems like a typo, found by reading shader debug scope logs and
wondering why "!?!?" is there, e.g.:
Deleting shader program for: !?!? SHADER_VARIANT_XYUV
SHADER_COLOR_CURVE_IDENTITY SHADER_COLOR_MAPPING_IDENTITY
SHADER_COLOR_CURVE_IDENTITY -input_is_premult -green
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Add API to create color profiles from parameters. It is a public API
that should be used by the frontend and also by the color management
protocol implementation.
Currently our protocol implementation does not support clients that want
to create color profiles from parameters, and this is a step towards
supporting that.
As warned in "color: add get_color_profile_from_params() to color
managers", we still do not fully support creating color profiles from
parameters. This just creates a boilerplate color profile that we're
planning to extend later.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
No behavior change. Move ICC profile data to nested struct to keep
the code more organized.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In cmlcms_get_color_profile_from_icc(), if we fail to create the
ro_anonymous_file we end up calling cmlcms_color_profile_destroy() with
a cprof whose cprof->prof_rofile is NULL.
For now that's alright, because cmlcms_color_profile_destroy() checks
if this field is NULL. But in the future we'll drop this check, so
the idea of this patch is to avoid an issue in the future.
Reorganize cmlcms_get_color_profile_from_icc() to avoid destroying a
cprof without a ro_anonymous_file.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Add function to color managers to create color profiles from parameters.
This will be used by the parametric color profile builder that we'll add
in the next commit.
WARNING: we still do not fully support creating color profiles from
parameters. This just creates a boilerplate color profile that we're
planning to extend later.
Co-authored-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In the next commits we'll start support clients that want to create
image descriptions through params using the CM&HDR protocol extension.
In order to do that, we'll have to expose the primaries and transfer
functions that the color manager supports. So keep track of that.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Up to now we had support only for transfer functions with pre-defined
parameters in struct weston_color_tf_info. Add support for the first
parameterized transfer function (a function whose params are not
pre-defined).
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In the next commits we are going to introduce a public API to libweston
to allow creating color profiles from parameters. This should be used
by both the frontend and by the color protocol implementation.
This API require some color struct's and enum's that are currently
defined in libweston core, so move them to a public header.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This patch adds a new CLI option to weston-image: verbose.
It uses that to decide if we should log some info when the image
contains an ICC file embedded.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Commit "clients/image: use embedded ICC profile to present image" added
the support to present images with embedded ICC profiles being taken
into account. But the rendering intent was hardcoded to perceptual.
In this patch we allow end users to choose other rendering intents
through command line options.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Add function to print program usage. For now this is kind of useless,
but in the next commit we'll add more functionalities to clients/image
command line options.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
For image files that have an embedded ICC profile, use the CM&HDR
protocol extension to present taking that into account.
We use the CM&HDR extension to create an image description based on the
ICC profile. Also through the CM&HDR extension we take this image
description and set it to be the surface image description of the
surface in which we present the image.
For now, the rendering intent is hardcoded to be perceptual. In the next
commits we'll allow end users to choose the rendering intent through
command line options.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This function takes an ICC fd, creates an image description for that and
sets the widget surface image description to this one.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
We have a single user of load_image(), and that can be easily replaced
by the new and more flexible weston_image_load() function.
So replace and drop load_image() from the code.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Instead of loading only the pixman image through load_image(), load both
the pixman image and the ICC profile with weston_image_load().
It also sets the struct weston_image as the cairo surface user data and
adds a function so that users can retrieve this.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Follow up of "shared: allow to get ICC profile from PNG using
weston_image_load()". This adds the support to get ICC profiles from
JPEG files.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This introduces the functionality to also load the embedded ICC profile
from an image. For now, this only supports PNG files, but in the next
commit we add the support for JPEG as well.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In the next commits we plan to add support to load ICC profiles that are
embedded in images. So we need something more flexible than
load_image().
This patch introduces a new function that, for now, does the same as
load_image(). For now we keep load_image() as well, but the plan is
to drop it later.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This avoids running pipelines *after* the MR has been merged and
avoids triggering a new CI build and with it the tests.
These should already be done in the MR context so there's no need to
run them once more time.
Further more, with this change forks would need to manually trigger
builds. No change for the MR context, as these it would build automatically.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
By moving this here we can use the information to disable damage tracking
for placeholder surfaces, as well as render them entirely opaquely.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We test if the surface is fully opaque during paint node updates, and
store that information. Now that we've refactored the blended calculations
a little bit, we can easily use this test to make paint_node->is_opaque
override the blend calculation entirely.
This is preparation for future patches that will override is_opaque
when performing content censoring or fallback rendering of solid colors
for weston_direct dmabufs.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
These should effectively be the same, thought the one we've calculated
may be clipped with the scissor. The end result of the math should be
identical.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We'll be doing censoring via the paint node update code shortly, so
let's make sure we notice when protection changes.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Since we only call this from the paint node update code now, we can pass
the paint node directly.
A bit of internal refactoring is required to support copy_content.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Instead of doing this in several places, just do it when we're updating
the paint nodes in the repaint loop, or when we're about to copy
content via weston_surface_copy_content().
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>