When multiple outputs are present, a failure in one's repaint will
cause any repaints of all other outputs to be cancelled. If this
happens during the headless "frame" time, the assertion on
repaint_status in weston_output_finish_frame fails.
Do the same as the DRM backend does in its equivalent callback
drm_output_update_complete and don't finish the frame.
Signed-off-by: Ray Smith <rsmith@brightsign.biz>
Recently I accidentally created a few files using spaces instead of
tabs. This patch fixes that.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This makes the code slightly easier to read and prevents using
incorrect locations now that shader permutations can provide different
vertex streams.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Index vertices from the damage mesh as lines and emit a single draw
call in fan debug mode. A new shader path and an additional vertex
stream are added in order to filter the color of the solid shader
variant per sub-mesh.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
A paint node with 'n' rects damaged by 'm' quads emits 'n*m' OpenGL
draw calls. This commit batches the 'n*m' clipped polygons into an
indexed triangle strip damage mesh using degenerate triangles. A
single draw call per paint node is emitted to reduce API overhead.
Fan debug mode is disabled for now and will be added back using
batching in the next commits.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
There is no need to expose it since it can be accessed by passing
non-axis aligned quads. Move existing tests to the quad clipper.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
The added complexity is unnecessary, it is limited to polygons of
length less than or equal to 8, there is currently no use for that
feature nor any plans to use it and tests are non-existent.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
The repaint loop is started when a client provides a new frame while the
compositor is idle. This frame should be shown as soon as possible. So it makes
no sense to commit the previous frame one more time before rendering the next
frame.
Just call weston_output_finish_frame() directly to start repainting immediately.
As a side effect, this fixes an issue when the output is resized when no
fullscreen shell is involved: At that point, parent.draw_initial_frame is
already false, so draw_initial_frame() is not called. But when resizing, the old
buffers are removed so the commit happens without a buffer attached to the
surface. So the surface is invisible for one frame until the next one is
rendered.
draw_initial_frame() is not removed here, because it is still needed for the
synchronous resize that happens with the fullscreen shell.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Since DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP capability is available in the
mainline kernel, now we should enable back tearing support.
v2:
- Bump kernel version to 6.9
- include the fallback definitions
Reviewed-by: Marius Vlad <marius.vlad@collabora.com>
Reviewed-by: Derek Foreman <derek.foreman@collabora.com>
Signed-off-by: Naveen Kumar <naveen1.kumar@intel.com>
Assume axis alignment using node's valid_transform boolean instead of
relying on the transform flags of the weston_view struct. This is more
reliable since matrix flags could erroneously hang around after a
series of transforms. Additionally, nodes with standard output
transforms like translations, flips and rotations by 90° can now take
the fast axis aligned path.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
This changes the callback frame list insertion after paint node late
update takes place in order for to the visibily region to be modified.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
When we lift planes entirely out of the scene graph, paint node visibility
calculations become "per plane". This means that when we lift something
onto a paint node, anything beneath it will be redrawn in response to
client side damage even if the lower surfaces are occluded.
Instead, keep the scene graph together and make the paint node visible
regions be their visibility within the global scene graph.
This has the side effect of plane motion causing redraws, to update
regions they've been obscuring. My assumption is that moving planes
is less frequent than damage being posted beneath an overlay, and
that we'll be more efficient for normal use cases this way.
An optimization is in place to prevent redraws when moving transparent
planes, as they haven't been occluding updates.
In addition to theoretically removing some wasteful rendering time, this
also simplifies damage accumulation.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
When a client is killed we don't get a clean dismissal of pop-ups in
construction order. This can lead to a weston_desktop_surface being
destroyed before its child popup is destroyed.
The weston_surface is still alive, so the surface destroy listener can't
save us.
Track grabbed seats in parent surfaces and explicitly break any grabs
that depend on them when the surfaces are destroyed.
Fixes#870
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
We've forgotten to set this up in some backends, so let's just do it in
weston_compositor_init_renderer().
The headless backend used to fail out if linux_dmabuf_setup() failed, but
had no reason to do so, so just remove that to make the code common.
Suggested by cwabbott on irc.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
The headless backend does not display to anything, so it doesn't care
what the colorimetry mode is. To allow testing compositor internal
behavior, claim to support all colorimetry modes.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Based on what is configured in weston_output, check and set the
colorimetry mode into KMS connector property "Colorspace".
This changes how video sinks interpret the pixels, and should allow
driving e.g. WCG monitors in BT.2020 mode.
This does not alter the pixel values themselves. That is the color
manager responsibility, and ultimately the responsibility of the
frontend and the end user to match the monitor driving mode with the
output color profile they chose.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Based on KMS "Colorspace" connector property, populate the mask of
supported colorimetry modes on a head.
EDID should be checked too, but it is currently ignored.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This API is mostly for use by the DRM-backend. Colorimetry mode is is
the KMS connector property "Colorspace" which defines the video signal
encoding colorimetry. A video sink indicates the supported modes in EDID
or DisplayID.
This patch adds the libweston API that allows backends to indicate the
supported modes for the frontends, and frontends to set the mode to be
used by backends. Colorimetry mode does not directly affect color
management inside Weston, it is only metadata for the video sink. It is
the frontend's responsibility to set up an output color profile that
agrees with the colorimetry mode. (That API has not been implemented
yet.) eotf_mode will be the same.
There is only one reason to make this a libweston core API instead of
a backend-drm API: when wayland-backend gains color-management protocol
support, meaning it can forward WCG and HDR content correctly to a
host compositor, the supported colorimetry modes can be determined from
the host compositor's supported color-management features, allowing the
guest Weston to pick some other output image description than the host
compositor's preferred image description. This likely allows only a few
other choices from standard colorspaces, so it's possible this isn't
sufficient for that use case.
Either way, it is easy to just copy the eotf_mode API design, and since
colorimetry_mode and eotf_mode go together, let both have the same API
design. It is possible to convert this to backend-drm API later.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Helper to assert that a value does not have any bit set outside of the
mask. To be used with "all bits mask" of enum types that enumerate bits.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Currently EOTF mode is not validated against the supported mask, to
allow easier experimenting without supplying a modified EDID through the
kernel.
The validation should be added before color management becomes
non-experimental.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This will allow me to use this header in libweston core to build a
single translation table between core enums, string names, and wdrm
enums.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Refactor existing code into a helper, so when I introduce more bit mask
enums, I don't need to copy the whole function.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Turns out these structures do not need to be in the public header, so
move them into a private header.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This patch is for our CM&HDR protocol extension implementation.
When a client requests to create an image description, it can only start
using that after receiving the 'ready' event. The compositor may take
the time it needs to create the backing color profile for such image
description. But nothing guarantees that clients will do the right
thing.
This fixes some issues for not well behaved clients and also documents
how we handle image description that are not ready.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This patch is for our CM&HDR protocol extension implementation.
When we gracefully fail to create an image description, we send the
'failed' event and the client can only destroy such image description.
But nothing guarantees that clients will do the right thing.
This fixes some issues for not well behaved clients and also documents
how we handle image description whose creation gracefully failed
internally.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
There's a comment with a TODO that would be super simple to implement,
but we preferred to wait at the moment. But there are discussions on the
upstream CM&HDR protocol MR that would change that. This patch documents
that.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
It doesn't make sense to stack the plane before it's useful - so only
put it in the compositor's plane list on output_enable. The opposite of
weston_output_enable is weston_compositor_remove_output, so release the
plane there.
This stops a crash when closing one of multiple windows for a nested
backend results in the output being freed while the plane is still on the
compositor's plane list.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Previously we assigned any paint node to the primary_plane of the output
it was on and marked it dirty.
This doesn't make sense if we're releasing the primary_plane.
Let's just delete the paint nodes and force a view list rebuild, which
will recreate them appropriately.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This should produce the best results on average for all kinds of apps on
any kind of display.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This is pure refactoring.
Ease readability by reducing code duplication between pre and post curve
powlin handling.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This is pure refactoring.
Ease readability by reducing code duplication between pre and post curve
linpow handling.
While at it, define symbols for the counts. This patch converts only
linpow. Powlin are converted in follow-up.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This is pure refactoring.
Ease readability by reducing code duplication between pre and post curve
LUT handling.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This prevents a potential crash where users of
weston_layer_entry_insert/layer_entry_remove() would see when moving
views into a NULL layer (effectively unmapping the surface/view).
Users that have migrated to the weston_view_move_to_layer() are immune
to this issue because that takes care of paint node destruction.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
When reading back for the remote backends we need to convert the extents
of the damage (which is in global coordinates) to output coordinates
to read back the correct region.
We were doing this in a bespoke fashion by adding the output coordinates.
Instead, use weston_matrix_transform_rect() to transform the extents by
the output transform - which includes the scale factor.
This fixes output scale on RDP with the gl renderer.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Until now, all the curves would be represented with 3x1D LUT's. Now we
support LINPOW and POWLIN curves (arbitrary names that we've picked).
We can use these curves to represent LittleCMS curves type 1, 4 and
their inverses -1, -4. The reason why we want that is because we gain
precision using the parametric curves (compared to the LUT's);
Surprisingly we had to increase the tolerance of the sRGB->adobeRGB MAT
test. Our analysis is that the inverse EOTF power-law curve with
exponent 1.0 / 2.2 amplifies errors more than the LUT, specially for
input (optical) values closer to zero.
That makes sense, because this curve is more sensible to input values
closer to zero (i.e. little input variation results in lots of output
variation). And this model makes sense, as humans are more capable of
perceiving changes of light intensity in the dark.
But the downside of all that is that for input values closer to zero, a
little bit of noise increases significantly the error.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In the next commit we'll add support for more color curves. So move
lut_3x1d to an union.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Given a certain curveset, get_parametric_curveset_params() returns true
if the curveset contains parametric curves. Also, it returns the
parameters of the curveset (for each curve) and if the input should be
clamped or not.
This is not a generic function, it will specifically work for some well
behaved curveset. E.g. we return false if there are more than 3 curves
(one per color channel).
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Currently in translate_curve_element() we always translate the curve
into a LUT. But in the future we'll be able to translate the curves to
parametric ones.
So move the current code to a new function
translate_curve_element_LUT(), so that in translate_curve_element() we
are able to call one of the two functions (_LUT() or _parametric()).
No behavior changes, just preparation for the upcoming patches.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Not a behavior change, but this allow us to decide what function pointer
to use within this function (instead of forcing callers to decide that).
In the following commits this will be helpful. We'll add more curves
besides 3x1D LUT's and, depending on the curve, the function pointer
signature may differ.
Also, we now pass the xform directly to the function, and it can select
the curves depending if it is being called for a pre or a post curve.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Pointer values are hard to track for humans, being long numbers. Now
that we have unique id for each color transformation, print that instead
of the pointer. It is a small number easy to track for humans.
Transformation id numbers do get re-used aggressively, so you have to
keep track of what is being destroyed and created over time when reading
logs. Pointers had the same caveat, just a lot more random.
The prefix 't' indicates "transformation".
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Just like with color profiles, generate an ID for color transformations
as well. This is not needed by protocol or anything, it is just for
debugging purposes. A small ID is easier for humans than a long pointer
value.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Pointer values are hard to track for humans, being long numbers. Now
that we have unique id for each color profile, print that instead of the
pointer. It is a small number easy to track for humans.
Profile id numbers do get re-used aggressively, so you have to keep
track of what is being destroyed and created over time when reading
logs. Pointers had the same caveat, just a lot more random.
The prefix 'p' indicates "profile", just in case we use another id space
for some other thing similarly.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
A proper dependency on egl is missing for several backends as well as
for libshared. This dependency is necessary to pull in the correct
include directories from the egl.pc pkg-config file.
Signed-off-by: Jordan Williams <jordan@jwillikers.com>
The windowed output API is implemented by the Wayland, the X11 and the
headless backends. It's currently not possible to create a secondary
headless backend when the primary backend is Wayland or X11 because
the windowed output API would be registered twice. This commit
suffixes the windowed output API names with the backend name in order
to avoid clashes: "weston_windowed_output_api_<backend>_v2".
A use case for Wayland or X11 as primary backend and headless as
secondary is for instance to request output captures on the headless
backend to avoid read backs on the primary backend's render buffers.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Failure to do so, might cause a crash if the output repaint happens
before the pipewire pipeline started -- calling pixman_region32_fini on
a uninitialized region.
Fixes 2abe4efcf7, "libweston/backends: Move damage flush into backends"
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Plug async read back support to OpenGL ES 2 implementations using
GL_NV_pixel_buffer_object, GL_OES_mapbuffer extensions and
GL_EXT_map_buffer_range.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Using a fence sync triggered on read back completion allows to
precisely know when it completed. The timeout path is kept as a
fallback when fence syncs aren't available.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
SHM buffer stride validation is duplicated in sync and async output
capture paths. Move it into a common path to avoid duplication.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
ReadPixels() implies a synchronous read back of the render buffer to
return pixel data. OpenGL ES 3 adds asynchronous read back support by
writing the pixel data into a dedicated buffer object. This commit
adds asynchronous read back support to the output capture code. It
spawns a read back request and schedules a timeout a few frames later
in order to store the pixels into the client SHM buffer.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
There is no reason why cmlcms_fill_in_3dlut() would not work for
blend-to-output category, so the assert is a little misplaced.
However, there would be a bug if 3D LUT was used for blend-to-output,
because we should never fail to optimize that chain. Put the assert
where it belongs.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Stop special-casing the blend-to-output category, and pass it through
the same mechnisms and optimizations as all other transformations. In
the future, more curve types will be added to weston_color_transform,
meaning that blend-to-output does not always have to be a LUT. It could
become a parametric curve, which is more efficient and more precise to
compute, when VCGT does not exist.
Drop the special crafting of output_inv_eotf_vcgt LUT and replace it
with inv_eotf cms profile. inv_eotf will be combined with vcgt cms
profile as a chain as needed instead.
Blend-to-output transformations do not use a render intent, but we have
to tell cmsCreateMultiprofileTransformTHR() something, so arbitrarily
pick ICC-Absolute render intent for it.
Now all color transformations go through xform_realize_chain(), where
the documentation is improved.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
We need it as a cms profile, so let's make it one to start with. We even
gain non-datal error handling.
This will also be useful in rewriting output_inv_eotf_vcgt next.
The type change of vcgt_curves is required to be able to call
cmsCreateLinearizationDeviceLinkTHR(), even though everything about
vcgt_curves should be doubly const. The curves are populated on demand
and cached in cmsHPROFILE, so we also must not explicitly free them.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
We need it as a cms profile, so let's make it one to start with. We even
gain non-fatal error handling.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
cmsHPROFILE is a typedef of void *.
This means you can change the type of pointer variable to or from
cmsHPROFILE, and the compiler will not see any difference. The compiler
is happy to implicitly cast any pointer type to cmsHPROFILE and back.
In order to bring some type safety for future refactorings that will be
doing such type changes, introduce a wrapper struct. The wrapper being
an actual unique type will not allow implicit casting.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Return an error string so we can report the cause in more detail.
For consistency, add checking for VCGT dup failure, so we can report
that too. Leaking partial VCGT array on VCGT dup failure is fixed.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Refactor and rename retrieve_eotf_and_output_inv_eotf().
Refactoring to make the calls more convenient to read, and preparation
for changing the object types for the curves.
ensure_output_profile_extract() reserves a place for another function
that works on parametric profiles instead of ICC profiles.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The plan is to have the frontend decide on the EOTF mode and colorimetry
mode, but also the frontend is responsible for setting up a color
profile that matches the chosen modes. Therefore we don't need to care
about the modes explicitly here.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Render intent does not depend on the output (profile), so drop that
argument. Render intent does not apply in blend-to-output category in
our design, so make it NULL there. Then, we only need to check the
surface for a render intent from a client.
The assert is dropped, because we don't need to advertise to clients all
the rendering intents we support internally. Even though we do.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
The clean-up following this patch will set the render intent field to
NULL when it does not apply (blend-to-output transformation). Make sure
we handle it.
In the search param string, fix a typo, and stop claiming we get a
render intent from a profile; we never do.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
No need to update x1, x2 and y1 when merging a damage rect into a
previous one because they don't change. Melt merge_rect() into the
band compression routine as it's quite short now and convert the
boolean-based for/else construct to a more concise goto-based one.
Describe the compression logic to give a bit more context.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
transform_damage() expects a non-empty damage region. Remove
compress_bands()'s run-time handling of errors and use asserts to
prevent programming errors.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
The axis alignment test is part of the damage transformation routine
executed for each damage rect. Extract it in order to compute it once
per paint node.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Previous commit ensured damage rects compression (first step) happens
just once when a paint node both has an opaque and a translucent
region. This one makes sure that the damage rects transformation to
surface space (second step) happens just once.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Before rendering a surface, its visible region is intersected with the
damage region in global space. The resulting region is compressed
(first step) and transformed to surface space (second step) for
clipping. These steps sometimes happen twice when a paint node both
has an opaque and a translucent region. This commit makes sure the
first step happens just once.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Fixes compiler warnings about the declaration in function signatures not
applying outside of the functions.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This is not strictly necessary, because if init fails, then
weston_compositor_backends_loaded() fails, main.c will
weston_compositor_destroy() -> weston_compositor_shutdown() ->
cmclcms_destroy() which will free this. But that is very hard to track
down, so let's make the code obviously more correct.
We must also avoid cmsDeleteContext(NULL), because it will then do
something to the default cms context rather than bail out.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This does not change any behaviour, but creating complex dynamic things
was intended to be done in init() rather than color_manager_create().
Create is called from weston_compositor_load_color_manager() before
loading backends, and init is called from
weston_compositor_backends_loaded() after loading backends.
Now we assert instead of check that scope creation succeeded, because
the only way it could fail is to have small memory allocations fail, or
internal code error.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
No changes to the functions at all. This makes them available for use in
cmlcms_init() for the next patch.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This reverts commit 188a3ebd5e.
Call weston_compositor_enable_color_management_protocol() after
compositor->color_manager has been set, and so allows to check if the
color manager supports the features mandatory in protocol. The check is
added in the next patch.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
"Get" could imply increasing reference count, and color transform
objects indeed are reference counted, but this function does not do
that. Rename it to reduce confusion.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
This makes it more explicit that this indeed is increasing the reference
count, rather than just returning a pointer.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
"Get" could imply increasing reference count, and color transform
objects indeed are reference counted, but this function does not do
that. Rename it to reduce confusion.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
"Get" could imply increasing reference count, and color profile objects
indeed are reference counted, but this function does not do that. Rename
it to reduce confusion.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
"Get" might easily imply reference counting, but there is none here.
"to" is more descriptive for a cast.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
"Get" could imply increasing reference count, and color profile objects
indeed are reference counted, but this function does not do that. Rename
it to reduce confusion.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
"Get" might easily imply reference counting, but there is none here.
"to" is more descriptive for a cast.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Currently we create the color profile id generator in
weston_compositor_backends_loaded() and destroy it in
weston_compositor_shutdown().
If something goes wrong and Weston does not start properly, we end up
calling weston_compositor_shutdown() for a struct weston_compositor
whose color profile id generator is NULL, crashing.
This fixes that, creating/destroying the id generator in
weston_compositor_create()/destroy().
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
The shell_surface may disappear when keyboard lost focus,
then the shsurf will be NULL.
Have an ahead check for shsurf before calling the callback
in weston_desktop_surface_foreach_child.
Fixes#811
Tested-by: Erkai Ji <erkai.ji@nxp.com>
Signed-off-by: Wujian Sun <wujian.sun_1@nxp.com>
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Damages and captures both trigger repaints of outputs. Some
configurations don't care about damages and use headless only for
captures. This commit adds a new feature to libweston that lets
outputs repaint only on captures, not on damages. The headless backend
enables that new feature when given a special refresh rate of 0 mHz.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Custom headless refresh rates can be useful to instrument clients
matching different screen configurations. This commit adds support for
that to the headless backend and exposes it to the frontend with the
"--refresh-rate" CLI option. The default refresh value is still 60 Hz.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
When we are destroying the color manager, the components referencing
color profiles should have already been destroyed. We have an assert
in cmnoop_destroy() to make sure that the stock profile has refcount
equal to 1.
But we currently have an issue in Weston. While shutting down with
client surfaces alive, we may leak them. So we try to destroy
the color manager with surfaces still alive, and they may be
referencing color profiles.
We already have a workaround for this in our LittleCMS color plugin,
but we've missed that in color-noop. This fixes that, so now we don't
hit the assert anymore.
As we are already dealing with asserts in color-noop, I took the
liberty to replace the last usage of assert with our own wrapper
in this file.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Avoid memory use-after-free when the trying to remove entries from an
already freed list later.
Also add missing removal in drm_output_detach_head() and drm_head_destroy().
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
When using some features from LittleCMS in our CI, we are seeing some
crashes on the address sanitizer. Bumping the LittleCMS version fixes
that. So build and install a more recent version of LittleCMS on our CI.
We chose version 2.16 because it introduces the function
cmsGetToneCurveSegment(). We already make extensive use of that in our
codebase, so it is a good idea to have that on our CI as well.
Now color-curve-segments.c will start to get build on the CI, as
HAVE_CMS_GET_TONE_CURVE_SEGMENT will be true. So we also fix a minor
issue in which we were comparing int with uint in this file, what was
caught after experimenting bumping the LittleCMS version.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In this patch we enable the color-management protocol support, as long
as the color-manager plugin in use supports it.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In this MR we add support to the majority of the interfaces from the
color-management protocol.
That means that we are able to advertise output's images descriptions to
clients, preferred surface images descriptions, and so on. We also
support clients that wants to create ICC-based images descriptions and
set such descriptions for surfaces.
We still don't support the interface to allow clients to create
image descriptions from parameters, but that should be addressed
in the near future.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Similar to pixel-formats.c, but for color properties. This helper
aggregates the same color properties from different APIs into tables,
and introduce functions to use that.
The idea is that we only use that internally in our libweston struct's,
and pick the specific API value only when necessary.
Preparation for the CM&HDR protocol extension implementation.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This is preparation for the CM&HDR protocol implementation. It requires
us to give a unique id to each color-profile, so let's do that.
In this commit we introduce a generic id generator to libweston, and
its first user: the color-profile.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
The non-zero area check of clipper_quad_clip() is incorrect for quads
initialized with a polygon starting with a vertical edge. In order to
handle polygons starting with an horizontal edge and polygons starting
with a vertical one, it must check opposite vertices for equality.
The test previously described as "Box intersects entire smaller
aligned quad" is now described as "Clockwise winding and top/left
initial vertex". This test keeps the same values as before but all
combinations of winding order and first edge orientations are
also tested. The QUAD() macro isn't used anymore to do so.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Add quad clipping tests checking intersections at all edges and
corners of axis-aligned and unaligned quads with negative and positive
values.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
I want re-use this variable for printing the colorimetry mode list as
well in a future patch, so a generic name is less confusing.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Performance-wise this is moot, but since we are detecting if the raw
EDID data changed, might as well use it.
Now we have a path where the head's device_changed is almost guaranteed
since EDID changed, and that's useful for the next patch.
We can only do this, because the core initializes a head with values
that we would be setting anyway when EDID is missing, e.g. disconnected
head on compositor start-up.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Store the EDID data as-is, so that we can tell when the EDID blob has
changed. This is not too useful yet, because all the weston_head_set_*()
API raises the device_changed flag only if the information actually
changes. However, I want to expose the libdisplay-info di_info structure
through weston_head, and those cannot be (as) easily compared.
We need to know when the EDID blob changes, so we can call
weston_head_set_device_changed() appropriately when updating di_info.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
One of the three fixture setups of alpha-blending test requires
color-lcms.so. If color-lcms.so is not built, that fixture fails.
Make it skip as necessary, making the test suite pass with
color-management-lcms=false build option.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Just like we already do for planes with proper zpos. Otherwise we'll
often end up choosing the primary plane instead of an overlay one
in `drm_output_find_plane_for_view()`.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
This seems to think formats needs to be NULL terminated, but it doesn't
and gl_renderer_get_egl_config asserts that all formats_count elements
are not NULL.
This happens when EGL_KHR_no_config_context is not supported.
Signed-off-by: Ray Smith <rsmith@brightsign.biz>
It adds the followig paragraph:
```
Starting from version 5, the invalid_format protocol error is sent if
all planes don't use the same modifier.
```
We already assumed this in some places and, most importantly, it's
required by the kernel. Thus alter `dmabuf_attributes.modifier` to make
it clear that different modifiers for multi-planar dmabufs were never
supported.
Signed-off-by: Robert Mader <robert.mader@collabora.com>
commit 79212ba9ad fixed a bug by
introducing a new one.
Before that point we could clip paint node damage to stale
visibility data. After that point we post damage for occluded
views, leading to large amounts of pointless drawing.
Add back the clip to visible region, in
weston_output_flush_damage_for_plane(), where we have up to date
visibility region information.
fixes 79212ba9ad
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
If client changes the buffer transform or size and re-commit the surface
before surface dirtys buffer (weston_surface_attach), the viewport
source validity check may fail. Because the width_from_buffer and
height_from_buffer cannot be updated based on new buffer transform.
Therefore, add the situation of size dirty (WESTON_SURFACE_DIRTY_SIZE) to
source validity check, width_from_buffer and height_from_buffer can be
updated in time when the buffer transform and scale change.
Signed-off-by: Chao Guo <chao.guo@nxp.com>
The `drm_output_deinit` should use the drm device passed by the
function, should not use the `b->drm` device.
Signed-off-by: Zhou Liang <174381115@qq.com>
If both the head and writeback are not found, then we should add
connectors to the drm device passed by the function, not the b->drm
device.
Signed-off-by: Zhou Liang <174381115@qq.com>
In a multi-GPU environment, different cards may contain connectors with the
same ID, and drm_head_find_by_connector just use the connector_id to find
the connector, it may find the wrong connector.
Fix this by find the connector based on the drm device and connector id.
Signed-off-by: Zhou Liang <174381115@qq.com>
If a view is non-opaque - such as an overlay over a video - we shouldn't
force it to be on the primary plane, as that's where the underlying
content should be placed, such as the video view.
dc0de9ee already mentioned: "This check should be changed in future to
only filter for opaque views, but that's for another time."
Adding "Fixes" at this is arguably a bug fix:
Fixes: dc0de9ee (backend-drm: Move overlay vs. primary plane check earlier)
Fixes: 2538aacc (backend-drm: Construct a zpos candidate list of planes)
Signed-off-by: Robert Mader <robert.mader@collabora.com>
Currently we flush damage for the "primary plane" every repaint, but this
is folly.
The drm backend may skip rendering entirely if using an all-planes
composition. This could leave the renderer plane in a messy state if a
surface on an overlay plane disappears.
Instead, let the backends flush the primary plane damage when they know
they need to render.
Fixes#864
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
And with it, bump libweston to next major version, 14. We seems like
we never used that argument so better just removed it.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
The idle_animation_destroy task should be removed when destroying
animations by the other callers such as handle_animation_view_destroy().
Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
Latest musl has removed the declaration from string.h [1] as it only
implements POSIX version alone and string.h in glibc implements GNU
version of basename. This now results in compile errors on musl.
This might be a warning with older compilers but it is error with
Clang-17+ as it treats -Wimplicit-function-declaration as error
Switch the use in backlight_init function to use POSIX version
[1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7
Signed-off-by: Khem Raj <raj.khem@gmail.com>
This was added in 4def21c196.
0c1ab2ad76 removed all uses of NULL
weston_compositor, making the workaround unnecessary.
Drop the workaround, it's dead code.
Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Fix a crash when right-clicking on a weston-terminal, where
weston_desktop_seat_popup_grab_add_surface() is called with
seat->popup_grab.keyboard.keyboard == NULL in case there is
no keyboard connected.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Manually mark the surface as mapped exactly once - in the committed
handler where we have our content, and assert that it's correct when we
want to use the surface by instantiating a view.
The view handling can be made much more simple by simply using the new
view helpers.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Use the helpers to map a weston_surface and weston_view, rather than
manually manipulating the internals.
Signed-off-by: Daniel Stone <daniels@collabora.com>
When working on tablet tools, use the weston_surface and weston_view
helpers to manipulate their cursors, instead of manually setting various
members.
Signed-off-by: Daniel Stone <daniels@collabora.com>
Extract quad bounding box initialization from the GL renderer and move
it to a dedicated initialization function in the clipper. It's used by
both the renderer and the clipping test client, which further reduces
code duplication.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Simplify clip_transformed() by replacing its context parameter with a
clipping box parameter. The context struct is still used internally to
pass data around.
Since clip_transformed() doesn't take a context anymore, the clipping
boxes are now declared per test and stored along with the other vertex
data. That prepares the ground to add new tests using different boxes.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Carry on the common vertex representation front by making boxes use
the clip_vertex struct.
A new function clip_quad_box32() is added to clearly separate the main
function taking a clip_vertex struct from the utility function taking
a pixman_box32 struct.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Pass a clip_vertex struct and a size to clip_transformed() instead of
a polygon8 struct to simplify the clipper API by sticking to a common
vertex representation.
Simmplify vertex-clip test since clip_transformed() now works on a
copy of the polygon (commit edd5d1cc09).
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
clip_simple() isn't used anymore outside of the clipper. This commit
removes it to simplify the clipper API. Its implementation is moved
straight to the axis-aligned quad clipping path of clip_transformed().
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
We can't use the surface damage to determine when to upload new cursor
images because when heads overlap the first repainted head will accumulate
that damage as plane damage.
We can't easily use plane damage either because the plane isn't really
assigned until after an atomic test, which requires the cursor fb to be
current.
Untangle this mess a little by always testing with the first cursor fb,
which is identical to the second in all ways, then replace with the correct
fb in repaint.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Now that overlapping outputs are a thing, we have a problem with vnc
cursors.
The surface->damage used to update the vnc cursor might actually be
flushed by a previous output's repaint cycle, leading to a missing cursor
update to the vnc client.
Instead we should use the damage accumulated on the cursor plane to choose
when to update the cursor. This damage is in output coordinates, so let's
be lazy and just use the presence of damage as an indicator that the
cursor needs an update.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
VISIBILITY_DIRTY is used to apply damage to the plane, but that doesn't
make sense for non-primary planes.
For example, we don't want moving the cursor to result in damage being
registered on the cursor plane.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
When an output repaints, it calculates visibility for its paint nodes,
accumulates damage for all paint nodes across all outputs, and then
paints.
This means that when it's accumulating damage for all paint nodes in
paint_node_add_damage(), it may be accumulating damage to nodes on other
outputs that haven't had their visible regions updates yet.
This leads to clipping with a stale visibility region, and losing damage.
Let's just drop the clip here for now - there are already other places
where paint nodes have to carry damage outside their visible regions.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This is a revert of 72e2da24
The VNC backend will place a single fullscreen surface on a virtual
scanout plane, and send the entire contents of this plane every repaint.
This saves a renderer pass, but moving the mouse over the fullscreen
client results in full screen damage for every mouse motion, similarly
client surfact damage is ignored and every repaint pushes the entire
window content down into Neat VNC.
Due to the way this is implemented, by pushing the scanout plane content
from assign_planes(), the primary plane could post damage and corrupt
the display.
Ideally we could fix this optimization to respect plane damage and do the
scanout plane push from the repaint callback, but since a release is
coming soon let's just strip it out for now.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Stop assuming that NULL represents the stock sRGB color profile. From
now on, query the stock sRGB color profile from the color manager.
This should be internal to libweston (core and the color plugins), and
users of the libweston public API should not be affected by this. They
are still allowed to set an output color profile to the stock sRGB using
NULL.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
cmlcms_get_hdr_meta() returns early if the output has a color profile
set. That makes sense, because we should be able to get the color
characteristics from the color profiles.
But in the next commits, every output will have a color profile set. To
allow the color-metadata-parsing test, do not return early when
output->color_profile != NULL in cmlcms_get_hdr_meta() anymore.
In the future we'll adjust this function in order to always extract the
color characteristics from color profiles, as output->color_profile
should always be set.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In the next commit we'll stop using NULL as the stock sRGB color
profile, so add a function to the color manager to allow libweston core
to have access to the stock sRGB profile.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
In the next commit we introduce a function to get the stock sRGB color
profile from the color-manager, so mock a stock color profile in the
color-noop.
It has no valid content, but should make callers happy. This is safe to
do because the color profile is opaque, and only color-noop itself
should have access to its content.
color-lcms already has a stock sRGB color profile, so we don't have
to do anything there.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Directly destroying the cprof is not ideal, because it may hide issues
that we have in the code. If we are destroying a cprof with ref_count
bigger than 1, there's something wrong that we need to fix.
Instead, assert that the stock sRGB cprof has ref_count == 1 when we are
destroying the color manager. And use unref() instead of destroy().
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Ignore any client-supplied offset to subsurface commits to keep the same
consistency we find on other compositor.
Fix: #829
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Otherwise we end up with an invalid backend on the shutdown path of the
compositor. This mimics what the wayland back-end does.
Fixes 14c52a942b, 'backend-x11: enable multi-backend support'.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Conditionally create the renderer like other secondary backends.
Now that we have multi-backend support and overlapping outputs, an
interesting use case for the headless backend exists.
We can have a high performance steady state on the drm backend with
all content on scan-out planes, bypassing the renderer. Taking a
screenshot of this would ideally use readback, but some hardware is
incapable of readback, or only capable at certain resolutions.
By using the headless backend as a secondary backend, and creating a
headless output that overlaps the drm outputs, we can take the
screenshot on the headless backend without disrupting the plane
layout on the drm backend.
For this to be efficient, other changes need to be made, but this is
a step in that direction.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
A constraint always has a surface, but may not have a view - use the
surface pointer directly without trying to get it through the view.
Fixes#823
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Any coordinate that didn't change during clamping was left uninitialized,
resulting in failures later.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Between assign_planes() and pnode_update_late(), the pnode's plane may
not yet be up to date. This leads to the visible region being incorrectly
calculated for paint nodes beneath a paint node that changes planes. Their
visible regions will still contain a cut out for the node that no longer
occludes them.
However, we place damage on nodes beneath a node that changes planes in
order to redraw the region beneath a node that moves from the primary to
non-primary plane.
The gl-renderer clips to a paint node's visible region when rendering it,
so this accidental cut-out masks away all the damage and leaves us with
a mess.
Fix this by using the correct plane in the visibility calculation.
Fixes#821
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
If coverage and power status are the same, we should prefer a primary
backend over a secondary one.
Fixes#818
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
When an output power state changes, it may become or no longer be the
best primary output for a view.
Fixes#819
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
If our primary output is turned off, we won't get frame events, so let's
try really hard to prioritize a turned on output with coverage.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
In some use cases the VNC client should not be allowed to resize the VNC
output. Add a boolean option "resizeable" in the VNC [output] section to
control this.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
The counterpart to weston_surface_is_unmapping(). This is valid for the
duration of processing the surface commit.
Signed-off-by: Daniel Stone <daniels@collabora.com>
If a surface has already been mapped, just return early out of
weston_surface_map(), rather than firing the map signal and rebuilding
the view list.
Signed-off-by: Daniel Stone <daniels@collabora.com>
We already have these for global coordinates, now we have them for
surface coordinates too. In addition to removing some unsightly
unadorned coordinate usage, this also adds appropriate coordinate space
id checks at runtime.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This is a tricky bit of code and we use it in two places. Let's make a
single implementation.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Second try at removing direct logind support. This time more careful
with the documentation, as libseat can still use logind even if we don't
directly use it.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This reverts commit 55bf6b5046.
This accidentally removed things that should have stayed - libseat
can still use the logind API, even if weston doesn't directly use
it.
Note that the logind-launcher does not actually build anymore
because breaking changes landed before this revert.
Since we're removing it again right away, I've not taken care to
fix that.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This avoids spreading around the knowledge that the primary backend is
the first backend on weston_compositor::backend:list.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Let weston_compositor_load_backend() return a backend pointer and remove
the backend pointer from struct weston_compositor.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Releasing the buffer reference here works because the backend has seen the
surface and has updated keep_buffer if necessary. With multiple backends
the assumption breaks. The same surface may be visible (now or later) on an
output from another backend. This backend has not seen the buffer yet so it
cannot update keep_buffer.
As a result, the reference is released to early. A surface that is rendered
on a secondary backend first can no longer be placed on a plane on a DRM
backend.
To avoid this, always keep the buffer reference until it is replaced when
multiple backends are involved.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
All backends add themselves to weston_compositor::backend_list now.
Drop the workaround that catches unconverted backends that still set
weston_compositor::backend.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Insert the backend into the weston_compositor::backend_list instead
of setting weston_compositor::backend. The compositor uses this to
determine whether the backend is capable of being loaded simultaneously
with other backends.
The X11 backend can only be loaded as primary backend.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Insert the backend into the weston_compositor::backend_list instead
of setting weston_compositor::backend. The compositor uses this to
determine whether the backend is capable of being loaded simultaneously
with other backends.
The Wayland backend can only be loaded as primary backend.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Insert the backend into the weston_compositor::backend_list instead
of setting weston_compositor::backend. The compositor uses this to
determine whether the backend is capable of being loaded simultaneously
with other backends.
To stay backwards compatible, the VNC backend can be loaded as primary
backend. It also supports being loaded as secondary backend.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Insert the backend into the weston_compositor::backend_list instead
of setting weston_compositor::backend. The compositor uses this to
determine whether the backend is capable of being loaded simultaneously
with other backends.
To stay backwards compatible, the RDP backend can be loaded as primary
backend. It also supports being loaded as secondary backend.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
Insert the backend into the weston_compositor::backend_list instead
of setting weston_compositor::backend. The compositor uses this to
determine whether the backend is capable of being loaded simultaneously
with other backends.
To stay backwards compatible, the PipeWire backend can be loaded as
primary backend. It also supports being loaded as secondary backend.
Co-authored-by: Michael Tretter <m.tretter@pengutronix.de>
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Insert the backend into the weston_compositor::backend_list instead
of setting weston_compositor::backend. The compositor uses this to
determine whether the backend is capable of being loaded simultaneously
with other backends.
The headless backend can only be loaded as primary backend.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Insert the backend into the weston_compositor::backend_list instead
of setting weston_compositor::backend. The compositor uses this to
determine that the backend is capable of being loaded simultaneously
with other backends.
The DRM backend can only be loaded as primary backend.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Before loading a backend, clear the weston_compositor::backend pointer
to check whether the backend supports multi-backend operation and adds
itself to the weston_compositor::backend_list.
Keep weston_compositor::backend pointing to the last loaded backend
either way, to allow the calling compositor code to store it away for
later, to check whether a head belongs to a given backend in the output
configuration code. This workaround can be removed after all backends
are converted to be multi-backend aware.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
In preparation for multi-backend support, determine the presentation
clocks that are supported by all backends.
Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
In preparation for multi-backend support, start/flush/cancel repaint on
all backends by looping over the weston_compositor::backend_list.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
In preparation for multi-backend support, add a list of backends to the
weston_compositor structure. Until backends are converted, this list
just contains the single weston_compositor::backend. Keep that pointer
for now, until the conversion is complete.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This has been deprecated and non-default for a full release cycle, so
we're going to remove it now.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
Replace the finish frame handler logic with a call to the
weston_output_finish_frame_from_timer() helper function that
does the same.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Replace the finish frame handler logic with a call to the
weston_output_finish_frame_from_timer() helper function.
This makes finish_frame_handler() return more exact timestamps
calculated from the previous frame time if the timer callback
was not delayed too much.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Replace the finish frame handler logic with a call to the
weston_output_finish_frame_from_timer() helper function that
does the same.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Extract the finish frame timestamp code and the call to
weston_output_finish_frame() into a new helper function
weston_output_finish_frame_from_timer() that can be reused
by the other timer driven backends sharing the same logic.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Replace the finish frame timer arming logic with a call to the
weston_output_arm_frame_timer() helper function that does the same.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Replace the finish frame timer arming logic with a call to the
weston_output_arm_frame_timer() helper function that does the same.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Replace the finish frame timer arming logic with a call to the
weston_output_arm_frame_timer() helper function that does the same.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Extract pipewire_output_arm_timer() into libweston so it can be reused
by the other timer driven backends that use the same delay logic.
Call the shared function weston_output_arm_frame_timer().
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
This should avoid spurious signal events received by the shell in order
to resize its buffer.
As we can have resize events being sent even if xdg-shell activation
doesn't happen, make use of the output dimensions to determine if we
need do send out a resize event or not.
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Copy the output repaint timing code from the PipeWire backend.
This evens frame pacing under varying render time and allows
to actually reach 60 fps.
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>