Our window decor uses cairo-xcb. cairo-xcb stores xcb_connection_t
internally and uses them as kind of a hash key for internal bookkeeping.
This needs to be torn down with a cairo_device_finish, when the last
cairo surface is destroyed, and we are not properly handling that.
Because of this weston bug, if the Xwayland server dies, is restarted,
and the weston X window manager gets the same xcb_connection_t pointer
value for a new connection that it had for a previous connection,
cairo-xcb will use stale state and crash.
Weston is used in some places (like Mesa CI) where Xwayland crashes are
more common than one might usually expect, and weston needs to be robust
against these failures. It's ok to have no window frames in xwl in these
cases, because nobody is interacting with the windows.
The '--no-xwm-decorations' command line option will now remove
cairo-xcb from use entirely, so this crash can no longer happen.
We should still fix the bugs in our cairo usage, but I think long term
it's still ok to have a way to disable this and reduce complexity.
Ref #1042
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
As required by the spec when accessing dmabufs from the CPU, see
https://docs.kernel.org/driver-api/dma-buf.html
While effectively a no-op on amd64, this fixes test failures on various
aarch64 devices, including:
- rk3588 (Panfrost, Rock5)
- rk3399 (Panfrost, PineBook Pro)
- Broadcom BCM2712 (V3D, RPi5)
- Qualcomm SDM845 (freedreno, OnePlus6)
Fixes: 303d88448 (tests: client-buffer: Add dmabuf support)
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Entrench the use of weston_enum_map more, even though in this case it
doesn't buy much.
Make the array 'static const' which it should have been already.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Mapping between strings and enum values is open-coded in several places.
Introduce helpers here, and use them in the next patch.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
set_dpms() is used for sleep/wakeup. output_repaint_timer_handler() resets the
repaint_status if called while Weston is sleeping. If the timer is still active,
it will trigger a call to weston_output_finish_frame() which then triggers an
assertion, because the repaint_status is not REPAINT_AWAITING_COMPLETION.
Stop the timer and reset the repaint_status in this case to avoid this.
Schedule a repaint for WESTON_DPMS_ON to ensure that the current state is
rendered.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
set_dpms() is used for sleep/wakeup. output_repaint_timer_handler() resets the
repaint_status if called while Weston is sleeping. If the timer is still active,
it will trigger a call to weston_output_finish_frame() which then triggers an
assertion, because the repaint_status is not REPAINT_AWAITING_COMPLETION.
Stop the timer and reset the repaint_status in this case to avoid this.
Schedule a repaint for WESTON_DPMS_ON to ensure that the current state is
rendered.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
set_dpms() is used for sleep/wakeup. output_repaint_timer_handler() resets the
repaint_status if called while Weston is sleeping. If the timer is still active,
it will trigger a call to weston_output_finish_frame() which then triggers an
assertion, because the repaint_status is not REPAINT_AWAITING_COMPLETION.
Stop the timer and reset the repaint_status in this case to avoid this.
Schedule a repaint for WESTON_DPMS_ON to ensure that the current state is
rendered.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
set_dpms() is used for sleep/wakeup. output_repaint_timer_handler() resets the
repaint_status if called while Weston is sleeping. If the timer is still active,
it will trigger a call to weston_output_finish_frame() which then triggers an
assertion, because the repaint_status is not REPAINT_AWAITING_COMPLETION.
Stop the timer and reset the repaint_status in this case to avoid this.
Schedule a repaint for WESTON_DPMS_ON to ensure that the current state is
rendered.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
set_dpms() is used for sleep/wakeup. output_repaint_timer_handler() resets the
repaint_status if called while Weston is sleeping. If the timer is still active,
it will trigger a call to weston_output_finish_frame() which then triggers an
assertion, because the repaint_status is not REPAINT_AWAITING_COMPLETION.
Stop the timer and reset the repaint_status in this case to avoid this.
Schedule a repaint for WESTON_DPMS_ON to ensure that the current state is
rendered.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
If Xwayland crashes when we have windows lying around, we can get a
surface destroyed callback later that tries to log debug messages by
dereferencing a stale pointer to the defunct window manager to find the
log scope.
Let's finish this FIXME from 2012, and wipe out the windows.
Ref #1042
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Since "gitlab-ci: Use virtme-ng for running our tests" we no longer use
a hacky fork of virtme. Also, wee no longer use "--script-dir", as
virtme-ng properly supports "--script-sh".
So drop outdated comments.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This implements the basic color transformation from parametric to
parametric image description. The colorimetric rendering intents are
implemented. The perceptual and saturation rendering intents are
equivalent to media-relative + BPC rendering intent, subject to be
implemented better later.
Things missing:
- handling target color volumes
- perceptual dynamic range mapping
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
We will eventually have 6 different paths for creating color
transformations:
- input to blend, input to output
- ICC to ICC
- parametric to parametric
- ICC to parametric
- parametric to ICC
- blend to output
- ICC
- parametric
Set up their dispatching.
No changes to existing functionality.
xform_realize_chain() is now guaranteed to be called only with ICC
profiles.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This function is required for producing color transformations from
parametric image descriptions.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
I've been wanting a better name than search_param. In the future they
are not always search parameters when we have to replace the input
profile with another one for sRGB power-2.2 decoding purposes.
I think "recipe" describes this struct well: it's the list of
ingredients to cook a color transformation from.
This patch is purely renaming things.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This field is redundant, and therefore only confusing.
The success or not is returned from xform_realize_chain() directly. The
color processing steps vs. 3D LUT is recorded in
weston_color_transform.steps_valid.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Now that we are testing the more robust average error tolerance pretty
tightly, we can relax the tolerances on the maximum error which is more
flaky between GL drivers and hardware.
This makes sRGB->adobeRGB MAT test pass on radeonsi Polaris 11.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Maximum error is fragile: radeonsi on Polaris 11 has one error spike
that would force the the tolerances for everything to be much higher
than desired, and it masks changes to usual error levels.
Add a new condition to opaque_pixel_conversion: average two-norm error
statistic. The average is not as susceptible to outliers as maximum is.
We still keep the maximum error tolerance as well, to detect gross
outliers that might not sway the average enough to cause a test failure.
The new average error tolerances have been collected from the worst case
among the following + 0.01:
- GL renderer: Mesa Intel(R) HD Graphics 4600 (HSW GT2)
- GL renderer: AMD Radeon RX 550 Series (radeonsi, polaris11, ACO,
DRM 3.61, 6.12.35+deb13-amd64)
- GL renderer: llvmpipe (LLVM 19.1.7, 256 bits)
(There is no need to separately print matrix vs. clut, it is already in
the fixture name.)
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The concise table style was nice, but is getting more unwieldy as more
fields will be added. The new style won't fall apart.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The frame_device variable wasn't used in the commit that added it, and
later another commit that performed a bunch of clean-up bookkeeping added
cairo_device_destroy() for it. This was non-destructive because
cairo_device_destroy() handles NULL gracefully, but still Very Weird.
Remove it.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
With newer Vulkan-Headers built in the container, we may un-disable
vulkan-renderer in the debian lts jobs.
This also simplifies the CI script by removing a variant that existed
only for that purpose.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
The version in Debian 11 (bullseye) is only slightly too old to build
vulkan-renderer.
We already build our own Mesa drivers to a newer version anyway, so it
should be possible to test vulkan-renderer in bullseye if it builds.
The actual Vulkan-Headers version here could actually be older and still
build, but was chosen to be same as in Debian 12 (bookworm) for now as
it is a tested version which has also been available for a while.
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
On weston_output_repaint(), we have:
output_assign_planes(output);
...
output->repaint(output);
output_assign_planes() avoids calling output->assign_planes() when
output->disable_planes > 0. This brings a few complications to backends,
because they can't rely on the repaint loop starting from a certain
function: sometimes it starts from assign_planes(), others from
repaint().
Let's be more consistent: always call assign_planes() and let backends
handle output->disable_planes.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
If we call drm_output_find_plane_for_view() with
DRM_OUTPUT_PROPOSE_STATE_RENDERER_AND_CURSOR for a view that is not a
cursor view, it should fail to get a plane.
In such case, set the failure reason to FAILURE_REASONS_FORCE_RENDERER.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In the next commit we introduce a real "renderer-only" mode. So let's
rename DRM_OUTPUT_PROPOSE_STATE_RENDERER_ONLY to
DRM_OUTPUT_PROPOSE_STATE_RENDERER_AND_CURSOR, as it also assign views
to cursor planes.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Bump the tag to trigger container rebuild to include new kernel and also
ci-templates updates.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
When the same buffer is reused for both the first and second screenshot,
this can result in a deadlock. Avoid the issue by using a new buffer for
the second screenshot.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Use the FDO_CI_BASH_HELPERS functions from ci-templates to format the
gitlab ci logs for build-and-test.sh. This adds collapsible sections to make
the overall log easier to read.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>
Move the script from the build-and-test job to a separate bash file.
This makes it easier to read the .gitlab-ci.yml file and to edit the bash
script.
Signed-off-by: Deborah Brouwer <deborah.brouwer@collabora.com>