Mark all the SHM buffer as dirty to avoid garbage caused by original
damage information in GPU recovery.
Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
Call gl_renderer_attach_shm() to recreate all the SHM buffer states
in the new EGL context. This can enable non-GL applications to
continue running without crashing during GPU reset and recovery
processes, as if no GPU reset had ever occurred.
Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
For each frame, if the WESTON_RENDERER_ERROR_LOST occurs, we destroy
the context (which has already become invalid due to a GPU reset) and
all associated resources, then recreate them to ensure validity within
the new context.
Co-authored-by: Yuling Li <Yuling.Li@amd.com>
Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
Return WESTON_RENDERER_ERROR_LOST if GPU reset happened in function
gl_renderer_repaint_output() for further process
Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
When recovering the renderer, skip non-GL steps in
gl_renderer_destroy() and gl_renderer_display_create()
Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
Split the renderer init/destroy into two parts: one to init/destroy
(E)GL, and one to init/destroy the renderer state around it.
Introduce the following two new helper functions to centralize the
handling of GL-related operations
- gl_renderer_init_context
- gl_renderer_destroy_context
Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
Expose a small recovery-state hook so the compositor and DRM backend can
coordinate renderer rebuilds without duplicating GL renderer internals.
Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
Request a robust EGL context when the platform supports it and expose the
GL reset status hooks so Weston can detect GPU resets instead of being
aborted by the driver.
Signed-off-by: Trigger Huang <Trigger.Huang@amd.com>
A few custom shells want to know when the compositor is going to sleep.
This adds a new sleep signal and emits it when DPMS is going off.
To showcase the feature, this adds a sleep signal listener to
desktop-shell whose handler logs a message.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
When we receive dmabuf feedback, we hit the VK_SUBOPTIMAL path and
recreate the swapchain, returning early without submitting work.
However, we've already reset the fence before we do this, so we'll
block forever waiting for work that never comes to signal it.
Instead, we should reset the fence right before we know we're submitting
work.
Fixes: 75c37afa ("clients/simple-vulkan: New Vulkan client example")
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We currently leak resources and hit asserts if dmabuf is unavailable.
Move the check to before we initialize anything.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Since the commit "color-lcms: extract HDR static metadata from profile"
this was all dead code.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Extract the HDR static metadata type 1 from the output color profile
directly, instead of relying on a separate weston.ini section to provide
the metadata separately.
Weston should tell the monitor what target color volume it is rendering
for. I don't see a reason to be able to control the metadata separately,
and it would add complexity.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
We should just return 0 on success, not return some enum with
a value that happens to be initialized to something that resolves
to 0.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We can use __VA_OPT__ to make a macro that automatically selects between
the puts and printf log scope variants.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The point of buffer_transform_split is to ensure that committing only
transform and scale changes gets reflected on screen, without explicit
damage. There is no need to go through the big set of parameter
combinations, it only needs to test that changing each triggers the
damage.
Test setting only scale and only transform separately, so that one
cannot mask bugs with the other.
This brings the screenshot count for buffer_transform_split from 12 down
to 2, which is good for CI running time.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This test was originally written to ensure Weston does not repaint too
much, but it does also test that renderers transform the damage
correctly into the framebuffer.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Continuing my quest to remove weston_view from backends and renderers,
drop gl-renderer's last use of weston_view.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The paint_node life cycle should match the output's, so we should be able
to store it in the state instead of a view.
This gets us closer to having the backends stop caring about views.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We already validate the paint node list in weston_output_repaint,
immediately after we conditionally rebuild the z_order_list.
These asserts are thus completely redundant, as we've already
performed them in the front end.
My reason for removing this now is to drop weston_view usage
from the backend.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The paint node early update has already checked this value for us, we
should use that instead of interacting with the view.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Backends work on paint nodes, not views - and the paint node internal
name is a superset of the view internal name anyway, so it's not hard to
figure out which view a paint node belongs to when reading debug text.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The failure reason is already part of the paint node, so passing the view
here just makes things a little bit more complicated.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Backends should be relying on paint nodes for their information, not
views.
Since we always have a paint node when we want to pass a buffer, we can
pass that instead of a view.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Now that ICC<->parametric image description interoperability is
implemented, and the stock sRGB profile is parametric, we can change the
default to what it should be.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
TF_SRGB will be deprecated, best to never advertise it. The test can
simply use gamma22 instead.
TF_EXT_LINEAR has an implementation and should be usable nowadays.
TF_ST2084_PQ, GAMMA22 and GAMMA28 likewise.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Weston does not support the saturation rendering intent for parametric
image descriptions yet. Not really, Weston would just do the same as
media-relative with BPC does.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>