There's a case we were missing when printing the tone curves: the ones
with zero segments.
These are 16-bit sampled curves. Start taking them into account.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
If backend initialization fails, weston_compositor_shutdown() is called
twice, once right away in weston_compositor_load_backend(), and once in
weston_compositor_destroy().
Remove the first and fix a segfault when trying to weston_plane_remove()
the primary plane a second time.
Fixes: 90c11cf40e ("libweston: move weston_compositor_shutdown call out of backends")
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This will help us to debug our color pipeline optimizer without the
need to craft special ICC profiles for that. In this initial patch,
we are able to add matrices and curve sets to the pipeline and assure
that the optimizer is doing the right thing.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
At the moment, when we merge two curve sets it becomes a sampled one.
With this change, we start merging power-law curve sets and keeping them
as parametric, as we'd rather have a parametric curve than a sampled
one.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
At the moment, when we merge curves we transform them into sampled
curves, even if they were parametric before.
If we have two inverse parametric curve sets in sequence in the color
pipeline, we can drop them both, as merging them would result in the
identity curve. If we don't do that and merge the resulting identity
with another curve set, we'll end up with a sampled curve.
Start dropping inverse curve sets in sequence. This change help us in
the following scenarios:
pipeline:
curve set A, curve set B (inverse of A), curve set C (parametric)
Merging A and B results in identity, and merging that with C results in
a sampled curve. With our changes, we end up with curve set C intact,
and we'd rather end up with a parametric curve than with a sampled one.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Move code that depend on cmsGetToneCurveSegment() to a new file:
color-curve-segments.c
This help us to eliminate #if HAVE_CMS_GET_TONE_CURVE_SEGMENT scattered
around color-transform.c, making the code clearer and helping to avoid
mistakes.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
clang 17 complains that `fourcc` in `gl_renderer_fill_buffer_info()` is
uninitialized in the default case, because it fails to recognize that
if hit, that case will `assert(0)`. To get rid of this complaint, we can
just apply clang's suggestion and initialize the variable with 0 when
declaring it.
Signed-off-by: Max Ihlenfeldt <max@igalia.com>
We already only conditionally use base.offset when an icon exists. We
should also avoid trying to create a coordinate with a NULL icon, as it
will fire an assert().
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The event-test moves a client off of all the outputs to check for an
output leave event, but our move_client() code waits on a frame callback
to continue.
The fact that weston currently generates this frame callback is not
something we should enforce in a test, as it could (should) change in
the future.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Ever since commit 3012934 some rotations have been broken. This is because
I transposed xy and yx in the cairo_matrix_init() call.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
If we want to support multiple backends, the compositor must take care
to call this once, at the appropriate moment, so stop letting the
backends handle compositor shutdown themselves.
Move the weston_compositor_shutdown() calls from the backend::destroy
callbacks into weston_compositor_destroy() and the calls in the backend
creation error paths into weston_compositor_load_backend().
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Add a weston_backend::shutdown callback to split out the part of
weston_backend::destroy that needs to be done before compositor
shutdown.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Before this patch, we would leak the drm_output if there was a pending
flip during shutdown.
Now we destroy the drm_output even if there's a pending flip (only
during shutdown, as we don't want to wait until flip completion to
destroy the output).
Also, it fixes a problem where weston_output_enable() is called right
after weston_output_enable() or weston_output_disable() and it could
fail to find available DRM objects (as they are only released after
the flip completion).
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
When a new view gets activated, use weston_view_move_to_layer() for our
dance of moving views to the front.
Signed-off-by: Daniel Stone <daniels@collabora.com>
When we're switching between different active surfaces, use the new
weston_view_move_to_layer() helper.
Signed-off-by: Daniel Stone <daniels@collabora.com>
When we're rotating a surface, only mark the geometry as dirty after
we've actually updated the transformations. Then we can restrict our
repaint to just the view itself, not the full compositor.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Use the new helper instead of open-coding part of it. This removes a
comment about not marking a surface as mapped until it has a buffer: the
surface->width == 0 check already guarantees that we have a buffer.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Instead of pre-creating a fade-out view that's sort of left half-mapped
around in the scene graph, create the view only when we need it, and use
the helpers to make sure that the damage is correctly handled.
Signed-off-by: Daniel Stone <daniels@collabora.com>
When we're tabbing away from fullscreen views, use the new helper rather
than open-coding layer switching.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Preserve the same order as desktop-shell for handling view (un)mapping,
so we can move these into a shared helper. These should have no
functional effect but provide a helpful bisect point.
Signed-off-by: Daniel Stone <daniels@collabora.com>
shell_surface_update_layer() is the thing which moves our views around
into layers. Since we want to keep an invariant that a view is mapped if
it is on a layer, and unmapped if it is not on a layer, handle mapping
along with the layer moves.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Try to stick to a pattern of first mapping a surface, then inserting a
view into a layer together with marking it as mapped.
Signed-off-by: Daniel Stone <daniels@collabora.com>
weston_view_geometry_dirty() won't automatically clear out the old
region, so manually damage underneath the view before we mark the
geometry dirty.
Signed-off-by: Daniel Stone <daniels@collabora.com>
There is no way for shell_surface_calculate_layer_link() to give us a
NULL layer, so don't pretend it can and silently drop out without
removing it from the old layer.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Destroy the renderer before disconnecting the Wayland display.
Trying to destroy the GL renderer with the Wayland display already gone
crashes in the Mesa Wayland integration.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
After freeing the renderer, clear the compositor->renderer pointer to
avoid use-after-free errors.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Calling clip_transformed() 4 times in a row with the same polygon8 in
commit a4d31fa8bd introduced a bug
because the surf input is modified each time. This is fixed by working
on a local copy. The input parameter is marked constant to reflect the
change on the function prototype.
Fixes#764
Signed-off-by: Loïc Molinari <loic.molinari@gmail.com>
Now that we've concluded the Xwayland/fontconfig stuff, we don't
actually need a per-test wrapper; we can just set the options globally.
It turns out that we don't need to set the options at all anyway, since
the previous commit adds the LSan suppressions to all test runs, and
LSan is enabled by default, so we can just bin it.
Signed-off-by: Daniel Stone <daniels@collabora.com>
cf. the never-ending saga of how we can't neuter the fontconfig leaks,
also pass our CI leak-sanitizer suppression file when running tests
locally. This makes it easier to run with ASan enabled in your local
environment.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Fixes Meson warning:
../../git/weston/doc/sphinx/meson.build:40: WARNING: Project targets '>=
0.63.0' but uses feature deprecated since '0.56.0': meson.source_root.
use meson.project_source_root() or meson.global_source_root() instead.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
When I upgraded Sphinx to 5.3.0 from Debian bookworm, I got the error:
Warning, treated as error:
Invalid configuration value found: 'language = None'.
Update your configuration to a valid language code.
Falling back to 'en' (English).
This fixes it.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Prefer outputs that are not powered off when assigning a surface to an
output. If a surface covers the same area on two outputs, prefer the
one with the higher refresh rate.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
attach needs to consider the viewport as well, so it makes more sense
for attach to consistently access the weston_surface_state, rather than
part from the surface and part from a function argument.
Signed-off-by: Daniel Stone <daniels@collabora.com>