Commit Graph

2335 Commits

Author SHA1 Message Date
Pekka Paalanen 570b348f45 color-lcms: replace comments in ensure_output_profile_adds_icc()
I did not understand the old comments. The new comments explain what
happens here.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-03-07 14:50:47 +00:00
Pekka Paalanen 547dc2738a color-lcms: improve ensure_output_profile_extract() error reporting
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>
2024-03-07 14:50:47 +00:00
Pekka Paalanen 3488e2403f color-lcms: refactor into ensure_output_profile_extract()
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>
2024-03-07 14:50:47 +00:00
Pekka Paalanen 7ccb9736b3 color-lcms: move output-only fields from cmlcms_color_profile
Refactoring to allow the next patch, no functional changes.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-03-07 14:50:47 +00:00
Pekka Paalanen 5d6e7115a9 color-lcms: make identity_pipeline comment more detailed
This perhaps better explains what the issue here is.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-03-07 14:50:47 +00:00
Pekka Paalanen e6551ef41f color-lcms: remove stale comments about eotf_mode
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>
2024-03-07 14:50:47 +00:00
Pekka Paalanen 07eeed8f90 color-lcms: simplify getting render intent
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>
2024-03-07 14:50:47 +00:00
Pekka Paalanen 0d3fa81840 color-lcms: handle NULL render intent
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>
2024-03-07 14:50:47 +00:00
Loïc Molinari bc2d30050b gl-renderer: Only update y2 when merging damage rects
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>
2024-03-05 11:48:17 +00:00
Loïc Molinari 7ba16ef264 gl-renderer: Prevent programming errors on damage regions
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>
2024-03-05 11:48:17 +00:00
Loïc Molinari 946bb51a2a gl-renderer: Test axis alignment once per paint node
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>
2024-03-05 11:48:17 +00:00
Loïc Molinari 445e83c417 gl-renderer: Transform damage rects once per paint node
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>
2024-03-05 11:48:17 +00:00
Loïc Molinari 2170caade0 gl-renderer: Compress damage rects once per paint node
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>
2024-03-05 11:48:17 +00:00
Loïc Molinari 2d71347397 gl-renderer: Move functions to ease next commit review
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2024-03-05 11:48:17 +00:00
vanfanel 90664b0f3b libweston: enable pointer constraints for fullscreen surfaces.
Signed-off-by: vanfanel <redwindwanderer@gmail.com>
2024-03-04 12:45:07 +01:00
Pekka Paalanen 7e22c28444 color: declare cm_image_desc_info
Fixes compiler warnings about the declaration in function signatures not
applying outside of the functions.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-02-23 16:46:39 +02:00
Pekka Paalanen 61b3ae335a color-lcms: clean up context in init failure
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>
2024-02-23 16:46:39 +02:00
Pekka Paalanen 80c0d5e643 color-lcms: create log scopes in cmlcms_init()
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>
2024-02-23 16:46:39 +02:00
Pekka Paalanen 3e9f8402ad color-lcms: move two functions up in file
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>
2024-02-23 16:46:39 +02:00
Pekka Paalanen dcaff175b4 libweston: assert that color manager supports perceptual
This is required by the protocol spec.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2024-02-23 16:46:39 +02:00
Pekka Paalanen d9a7b3795a libweston: move color-management protocol init call to core
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>
2024-02-23 16:46:39 +02:00
Pekka Paalanen 35a580dab6 color-lcms: rename get_cprof_or_stock_sRGB to to_cprof_or_stock_sRGB
"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>
2024-02-23 16:46:39 +02:00
Pekka Paalanen 4f796a52e1 color: rename get_stock_sRGB_color_profile to ref_stock_sRGB_color_profile
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>
2024-02-23 16:46:39 +02:00
Pekka Paalanen ce51a04013 color-lcms: rename get_xform() to to_cmlcms_xform()
"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>
2024-02-23 16:46:39 +02:00
Pekka Paalanen 6fe294c18a color-lcms: rename get_cprof() to to_cmlcms_cprof()
"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>
2024-02-23 16:46:39 +02:00
Pekka Paalanen 952f3ef61d color-lcms: rename get_cmlcms() to to_cmlcms()
"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>
2024-02-23 16:46:39 +02:00
Pekka Paalanen f19b15e373 color-noop: rename get_cprof() to to_cmnoop_cprof()
"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>
2024-02-23 16:46:33 +02:00
Pekka Paalanen de1db83e04 color-noop: rename get_cmnoop to to_cmnoop
"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>
2024-02-23 16:31:40 +02:00
Leandro Ribeiro ffe08c4344 libweston: create/destroy color profile id generator in a safe point
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>
2024-02-23 11:50:23 +00:00
Wujian Sun 042d02f422 libweston-desktop: Fix weston crash when lost the shsurf
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>
2024-02-23 10:14:42 +08:00
Loïc Molinari 7b2eddf022 backend-headless: Add support to repaint only on captures
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>
2024-02-22 14:26:32 +00:00
Loïc Molinari 6caeba699d backend-headless: Add support for custom refresh rates
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>
2024-02-22 14:26:32 +00:00
Leandro Ribeiro 6da5b8a5a5 color-noop: avoid assert hit in cmnoop_destroy()
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>
2024-02-22 11:38:22 +00:00
Jeffy Chen 9406664a54 backend-drm: Cleanup output's disable head list when destroying it
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>
2024-02-21 11:14:23 +00:00
Leandro Ribeiro 39ada71cb3 gitlab-ci: build and install LittleCMS version 2.16
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>
2024-02-14 12:13:04 -03:00
Leandro Ribeiro 188a3ebd5e libweston: expose color management support
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>
2024-02-14 11:15:35 -03:00
Leandro Ribeiro 5706d7e5d2 color: add support to the color-management protocol
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>
2024-02-14 11:15:35 -03:00
Leandro Ribeiro c7d33edd01 color: add color properties helper
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>
2024-02-13 14:15:31 -03:00
Leandro Ribeiro a84806a88e libweston: add unique id generator
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>
2024-02-13 14:08:38 -03:00
Morgane Glidic 0de497f868
libweston/desktop: Update my Copyright
Signed-off-by: Morgane Glidic <sardemff7+git@sardemff7.net>
2024-02-11 19:07:39 +01:00
Loïc Molinari 5516527f2b tests: Add box32 quad clipper tests
Add a few tests ensuring the box32 quad clipping wrapper works as
expected.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2024-02-06 09:21:11 +00:00
Loïc Molinari e82ce8032c gl-renderer: Fix quad clipper non-zero area check
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>
2024-02-06 09:21:11 +00:00
Loïc Molinari 1f9637ec8e tests: Add quad clipper tests
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>
2024-02-06 09:21:11 +00:00
Pekka Paalanen f880732004 backend-drm: rename eotf_list to str
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>
2024-01-29 15:22:33 +02:00
Pekka Paalanen fc0a74a4c9 backend-drm: skip EDID parsing if no change
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>
2024-01-29 15:22:27 +02:00
Pekka Paalanen 2c0a9c064a backend-drm: store EDID data
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>
2024-01-29 15:20:04 +02:00
Pekka Paalanen 4a028ade32 tests: conditionally skip part of alpha-blending
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>
2024-01-26 14:31:35 +02:00
Dylan Aïssi 0f260b4f78 backend-rdp: fix typo: chunck -> chunk
Signed-off-by: Dylan Aïssi <dylan.aissi@collabora.com>
2024-01-25 21:42:49 +01:00
Robert Mader e34e027515 backend-drm: Sort planes by faked zpos
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>
2024-01-22 17:16:19 +01:00
Ray Smith 885c616589 backend-drm: fix confused fallback format handling
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>
2024-01-22 09:29:01 +00:00
Robert Mader e37454a262 linux-dmabuf: Add support for protocol version 5
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>
2024-01-19 18:59:22 +01:00
Jeffy Chen e454de5af3 renderer-gl: Fix segfault when reading pixels
We should use the actual stride to create tmp pixmap.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2024-01-16 22:18:30 +08:00
Jeffy Chen 623c7b5202 renderer-gl: Fix wrong stride error when reading pixels
The gl_renderer_do_read_pixels() is expecting stride in bytes.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2024-01-16 22:18:30 +08:00
Derek Foreman e74f2897b9 libweston: Clip damage to paint node visible region
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>
2024-01-15 14:03:41 +02:00
Chao Guo 8e0e75999e compositor: improve viewport source validity check
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>
2024-01-12 13:44:03 +00:00
Zhou Liang b288e662d6 backend-drm: fix deinit unexpected connector
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>
2024-01-12 12:11:45 +00:00
Zhou Liang 66aaa41074 backend-drm: fix drm add connector to unexpected drm device
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>
2024-01-12 12:11:45 +00:00
Zhou Liang 8b3becf524 backend-drm: fix drm find wrong connector
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>
2024-01-12 12:11:45 +00:00
Robert Mader 5a2509ffb1 backend-drm: Don't force non-opaque overlays to primary plane
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>
2024-01-11 15:57:09 +01:00
Derek Foreman 2abe4efcf7 libweston/backends: Move damage flush into backends
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>
2024-01-10 14:13:09 -06:00
Marius Vlad 04d9f7e738 libweston/animation: Remove weston_fade_run unused argument
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>
2024-01-09 13:15:16 +02:00
Jeffy Chen b074186836 libweston: Avoid double-destroy of animations
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>
2024-01-05 09:08:03 +08:00
Khem Raj dbd134ca5a libweston,tools: Include libgen.h for basename signature
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>
2023-12-18 21:13:52 +00:00
Pekka Paalanen b84ad9e34c libweston: drop weston_output_init() test workaround
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>
2023-12-15 14:15:22 +02:00
Philipp Zabel b72785e1f6 libweston-desktop: Work around crash when opening popup menu
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>
2023-12-11 16:58:01 +01:00
Daniel Stone a5c5702112 touch-calibrator: Regularise surface/view mapping
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>
2023-12-06 12:16:27 +00:00
Daniel Stone 16825359c7 input: Use surface/view helpers for drag surfaces
Use the helpers we have to map and position drag icons.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-12-06 12:16:27 +00:00
Daniel Stone 7f62fe817a input: Use surface/view helpers to map
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>
2023-12-06 12:16:27 +00:00
Daniel Stone 1f9e0ce9ad input: Use helpers to map surfaces/views
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>
2023-12-06 12:16:27 +00:00
Loïc Molinari 309a546165 gl-renderer: Improve clipper documentation
Add clipper_clip() documentation and improve comments a tiny bit.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2023-12-05 10:54:39 +00:00
Loïc Molinari 42205628bf gl-renderer: Prefix clipper API
Prefix and slightly rename the clipper structs and funcs:

  - struct clip_vertex -> struct clipper_vertex
  - struct gl_quad     -> struct clipper_quad
  - clip_transformed() -> clipper_clip()
  - init_quad()        -> clipper_quad_init()
  - clip_quad()        -> clipper_quad_clip()
  - clip_quad_box32()  -> clipper_quad_clip_box32()
  - float_difference() -> clipper_float_difference()

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2023-12-05 10:54:39 +00:00
Loïc Molinari 2d0d0175d2 gl-renderer: Add init_quad() to clipper
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>
2023-12-05 10:54:39 +00:00
Loïc Molinari f74c5a4102 gl-renderer: Replace clip_transformed() context with a clipping box
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>
2023-12-05 10:54:39 +00:00
Loïc Molinari bf222f1897 gl-renderer: Use clip_vertex struct for boxes in clipper API
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>
2023-12-05 10:54:39 +00:00
Loïc Molinari b8063dbb13 gl-renderer: Remove polygon8 struct from clipper API
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>
2023-12-05 10:54:39 +00:00
Loïc Molinari aac11c8884 gl-renderer: Remove clip_simple() from clipper
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>
2023-12-05 10:54:39 +00:00
He Yong 98606d6a03 replace weston_signal_emit_mutable with wl_signal_emit_mutable
wayland upstream has introduced wl_signal_emit_mutable
now we can use it

[1]: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/208

Signed-off-by: He Yong <hyyoxhk@163.com>
2023-12-04 11:37:17 +02:00
Arnaud Vrac 9c637d70eb gl-renderer: do not use glTexImage3D directly
Resolve the function through eglGetProcAddress instead as it's only defined
starting with OpenGLES 3.0.

Signed-off-by: Arnaud Vrac <avrac@freebox.fr>
2023-11-29 15:13:49 +00:00
Marius Vlad 93e4f4e01f backend-x11: Fix error shutdown path for x11
Another fix for 14c52a942b, 'backend-x11: enable multi-backend support'.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-11-20 16:31:26 +02:00
Derek Foreman 78657c5ff3 drm-backend: Fix cursor updates with overlapping heads
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>
2023-11-10 09:38:41 -06:00
Derek Foreman bbaba601c8 vnc: Fix cursor updates
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>
2023-11-10 09:38:35 -06:00
Derek Foreman 0def955a48 libweston: Don't set VISIBILITY_DIRTY on non-primary planes
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>
2023-11-10 09:37:43 -06:00
Derek Foreman 79212ba9ad libweston: Don't clip damage to paint node visible region
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>
2023-11-10 09:37:43 -06:00
Derek Foreman 8b7597d40f vnc: Remove scanout plane optimization
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>
2023-11-09 11:23:22 -06:00
Leandro Ribeiro cab1992b81 color: do not use NULL as stock sRGB color profile
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>
2023-10-30 11:47:35 +00:00
Leandro Ribeiro afbc729e71 color-lcms: extract color characteristics even when output cprof != NULL
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>
2023-10-30 11:47:35 +00:00
Leandro Ribeiro 977c41a65c color: add get_stock_sRGB_color_profile() to color manager
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>
2023-10-30 11:47:35 +00:00
Leandro Ribeiro 154ce42b8c color-noop: add stock color profile
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>
2023-10-30 11:47:35 +00:00
Leandro Ribeiro 33ed93561e color-noop: make use of xalloc helpers
Use xzalloc instead of zalloc, etc.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2023-10-30 11:47:35 +00:00
Leandro Ribeiro 39de0bd988 color-lcms: unref stock sRGB cprof instead of directly destroying it
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>
2023-10-30 11:47:35 +00:00
Marius Vlad d18fd64a15 libweston: Ignore subsurface offsets
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>
2023-10-26 14:46:10 +00:00
Marius Vlad 8d85c43355 backend-x11: Move back-end removal to the destroy function
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>
2023-10-23 20:10:19 +03:00
Derek Foreman e3a509236b headless: Enable use as a secondary backend
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>
2023-10-16 12:13:21 +00:00
Derek Foreman e622be7423 input: avoid crash by using surface directly
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>
2023-10-13 07:46:44 -05:00
Derek Foreman e49294b901 libweston: fix output clamp helper
Any coordinate that didn't change during clamping was left uninitialized,
resulting in failures later.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-10-09 08:19:44 +00:00
Derek Foreman 209b7eb56a backend-drm: Fix visibility calculation
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>
2023-10-06 12:39:57 -05:00
Derek Foreman 176a413ef0 libweston: Prefer primary backend when assigning outputs to views
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>
2023-10-06 11:50:50 +00:00
Derek Foreman 305e954f76 libweston: Reconsider view primary output on output power change
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>
2023-10-06 11:50:50 +00:00
Derek Foreman d3fa809c55 libweston: Consider output power state when selecting primary
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>
2023-10-06 11:50:50 +00:00
Philipp Zabel d1df848d94 compositor, backend-vnc: Allow to disable output resizing
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>
2023-10-05 11:43:12 +02:00
Philipp Zabel 690beab475 backend-vnc: Implement output resizing
Let VNC clients resize the VNC output.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2023-10-05 11:00:21 +02:00
Philipp Zabel 8895b15f3d ci, backend-vnc: update to Neat VNC 0.7.0
Neat VNC 0.7.0 supports desktop resizing.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-10-05 11:00:12 +02:00
Daniel Stone cae789774a surface: Check parents in weston_surface_is_mapped()
A subsurface is not considered to be fully 'mapped' unless its ancestors
are also mapped.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-10-04 11:44:10 +03:00
Daniel Stone 2faf491f61 surface: Add weston_surface_is_mapping()
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>
2023-10-04 11:44:10 +03:00
Daniel Stone 5c75ecccfe surface: Don't re-map already-mapped surfaces
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>
2023-10-04 11:44:10 +03:00
Derek Foreman 720421c193 libweston: Add and use weston_coord_surface_add/sub helpers
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>
2023-10-03 18:19:17 +00:00
Derek Foreman cec0ab7d23 libweston: Make better use of global coord helpers
Use wesotn_coord_sub/add() in many more places.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-10-03 18:19:17 +00:00
Derek Foreman 18cce195d3 libweston: Make a common helper for clamping a coord to an output
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>
2023-10-03 18:19:17 +00:00
Derek Foreman 71e38cf2ef libweston: Use weston_coord_surface in weston_surface_state
Use this for the buffer attachment offset coordinates.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-10-03 18:19:17 +00:00
Derek Foreman 4f17af4691 libweston: Remove dbus helpers
Now that launcher-logind is gone, we don't use any of this anymore.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-09-29 09:58:01 -05:00
Derek Foreman e3b6ed50f1 launcher: Remove launcher-logind
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>
2023-09-29 09:55:32 -05:00
Derek Foreman 3959c90c7c launcher: Drop drm dependency
This was probably only for launcher-direct, and hasn't been required for
a while.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-09-29 09:47:43 -05:00
Derek Foreman 2296781cee launcher-libseat: Rename libseat_dep
Most other dependencies are named dep_* so let's conform.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-09-29 09:47:43 -05:00
Derek Foreman 501e3f193f launcher-libseat: Don't depend on dbus
The libseat launcher doesn't directly use dbus functions.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-09-29 09:47:43 -05:00
Derek Foreman 754562fb52 Revert "launcher: Remove launcher-logind"
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>
2023-09-29 09:46:48 -05:00
Philipp Zabel c93a54ece3 libweston: add explicit weston_compositor::primary_backend pointer
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>
2023-09-28 14:02:04 +00:00
Philipp Zabel a4f0666659 libweston, compositor: let weston_compositor_load_backend return backend
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>
2023-09-28 14:02:04 +00:00
Michael Olbrich 44f36b9b55 libweston: don't return buffers early with multiple backends
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>
2023-09-28 14:02:04 +00:00
Philipp Zabel 6d3fa71d7b libweston: drop workaround for multi-backend incapable backends
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>
2023-09-28 14:02:04 +00:00
Philipp Zabel 14c52a942b backend-x11: enable multi-backend support
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>
2023-09-28 14:02:04 +00:00
Philipp Zabel bb3b9374aa backend-wayland: multi-backend support
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>
2023-09-28 14:02:04 +00:00
Philipp Zabel c857042b45 backend-vnc: enable multi-backend support
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>
2023-09-28 14:02:04 +00:00
Philipp Zabel f014009419 backend-rdp: Enable multi-backend support
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>
2023-09-28 14:02:04 +00:00
Philipp Zabel 308d5cf367 backend-pipewire: enable multi-backend support
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>
2023-09-28 14:02:04 +00:00
Philipp Zabel baaef12432 backend-headless: enable multi-backend support
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>
2023-09-28 14:02:04 +00:00
Philipp Zabel 281aa0a4d7 backend-drm: enable multi-backend support
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>
2023-09-28 14:02:04 +00:00
Philipp Zabel 20c5b4527c libweston: allow loading multiple backends
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>
2023-09-28 14:02:04 +00:00
Philipp Zabel 3d50069afc libweston: intersect all backends' supported presentation clocks
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>
2023-09-28 14:02:04 +00:00
Philipp Zabel 183c309b85 libweston: use weston_compositor::backend_list instead of ::backend
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>
2023-09-28 14:02:04 +00:00
Philipp Zabel 76372375ab libweston: store backends in a list
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>
2023-09-28 14:02:04 +00:00
Leandro Ribeiro 08018d3a28 linux-dmabuf: replace assert with the new weston-assert
Make use of the new weston-assert in linux-dmabuf.c

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2023-09-28 06:52:24 +00:00
Derek Foreman 55bf6b5046 launcher: Remove launcher-logind
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>
2023-09-28 06:47:06 +00:00
Philipp Zabel b7fb70630a backend-x11: Use weston_output_finish_frame_from_timer()
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>
2023-09-27 12:37:09 +03:00
Philipp Zabel 8888777b26 backend-rdp: Use weston_output_finish_frame_from_timer()
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>
2023-09-27 12:37:09 +03:00
Philipp Zabel 98cd2e9f97 backend-vnc: Use weston_output_finish_frame_from_timer()
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>
2023-09-27 12:37:09 +03:00
Philipp Zabel 2fc6a8bbd2 backend-pipewire, libweston: Extract weston_output_finish_frame_from_timer()
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>
2023-09-27 12:37:09 +03:00
Philipp Zabel fd10c92d69 backend-x11: Use weston_output_arm_frame_timer()
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>
2023-09-27 12:37:09 +03:00
Philipp Zabel 6fb3443ff4 backend-vnc: Use weston_output_arm_frame_timer()
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>
2023-09-27 12:37:09 +03:00
Philipp Zabel b7400c614e backend-rdp: Use weston_output_arm_frame_timer()
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>
2023-09-27 12:37:09 +03:00
Philipp Zabel eec50e5aac backend-pipewire, libweston: Extract weston_output_arm_frame_timer()
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>
2023-09-27 12:37:09 +03:00
Marius Vlad b51462d001 backend-wayland: Don't signal out resize events for activation
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>
2023-09-26 14:07:25 +00:00
Philipp Zabel d9a8073568 backend-x11: fix output repaint timing
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>
2023-09-18 20:41:51 +00:00
Derek Foreman d62c1b7f7b shell-utils: Use weston_coord in curtain params
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-09-18 20:35:37 +00:00
Derek Foreman 9f7f8faff6 input: Use weston_coord in the cursor confinement code
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-09-18 20:35:37 +00:00
Derek Foreman 9e12250707 shells: Use weston_coord for shell API
Replaces a lot of x, y pairs with weston_coord.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-09-18 20:35:37 +00:00
Derek Foreman 5fa3ef26c9 libweston: Use weston_coord for touch interfaces
Most of these don't use the parameter that changes at all, but some get
a nice simplification.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-09-18 20:35:37 +00:00
Derek Foreman 8eed64c7df libweston: Add weston_view_set_position_with_offset
There are many times when we want to set a global position with a surface
offset added.

It's a fairly nasty operation, and most places in the code currently do
it naively, ignoring the painful existence of freeform window rotations
and other complex transforms that could be in play (but probably aren't)

Add a helper for this and convert existing usage.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-09-18 20:35:37 +00:00
Derek Foreman b87dcbdf34 input: Fix pointer hotspot coordinate space
Oops, this was always wrong but nothing actually checked it. Checks are
coming, so it needs to be fixed.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-09-18 20:35:37 +00:00
Loïc Yhuel 71616edc4d gl-renderer: use correct read-back format and support WL_SHM_FORMAT_ABGR8888
PIXMAN_a8r8g8b8 / PIXMAN_a8b8g8r8 only matches GL_BGRA_EXT / GL_BGRA on little-endian.
So to have a GL format, we should use DRM_FORMAT_ARGB8888 / DRM_FORMAT_ABGR8888.

Without GL_EXT_read_format_bgra, the read-back format is DRM_FORMAT_ABGR8888.
Then weston-screenshooter fails to create a wl_shm buffer with WL_SHM_FORMAT_ABGR8888,
unless it has been added with wl_display_add_shm_format.

Signed-off-by: Loïc Yhuel <loic.yhuel@softathome.com>
2023-09-15 07:04:02 +00:00
Pekka Paalanen d79fc78152 libweston: set default monitor strings
Allow passing NULL to monitor string in order to set the default
"unknown" strings. This allows a head to be initialized with the default
strings, meaning that it will no longer be mandatory for a backend to
call weston_head_set_monitor_strings(). In DRM-backend case this makes
future changes more convenient.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2023-09-15 06:56:59 +00:00
Pekka Paalanen c26335bfdb libweston: use xstrdup for head strings
We never expected these strdups to fail, and things tend to assume these
fields are not NULL (except serial_number).

Use xstrdup to ensure that a catastrophic OOM is immediately obvious.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2023-09-15 06:56:59 +00:00
Pekka Paalanen 3728d7e99b backend-drm,pipewire,remoting: do not set monitor serial to "unknown"
If serial is unknown, it's best to leave it as NULL. All usage sites
already deal with it possibly being NULL.

This makes DRM-backend consistent with all other backend that leave
serial as NULL, allowing to move the initialization of these fields into
core.

Pipewire and remoting plugins are modified just for consistency.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
2023-09-15 06:56:59 +00:00
Philipp Zabel e541aea2d7 backend-rdp: make sure to finish frames with timestamps in the past
Round up the ms delay to make sure that the finish_frame_timer always
expires after the next frame_time. That way, finish_frame_handler()
never passes a timestamp in the future to weston_output_finish_frame().
Setting frame_time into the future risks hitting an assert in
weston_output_finish_frame(), when it is called from start_repaint_loop
within the frame interval.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-09-15 09:52:37 +03:00
Philipp Zabel 5a95339d7a backend-vnc: make sure to finish frames with timestamps in the past
Round up the ms delay to make sure that the finish_frame_timer always
expires after the next frame_time. That way, finish_frame_handler()
never passes a timestamp in the future to weston_output_finish_frame().
Setting frame_time into the future risks hitting an assert in
weston_output_finish_frame(), when it is called from start_repaint_loop
within the frame interval.

Use CLIP() to simplify limiting the ms delay to a reasonable range.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-09-15 09:48:37 +03:00
Philipp Zabel 4d14adaa2c backend-pipewire: make sure to finish frames with timestamps in the past
Round up the ms delay to make sure that the finish_frame_timer always
expires after the next frame_time. That way, finish_frame_handler()
never passes a timestamp in the future to weston_output_finish_frame().
Setting frame_time into the future risks hitting an assert in
weston_output_finish_frame(), when it is called from start_repaint_loop
within the frame interval.

Use CLIP() to simplify limiting the ms delay to a reasonable range.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-09-15 09:44:44 +03:00
Joshua Watt 617bb9afc9 Check weston_head_from_resource for NULL return
If the compositor is disabling a weston_output,
weston_head_from_resource can return NULL, so the return code must be
checked where used.

Fixes #638

Signed-off-by: Joshua Watt <JPEWhacker@gmail.com>
2023-09-14 13:31:06 +03:00
Loïc Yhuel 623646bbfd gl-renderer: Do not attach the first buffer twice
When gl_renderer_attach is called, surface->buffer_ref.buffer points to the buffer.
So if the surface state needs to be created, we have :
gl_renderer_attach -> get_surface_state -> gl_renderer_create_surface -> gl_renderer_attach

Fixes: 895b1fdcb2 ("gl-renderer: Attach buffer during surface state creation if possible")
Signed-off-by: Loïc Yhuel <loic.yhuel@softathome.com>
2023-09-13 15:31:19 +00:00
Loïc Yhuel c00ef0a5ce libweston: Do not include private headers in shell-utils.h
Since it's a public header, it should be usable outside of weston tree.

Signed-off-by: Loïc Yhuel <loic.yhuel@softathome.com>
2023-09-11 10:28:57 +02:00
Robert Mader 12744bcbee renderer-gl: Add YUV format descriptors for P010/P012/P016
For drivers not supporting importing them directly. We use the equivalent
values to NV12 but with 16bit. The lowest 6 or 4 bits for P010/P012 are
padding and set to zero, so we can use the same subformats like for P016
and share the shader with NV12.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2023-09-07 15:46:57 +02:00
Robert Mader 3c9e9d721e pixel-formats: Add P010/P012/P016 formats
They are the 10/12/16bit equivalents of NV12 and at least P010 is widely
supported for a while now, so let's support them.

Signed-off-by: Robert Mader <robert.mader@collabora.com>
2023-09-07 15:44:13 +02:00
Tomohito Esaki 1e781d9f88 drm-backend: Drop support libgbm older than 21.1.1
Since drm-backend requires libgbm 21.1.1 or later, there is no need to
support the old libgbm which does not support modifiers or fd import.

Signed-off-by: Tomohito Esaki <etom@igel.co.jp>
2023-08-09 21:45:42 +03:00
Derek Foreman 3f2ce98278 libweston: Rebuild view list after adding an output
This fixes an assert() that can fire when outputs are hotplugged.

Fixes #787

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-08-07 09:39:26 -05:00
Philipp Zabel 63e473a9cf libweston: Move color manager fallback into weston_compositor_backends_loaded()
Initialize no-op color manager in weston_compositor_backends_loaded()
if weston_compositor_load_color_manager() was never called.

This makes weston_compositor_load_backend() live up to its name and
prepares it to be called multiple times.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-08-02 17:16:35 +02:00
Philipp Zabel 53a51461f9 libweston: Prepare weston_compositor_backends_loaded for extension
Move the presentation clock selection loop into
weston_compositor_set_presentation_clock() and refactor
weston_compositor_backends_loaded() to make it possible
to add more functionality.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-08-02 17:16:30 +02:00
Marius Vlad 0713ea7ee6 backend-drm/meson.build: Require at least mesa 21.1.1
We seem to be using at least mesa 21.1.1 since Weston 10, but we never
explicitly asked for it.

Fixes: #790

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-08-02 15:42:19 +03:00
Derek Foreman b75f1c0fd1 libweston: Delete paint nodes when views change layers
Since we use paint nodes to track damage, we have to be very careful to
make sure that we never have paint nodes that aren't actually being
displayed on their outputs.

Shells may move views to invisible layers (minimized_layer, inactive_layer)
and this currently leaves the paint node alive but not visible on its
output.

When this happens, the paint node's previous visible region is left
undamaged, and the paint node is removed from processing.

Let's delete paint nodes when their views change layers, thus creating
damage for their full visible region.

This may create excess damage if the paint node moves between two visible
layers, but this is probably far less harmful than leaving pieces of
invisible views on screen.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-08-02 12:08:19 +03:00
Derek Foreman ea4700c81f libweston: Fix "fix paint_node_damage_below"
Commit 43b59786 errantly claimed that paint_node_damage_below() needed to
damage all planes because it's used when moving paint nodes between
planes.

This is wrong because the destination plane will receive damage correctly
from paint_node_update_late() when the node's visible region is added to
its damage.

Leave the rest of that commit's changes, but make it once again only
damage the plane the node is currently on.

The problem this caused is easily seen by turning on triangle fan debug
and moving the mouse. Extra damage is generated beneath the cursor plane.

Fixes 43b59786

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-08-02 12:08:19 +03:00
Philipp Zabel 1d59530e4b libweston: Set the presentation clock in the compositor
Let backends declare the presentation clocks they can use with a
new bitfield weston_backend::supported_presentation_clocks and set
presentation clock after loading the backend in the compositor.

Make weston_compositor_set_presentation_clock() internal and replace
weston_compositor_set_presentation_clock_software() with an exported
weston_compositor_backends_loaded(), which is called by the compositor
after the backend is loaded.

In the future, this can be extended to determine the subset of clocks
supported by all backends.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-08-02 11:51:56 +03:00
Philipp Zabel 51d23a409a gl-renderer: Stop reading presentation clock without shaders to time
Stop reading the presentation clock if the return value is never used.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2023-08-02 11:51:56 +03:00
Sergio Gómez cc837eea61 kiosk-shell: Redesign the function 'find_focus_successor()'
The function find_focus_successor() is called when destroying a surface to find
a successor to the current focus. It, however, has the following issues:

- Its first parameter is the weston layer from which to search for a successor.
  This is an unnecessary flexibility for our use, which only adds complexity to
  the user of the function by having to make a call for each layer. We know
  that we want to search for a successor first in the normal layer, and if that
  fails, then in the inactive layer. So we change the signature of
  find_focus_successor(), removing this first parameter.

- It includes logic to decide whether to do the search or not: if the destroyed
  surface is different from the surface that currently has focus, and if their
  outputs are the same, then abort and don't do the search. This returns NULL to
  the calling function. The problem is that the function also returns NULL if
  it does the search and finds no successor. The distinction for the failing
  reason is lost, and the user of the function needs to add more logic to know
  the reason for failure. To simplify, we take the logic out of
  find_focus_successor() and inside the caller.

- It returns the successor view, although it receives surfaces and the client
  has logic to retrieve the surface corresponding to the returned view. To
  simplify and maintain symmetry, we change the signature so that the function
  returns the surface corresponding to the successor view.

Fixes: #738

Signed-off-by: Sergio Gómez <sergio.g.delreal@gmail.com>
2023-07-27 10:13:48 +03:00
Daniel Stone fdc0bafd4c input: Don't schedule repaints for drag-and-drop
We don't need to manually schedule a repaint when we've moved the view
for a drag & drop icon.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-24 12:35:47 +03:00
Daniel Stone 6da16f0998 animation: Remove unnecessary repaint schedule
We don't need to manually schedule a repaint after we've updated our
views - which happens as a side effect of destroying the transform/etc
within the animation.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-24 12:35:47 +03:00
Daniel Stone bd97abf18f input: Remove unnecessary repaint schedules
There's no need to call weston_view_schedule_repaint() once we've
updated view properties.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-24 12:35:47 +03:00
Daniel Stone 259420dde1 view: Schedule view repaint when changing properties
Whenever a view is moved, we should schedule a repaint for the outputs
the view is on. This avoids users having to do it by hand every time
they change something. There is no change in determinism of behaviour
(e.g. 'I can reconfigure views as often as I like and it won't take
effect until I schedule a repaint' isn't true, because output repaints
might happen for reasons outside your control).

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-24 12:35:47 +03:00
Derek Foreman 43b59786e6 paint_node: Fix paint_node_damage_below
This list walk is broken, the intent was to walk the tail of the list
starting from the currently held node - but that is not what happens.
Instead, walk the list backwards and stop a the held node.

Also, paint_node_damage_below() is used when moving paint nodes between
planes, and in these cases we definitely don't want to limit damage to
the current plane.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-20 14:52:08 -05:00
Derek Foreman 550c4c3dbc libweston: Remove plane clip
Currently this isn't calculated properly, and results in clipping away
important damage when a client moves from a non-primary plane to the
primary plane.

Instead of trying to fix it, let's just throw it away.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-20 14:42:55 -05:00
Derek Foreman 89ff5ddfd9 libweston: Replace struct_weston_position with weston_coords
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-19 07:48:30 -05:00
Derek Foreman 60a00d8c6c xwayland: Use weston_coord
Smash weston_coord into a whole bunch of xwayland internals.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-19 07:41:33 -05:00
Derek Foreman eebbe26d7b libweston-desktop: Unset use_geometry when unsetting relative_to
In other parts of the code, use_geometry implies a parent is present. So
let's clear it when we clear relative placement.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-19 12:37:08 +00:00
Derek Foreman 123e921871 xwayland: Fix assert with some parented windows
Having use_geometry set is not the only time we have a parent window,
apparently.

Clicking on the 'Line diff' drop down in gitk would cause an assert()
because of this.

Fixes #769

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-19 12:37:08 +00:00
Marius Vlad 3e4aff6af4 backend-drm: Make DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP inert
Until kernel mainline does merge the aysnc page flip ioctl, make the
whole bit look like it's unsupported. We can further switch it back when
it lands into the kernel.

Fixes: 9203d98f

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Reported-by: Simon Ser <contact@emersion.fr>
2023-07-18 14:58:08 +03:00
Philipp Zabel a401a1b247 renderer-gl: only flush damage for surfaces used in the next output repaint
Stop flushing surfaces that are put on an overlay plane on the output to
be repainted next, but that have to be painted into another output's
primary_plane.

Now that each output has its own primary_plane, and flush_damage() knows
the output that is going to be repainted, texture_used can be limited to
surfaces that will actually be used by the renderer during the following
repaint_output().

Always upload when called from gl_renderer_surface_copy_content() or
gl_renderer_create_surface() with the output parameter set to NULL.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-07-14 16:30:52 +00:00
Philipp Zabel 155fa3a56a libweston: Add output parameter to weston_renderer::flush_damage()
When flush_damage() is called, the output to be repainted next is
already known. Pass it along into the renderer, which can make use
of this information:

The GL renderer can get a better idea which SHM surface textures
actually have to be updated, in case a surface can be put on a plane
on one output, but not another.

A future Vulkan renderer could record texture uploads into an output
specific command buffer.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2023-07-14 16:30:52 +00:00
Christopher Obbard 463ebda4e4 libweston: Split dbus support into seperate build option
Currently dbus support is built when launcher-logind option
is set; let's split that such that dbus is its own option
and launcher-logind depends on dbus.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2023-07-14 10:55:24 +00:00
Christopher Obbard 9e36620be7 libweston: Decouple dbus helper to public namespace
Currently the dbus helper stuff is internal only in libweston,
let's move it to being public so that custom shells may use
the helper code.

Signed-off-by: Christopher Obbard <chris.obbard@collabora.com>
2023-07-14 10:55:24 +00:00
Daniel Stone daac6fc91d backend-wayland: Free pixel formats on shutdown
We allocated them, we should free them.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-12 12:30:53 +01:00
Philipp Zabel 04c29e6aae backend-vnc: use weston_output_set_single_mode()
Use the shared helper extracted from the RDP backend to avoid leaking
modes into the output mode list on every resize.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-07-11 15:43:29 +00:00
Philipp Zabel e58452d6be backend-rdp: extract weston_output_set_single_mode()
The ensure_single_mode() helper replaces an output's single mode.
Extract it into libweston so it can be reused by the VNC backend,
and rename it to weston_output_set_single_mode().

At the same time, set the the previously missing
WL_OUTPUT_MODE_CURRENT flag on the new mode.

Fixes #758

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-07-11 15:43:29 +00:00
Derek Foreman 4c63a12857 libweston: Remove overlapping output checks
We can now have overlapping outputs, so we can remove the checks that
protected us against this previously.

We may want to consider adding checks for discontinuities in the future
though, so leave a brief comment where the checks used to be.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman c4725f509f drm: allow views on more than one output to be on a plane
Now that planes are attached to paint nodes, we no have no reason to
prevent placing a view on a plane when it's on multiple monitors.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman ee7971e2cd libweston: have one primary_plane per output
The primary_plane is currently shared amongst all outputs, and is the last
barrier to having overlapping outputs.

Split it up and make it per output instead.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman 4def21c196 tests: prevent tests from breaking when they use invalid weston_compositor
The color-metadata-errors test inits outputs with a NULL compositor, and
makes a compositor that's entirely 0s except for the bits it's interested
in.

This makes a mess in a future where the primary_plane is split up per
output, as initializing the primary plane tries to add it to the
compositor's plane_list.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman 5f0eaeb083 drm: Don't stack sprite planes above primary on init
We don't need to do this, we can just leave them in the plane list until
they're used.

Also, doing so helps for when we want to move the primary_plane from
the compositor to the outputs in the future.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman 71cfca6a13 libweston: Remove view clip region
This is no longer used anywhere.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman 2d1198e4fb libweston: Add a paint node content dirty bit
This replaces the horribly broken surface damage code we have now.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman 820346a372 libweston: Track damage on paint nodes instead of planes
Remove plane->damage and instead accumulate damage on paint
nodes.

This is a step towards allowing multiple overlapping outputs.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman fe2b5db01e libweston: Track plane in paint node instead of view
Tracking the view's plane in the paint node in this way is a step towards
inflicting plane damage from paint node update during the output repaint,
instead of manually doing weston_view_damage_below().

We remove view->plane entirely and do all access through pnodes.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman ab6c6429df libweston: Post damage intentionally when remapping a subsurface view
We used to do this through a byzantine path involving the view's plane
transitioning from NULL to primary - but that doesn't work very well
when we want to track the plane in the paint node, because the paint
node will never have a NULL plane state.

This can be removed later when we track damage on paint nodes.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman 8d00cf7a96 libweston: Track visibility in paint nodes
Now that we have visibility for views, we can clip that to an output
and store it in paint nodes.

This requires us to split the paint_node_update() function into two,
one for things that need to be done before assign_planes() and
one for after.

This will eventually be useful for tracking damage with paint nodes,
as we'll need to damage a paint node's entire visible area for
some operations.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman 3791e370d4 libweston: Fix up the paint node status bitfield
Pretty cosmetic right now, but make the ALL_DIRTY only contain set
bits, and fix the accidentally sparse bitfield.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman 6ba7e57c1c libweston: Separate damage accumulation from visibility calculation
This is kind of confusing, as the visibility calculation is just a side
effect of the damage accumulation.

At the expense of walking the paint node list another time, make this
a separate function.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman 7b2ae2ba77 libweston: Add visible region to weston_view
Later, we'll want to use the visible region for damage tracking in
paint_nodes. For now, we can use it in the renderers where they've been
calculating it independently to draw paint nodes.

We still can't remove view->clip entirely, because
weston_view_damage_below() may be called before the first render of
a view, when its visible region hasn't been calculated yet. The
clip is empty at that point, which allows weston_view_damage_below()
to "work".

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman 61cbd8f3c5 libweston: Update paint nodes in weston_output_repaint
This is when they need to be up to date. And it makes it so that
view_ensure_paint_node() only does what the function name indicates.

Also, later when we tie damage tracking to paint nodes it will make
more sense to update them just in time for the output being repainted.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman f7ddaa142a libweston: Replace weston_output_damage() with a flag
In the future we'd like to have multiple overlapping outputs.

weston_output_damage() currently adds damage to the output's coordinates
on the primary plane. This plane is shared between all outputs, so it
would result in damaging more than the intended output.

Eventually, plane damage will go away and be replaced by paint node damage,
and damaging the entire output would involve adding damage to a list of
paint nodes.

Instead, use a flag to indicate the output must be fully redrawn, and add
the damage during the repaint loop.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman f07af89f9c libweston: Move output damage subtraction out of backends
Right now every backend clears output damage from the primary plane when
it repaints. Instead of having this same operation spread across all
the backends, just do it in the core instead.

In the future, we want to remove damage tracking from the primary plane
entirely, and this is a small step in that direction.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:43 -05:00
Derek Foreman a9986ef984 libweston,backends: assert if z_order_list contains pnodes for wrong output
We've just made this impossible, so we can now clean up all the TODO
locations.

I've only turned some of them into assert()s, because they're all mostly
in the same place.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-11 07:26:23 -05:00
Derek Foreman 85e3a4723b libweston: Cull paint nodes when their views aren't on their outputs
In the future when we track damage with paint nodes we have a problem when
a paint node is moved off of its output - it immediately stops being
present, so we don't generate damage for the move that placed it off
screen.

We don't want paint nodes to exist when their view isn't on their output
anyway, so let's cull these nodes at the point where we assign outputs to
views.

In the damage-from-paint-nodes future, this will let us properly post
damage when the paint node is destroyed.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-10 08:13:42 -05:00
Derek Foreman e5dfc3bc1e libweston: delete paint nodes on view unmap
Paint nodes should only exist when they're visible.

In the future where we want to track damage with paint nodes we need
this to be enforced, or damage won't properly be tracked when a
paint node is hidden from us but continues to exist.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-10 08:13:15 -05:00
Derek Foreman 7ab7f28e8c libweston: Only create paint nodes for the correct output
We want an output's z_order_list to only contain paint nodes for that
output, but until now we've been pretty careless about this.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-10 08:02:02 -05:00
Alexandros Frantzis b7b0042777 xwayland: Notify the shell when a window drops the fullscreen state
Notify the shell of the state transition when going from fullscreen to
normal toplevel window.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2023-07-06 21:19:18 +00:00
Alexandros Frantzis ca7b631310 xwayland: Allow shells to make xwayland surfaces fullscreen
The fullscreen state for xwayland surfaces can currently only be
effectively set from the client side. This commit enables
libweston-desktop based shells to properly set the fullscreen state
for xwayland surfaces.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2023-07-06 21:19:18 +00:00
Daniel Stone 23ea865508 surface: Remove weston_subsurface.unused_views
Now that we deterministically create views for subsurfaces, we don't
need to stash them away into unused_views to dynamically create and free
them at repaint time.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 57cd2483f9 surface: Don't create new views in view_list_add()
Now we create subsurface views both when linking to the parent
subsurface, and when creating new views for the parent surface, we no
longer need to magically materialise new views when building the view
list.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone aac90fe400 surface: Create subsurface views when linking surface to parent
When we're linking a subsurface to its parent for the first time,
materialise new views for every view the parent has.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 4b7fb56835 view: Destroy subsurface views with their parents
When we're destroying a parent view, also destroy any of its children
which are subsurface views that we've created automatically in the core.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone fc776c3b59 view: Add weston_view_add_transform and weston_view_remove_transform
They do what they say on the box, and inflict damage where required.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 7d2c5e0c33 view: Add weston_view_set_alpha()
Does what it says on the box: sets the view's alpha, also inflicting
damage where required.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone f39b1e9fbd view: Mark view list as dirty when destroying mapped view
If a view is in the view list when it's being destroyed, we need to
rebuild the view list. However, doing so is currently very hairy as
views are created and destroyed at will ... including when rebuilding
the view list.

In preparation for creating and destroying subsurface views at the time
of the action rather than later at repaint time, pull out the immediate
view-list rebuild and simply mark the view list as needing a full
rebuild.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 314f2ba0c3 view: Create subsurface views in weston_view_create()
When we create a new view for a top-level window, also create views for
all its children.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone bf228370ff view: Add view_list_needs_rebuild member
Most of the time when we're changing things about views, we don't need
to throw away the view list and rebuild it from scratch. The only times
when we need to do this are when views have been added to or removed
from the scene graph, or have been restacked within it.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone c699253da8 view: Add weston_view_geometry_dirty_internal()
weston_view_geometry_dirty_internal() can be used by internal callers to
mark a view's internal geometry as dirty, without signaling the need for
a full rebuild of the view list.

This is a transitional step towards eliminating
weston_view_geometry_dirty() from public API. Up until recently, the
view-manipulation API has been that users should manually manipulate
lists of transforms, layers, and other internal members, then call
weston_view_geometry_dirty() as well as manually provoking damage.

Now that we have helper functions to handle view manipulation, they
still need to mark the view geometry as being dirty. However, most of
them do not need to invoke a full rebuild of the view_list, which is
only required when views are added or removed from the scene graph, or
restacked.

weston_view_geometry_dirty() will assume that everything has changed
before eventually being ushered out of existence.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone c859dd1b9e surface: Only rebuild subsurface lists when necessary
There's no need to go through and rebuild the subsurface list every
time. In addition to being unnecessary work, it complicates things like
damage tracking.

Track a new surface dirty status indicating that the subsurface tree has
changed in some way, and only rebuild subsurface stacking when this has
occurred.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone ce6afda6a2 surface: Propagate surface status through commit call tree
When we're committing anything, return the collected status of what
we've just made live, including any changes resulting from subsurfaces
having changed.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone fc6d4392cb surface: Assert unused subsurface views are not mapped
This is just a consistency check, nothing else.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 49b5df7f78 view: Update child view transforms from parent
weston_view_geometry_dirty() marks the passed-in view as dirty, as well
as all of its children.

weston_view_update_transform() updates the geometry of its ancestors,
then itself.

Users are required (for now) to call weston_view_update_transform() in
order to not experience a disappointing amount of death-by-assert.

Users do not have a pointer to child views which are magically
materialised by the subsurface code.

The end result is disappointing. But it is less disappointing if
updating the transform for a view the user is actually aware exists,
also updates the transform for all its children.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 0ff72e5374 surface: Ensure view is unmapped before destroy signal
When the destroy signal is fired, child views will disassociate
themselves from the parent. This means that we can no longer see what
the child views are - and that recursive unmapping does not work.

Make sure that views are fully unmapped before anything else happens in
destroy, so we can recursively unmap child views.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone da8c8f96d2 surface: No need to unmap views before destroy
This happens as a part of weston_view_destroy().

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 17af1c4d20 surface: Unmap subsurface views, not surface, on parent destroy
Per the wl_subsurface spec:
      A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
      and the parent surface is mapped. The order of which one happens
      first is irrelevant. A sub-surface is hidden if the parent becomes
      hidden, or if a NULL wl_buffer is applied. These rules apply
      recursively through the tree of surfaces.
      [...]
      If the parent wl_surface object is destroyed, the sub-surface is
      unmapped.

The terminology is kind of loose. My reading of this is that we should
'unmap' (hide from display, remove from input/focus consideration, etc)
a subsurface immediately when a parent is destroyed.

However, if the child surface is then paired with another parent which
is itself mapped, then the child surface should immediately be mapped,
because it has a non-NULL buffer already applied, and the parent surface
is mapped.

By marking the surface as 'unmapped' on parent destroy, we were removing
it from the scene graph, but also I think breaking the rules on mapping
by requiring another commit when it was reassociated with another,
already mapped, surface.

Removing the explicit surface unmap leaves the surface in the 'mapped'
state, but without any views, which I believe has the intended effect.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 3d9aecc846 surface: Unmap subsurface views when parent is unmapped
Quoth the spec:
      A sub-surface becomes mapped, when a non-NULL wl_buffer is applied
      and the parent surface is mapped. The order of which one happens
      first is irrelevant. A sub-surface is hidden if the parent becomes
      hidden, or if a NULL wl_buffer is applied. These rules apply
      recursively through the tree of surfaces.

We currently apply this rule through reconstructing the view_list at
repaint time, materialising new views and garbage-collecting unwanted
views as appropriate. Since this can be a costly operation, it's best if
we move this closer to the source.

This makes the core recursively unmap any child views when the parent is
unmapped. Future commits will do the same for mapping new views.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 3af596a8bc surface: Use parent_view to find subsurface views
View transform parents can be set by anyone. parent_view, on the other
hand, is only set for subsurfaces.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 94a9cc1b24 Split weston_view_create() into public and internal
This is heading towards being able to materialise subsurface views
closer to the source. weston_view_create() - being used only by
window-management code - will ultimately create all required subsurface
views as well. The internal variant will be used by this and also by the
subsurface code as required.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 0f99e081c4 surface: Add input-region dirty flag
Used when the input region changes.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 3bba90764e surface: Add buffer-params dirty flag
This indicates that more than just the content changing, the form of the
buffer has changed in a way which may not be like-for-like to the
previous buffer but require significant reinterpretation. Examples
include the format, opacity, colour state, etc.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 63f67f8a04 surface: Flatten apply_buffer_damage()
This function is now only ever executed conditionally, so flatten it
with an early return.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone eb6d511823 surface: Require wl_surface.attach for damage processing
Both wl_surface.damage and wl_surface.damage_buffer explicitly refer to
the 'pending buffer'. wl_surface.attach states that there is no pending
buffer after the commit is processed, so it follows that a commit which
includes damage but no attach will not process any damage.

Change surface-commit processing to ignore all damage unless a buffer
was attached in the same commit cycle.

(Thanks to @pH5 for his spec analysis which I've just paraphrased here.)

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone d8669679c4 surface: Add position dirty member
This is used when a surface is repositioned via offsets.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 6526346b72 surface: Replace viewport.changed with weston_surface_status
Instead of having an individual bool, reuse the surface state's dirty
status for viewport changes.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 8255274a92 surface: Replace newly_attached with weston_surface_status
Instead of having a bool for whether or not a buffer has been attached
in this commit cycle, use a status bitmask.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Daniel Stone 160f91b8e1 surface: Only rebuild surface size where necessary
The only time we need to go through recalculating the surface size is
when either the buffer dimensions or the surface transforms have
changed. Now that we have dirty flags, use them to avoid a calculation
where required.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-04 15:52:21 +01:00
Derek Foreman 3ec2ebc7e2 libweston: Build view list for all outputs at once
Instead of passing an output to weston_compositor_build_view_list(),
have it set up all the output z_order_lists at once.

This is a preamble for MR !1285 which wants to maintain a compositor
wide dirty bit for the view list.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-04 15:52:21 +01:00
Derek Foreman 8a673efada libweston: Build z_order_list after view_list
Moves the output specific stuff into one place, after the view_list is
already properly set up.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-04 15:52:21 +01:00
marius vlad 3044d8ed72 backend-drm: Use resize_output to allow changing the fb
A video mode change would be needed to change the underlying renderer
framebuffer. All other backends make uses of this so let's do it for the
DRM-backend as well.

This would also be needed for the output capture to function properly as
we need call weston_output_update_capture_info() when a new mode set has
set. Otherwise we'd run into mismatched dimensions for the current mode
versus the dimensions set-up initially in weston_output_capture_source_info.

Signed-off-by: marius vlad <marius.vlad@collabora.com>
2023-07-04 11:41:29 +00:00
Philipp Zabel 1c262efd70 backend-wayland: Prepare for more renderers, reject no-op
Turn the Pixman/GL if/else conditionals into switch cases to make it
easier to add support for other renderers in the future.

Also makes sure that weston --backend=wayland --renderer=noop fails
with an error message instead of segfaulting.

Signed-off-by: Philipp Zabel <philipp.zabel@gmail.com>
2023-06-30 16:36:52 +00:00
Philipp Zabel d46b491c83 backend-x11: Prepare for more renderers, reject no-op
Turn the Pixman/GL if/else conditionals into switch cases to make it
easier to add support for others renderer in the future.

Also makes sure that weston --backend=x11 --renderer=noop fails
with an error message instead of starting with the GL renderer.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-06-30 11:02:28 +00:00
Leandro Ribeiro c61719e9e9 color-lcms: increase float precision to print segment breaks
There are some cases in which we are seeing segment breaks like this in
the debug scopes: (0.00, 0.00]. A segment whose domain goes from 0 to 0
makes no sense.

This happens because we are printing the breaks with only two decimal
places. Increase that to four, in order to have more accurate
information in the debug scopes.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2023-06-29 17:05:06 -03:00
Leandro Ribeiro 625a74d369 color-lcms: properly print 16-bit sampled curves
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>
2023-06-29 17:04:15 -03:00
Philipp Zabel 4a40ae7718 libweston: deduplicate compositor shutdown in backend_init failure path
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>
2023-06-29 19:16:01 +00:00
Leandro Ribeiro 25ffc4ae92 color-lcms: rename curve_set_print() to curveset_print()
Just to be consistent with the other functions in the code.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2023-06-29 11:08:40 +00:00
Leandro Ribeiro 9486740d21 tests: add color pipeline optimizer tests
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>
2023-06-29 11:08:40 +00:00
Leandro Ribeiro 884579bc3c color-lcms: merge power-law curve sets
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>
2023-06-29 11:08:40 +00:00