Commit Graph

9691 Commits

Author SHA1 Message Date
Leandro Ribeiro 141f466a03 color-lcms: move ICC profile data to nested struct
No behavior change. Move ICC profile data to nested struct to keep
the code more organized.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-17 11:50:41 -03:00
Leandro Ribeiro 0b9565e859 color-lcms: avoid destroying cprof without rofile
In cmlcms_get_color_profile_from_icc(), if we fail to create the
ro_anonymous_file we end up calling cmlcms_color_profile_destroy() with
a cprof whose cprof->prof_rofile is NULL.

For now that's alright, because cmlcms_color_profile_destroy() checks
if this field is NULL. But in the future we'll drop this check, so
the idea of this patch is to avoid an issue in the future.

Reorganize cmlcms_get_color_profile_from_icc() to avoid destroying a
cprof without a ro_anonymous_file.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-17 11:50:41 -03:00
Leandro Ribeiro 93d086f068 color: add get_color_profile_from_params() to color managers
Add function to color managers to create color profiles from parameters.
This will be used by the parametric color profile builder that we'll add
in the next commit.

WARNING: we still do not fully support creating color profiles from
parameters. This just creates a boilerplate color profile that we're
planning to extend later.

Co-authored-by: Pekka Paalanen <pekka.paalanen@collabora.com>
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-17 11:50:40 -03:00
Leandro Ribeiro 89a57c7b10 color: keep track of supported primaries and transfer functions
In the next commits we'll start support clients that want to create
image descriptions through params using the CM&HDR protocol extension.

In order to do that, we'll have to expose the primaries and transfer
functions that the color manager supports. So keep track of that.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-17 11:50:40 -03:00
Leandro Ribeiro 9707a3320d color: add WESTON_TF_POWER
Up to now we had support only for transfer functions with pre-defined
parameters in struct weston_color_tf_info. Add support for the first
parameterized transfer function (a function whose params are not
pre-defined).

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-17 11:49:09 -03:00
Leandro Ribeiro 1c54ad7fd6 color: make some color struct's and enum's public
In the next commits we are going to introduce a public API to libweston
to allow creating color profiles from parameters. This should be used
by both the frontend and by the color protocol implementation.

This API require some color struct's and enum's that are currently
defined in libweston core, so move them to a public header.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-17 11:15:26 -03:00
Marius Vlad 8288cead93 timeline: Fix order with sub-surface clients
This corrects the order in which the parent ID surface is higher
than that of the sub-surface.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-06-14 11:41:13 +00:00
Marius Vlad 538146380a gitlab-ci.yml: Always run container jobs to allow page deploy to work
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-06-11 18:34:52 +03:00
Leandro Ribeiro 5e84f9167c clients/image: log some information only if verbose mode is set
This patch adds a new CLI option to weston-image: verbose.

It uses that to decide if we should log some info when the image
contains an ICC file embedded.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-11 10:15:42 -03:00
Leandro Ribeiro 5933af7a1d clients/image: allow clients to choose rendering intent
Commit "clients/image: use embedded ICC profile to present image" added
the support to present images with embedded ICC profiles being taken
into account. But the rendering intent was hardcoded to perceptual.

In this patch we allow end users to choose other rendering intents
through command line options.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-11 10:15:42 -03:00
Leandro Ribeiro d76643ee47 clients/image: print program usage
Add function to print program usage. For now this is kind of useless,
but in the next commit we'll add more functionalities to clients/image
command line options.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-11 10:15:42 -03:00
Leandro Ribeiro 576680c780 clients/image: use embedded ICC profile to present image
For image files that have an embedded ICC profile, use the CM&HDR
protocol extension to present taking that into account.

We use the CM&HDR extension to create an image description based on the
ICC profile. Also through the CM&HDR extension we take this image
description and set it to be the surface image description of the
surface in which we present the image.

For now, the rendering intent is hardcoded to be perceptual. In the next
commits we'll allow end users to choose the rendering intent through
command line options.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-11 10:15:42 -03:00
Leandro Ribeiro dbdcae9801 clients: add widget_set_image_description_icc()
This function takes an ICC fd, creates an image description for that and
sets the widget surface image description to this one.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-11 10:15:40 -03:00
Leandro Ribeiro cf59ed0ebe shared: remove load_image()
We have a single user of load_image(), and that can be easily replaced
by the new and more flexible weston_image_load() function.

So replace and drop load_image() from the code.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-11 10:13:18 -03:00
Leandro Ribeiro e015081f5d shared: make load_cairo_surface() also load the embedded ICC profile
Instead of loading only the pixman image through load_image(), load both
the pixman image and the ICC profile with weston_image_load().

It also sets the struct weston_image as the cairo surface user data and
adds a function so that users can retrieve this.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-11 10:13:18 -03:00
Leandro Ribeiro 312efb2acb shared: allow to get ICC profile from JPEG using weston_image_load()
Follow up of "shared: allow to get ICC profile from PNG using
weston_image_load()". This adds the support to get ICC profiles from
JPEG files.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-11 10:13:18 -03:00
Leandro Ribeiro d3f393031f shared: allow to get ICC profile from PNG using weston_image_load()
This introduces the functionality to also load the embedded ICC profile
from an image. For now, this only supports PNG files, but in the next
commit we add the support for JPEG as well.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-11 10:13:18 -03:00
Leandro Ribeiro 1b0f8693c6 shared: add weston_image_load()
In the next commits we plan to add support to load ICC profiles that are
embedded in images. So we need something more flexible than
load_image().

This patch introduces a new function that, for now, does the same as
load_image(). For now we keep load_image() as well, but the plan is
to drop it later.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-11 10:13:18 -03:00
Marius Vlad bc55244223 gitlab-ci.yml: Avoid running CI for merge pipelines
This avoids running pipelines *after* the MR has been merged and
avoids triggering a new CI build and with it the tests.

These should already be done in the MR context so there's no need to
run them once more time.

Further more, with this change forks would need to manually trigger
builds. No change for the MR context, as these it would build automatically.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-06-11 10:29:14 +00:00
Daniel Martinez 2bce726992 clients: fix surface viewport memory leak
Signed-off-by: Daniel Martinez <danielmartinez@cock.li>
2024-06-11 09:33:31 +00:00
Derek Foreman 984d36aaca compositor: Move censor/direct checks into paint node update
By moving this here we can use the information to disable damage tracking
for placeholder surfaces, as well as render them entirely opaquely.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Derek Foreman 8c26480c09 gl-renderer: Use pnode is_opaque when drawing
We test if the surface is fully opaque during paint node updates, and
store that information. Now that we've refactored the blended calculations
a little bit, we can easily use this test to make paint_node->is_opaque
override the blend calculation entirely.

This is preparation for future patches that will override is_opaque
when performing content censoring or fallback rendering of solid colors
for weston_direct dmabufs.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Derek Foreman b80d4f4c8d gl-renderer: Use calculated opaque region instead raw opaque region
These should effectively be the same, thought the one we've calculated
may be clipped with the scissor. The end result of the math should be
identical.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Derek Foreman 3538466083 gl-renderer: Calculate opaque region before blended
Just moving things around for now.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Derek Foreman 38487ec7e5 compositor: Dirty paint nodes when output protection changes
We'll be doing censoring via the paint node update code shortly, so
let's make sure we notice when protection changes.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Derek Foreman 290301882f renderers: Pass a paint node to the attach callbacks
Since we only call this from the paint node update code now, we can pass
the paint node directly.

A bit of internal refactoring is required to support copy_content.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Derek Foreman c08a6ff8bd compositor/renderer: Only attach buffer to renderer in repaint
Instead of doing this in several places, just do it when we're updating
the paint nodes in the repaint loop, or when we're about to copy
content via weston_surface_copy_content().

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Derek Foreman da6622f1d6 compositor: Add PAINT_NODE_BUFFER_DIRTY
In the future we'll use this, but for now just add the tracking.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Derek Foreman e2763565b6 compositor: Pass a mask to weston_surface_dirty_paint_nodes
For now we're just continuing to make the view dirty, but there will be
more dirt in the future.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Derek Foreman 71079ffd1a renderers: Make flush_damage take a weston_paint_node
Currently we're passing in a surface, a buffer, and an output. All of
these things are available in the paint node.

Further, if we pass in the paint node directly, we don't have to walk
a list of paint nodes to figure out if the texture is used in the
upcoming repaint.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Derek Foreman 39d9e67b08 gl-renderer: Don't flush damage on surface create
We'll flush this during repaint eventually, so there's no need to do it
now.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Derek Foreman 14599d0607 gl-renderer: Rename surface_flush_damage to paint_node_flush_surface_damage
And in doing so, pass the paint node instead of a surface and a buffer.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Derek Foreman 101e270f9b gl-renderer: Use pnode->surface directly instead of pnode->view->surface
We don't need the view, so let's skip the extra indirection.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Derek Foreman 4a8e8f5e83 gl-renderer: Stop returning bools for things that can't fail
None of these can fail, so let's not return anything from them.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Derek Foreman 4be5e79f8d gl-renderer: Don't check zalloc return in gl_render_attach_shm
We don't always check allocation failures, so why bother here?

Removing this allows simplifying some code in a further patch.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Derek Foreman 41ff97a0d9 gl-renderer: Rename maybe_censor_override
This doesn't just handle censoring protected content anymore, fix the name
and the comments.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2024-06-11 09:23:27 +00:00
Lukasz Czechowski 05e5405651 vnc: Allow neatvnc in version 0.8.0
Neat VNC 0.8.0 does not introduce any changes that breaks API used
by VNC backend, so it is safe to extend compatibility.

Signed-off-by: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>
2024-06-07 12:57:54 +00:00
Marius Vlad e80ebde028 doc/sphinx/toc/kiosk-shell.rst: Add doc for Xwayland appidis
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-06-07 12:40:50 +00:00
Marius Vlad bdcbdb6520 kiosk-shell: Check both WM_NAME and WM_CLASS at the same time
This adds an additonal check for testing both WM_NAME and WM_CLASS being
set-up at the same time.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-06-07 12:40:50 +00:00
Marius Vlad 619578f62f kiosk-shell, xwayland: Add a new weston_xwayland_surface_api function
Such that shells can retrieve Xwayland's surface WM_CLASS/WM_NAME and use
it to place the corresponding Xwayland surface on the appropriate
output, similar to what xdg_shell::set_app_id does.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-06-07 12:40:50 +00:00
Marius Vlad f2486c8b96 compositor: Remove layer_entry_remove/layer_entry_insert
There are no longer users of these two function. With the
weston_view_move_to_layer() helper being capable of doing this it is time
to retire these entirely to avoid users using them.

Release notes should mention that migrating to the newer helper will be
required when bumping to Weston 14.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-06-07 11:59:25 +00:00
Marius Vlad d62e8052f0 weston-test-desktop-shell: Use the weston_view_move_to_layer helper
This looks that probably it was an oversight as
weston_view_move_to_layer() also handles the insertion.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-06-07 11:59:25 +00:00
Marius Vlad 904811100e libweston/desktop: Use the weston_view_move_to_layer helper
Rather than using layer_entry_insert, use the
weston_view_move_to_layer().

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-06-07 11:59:25 +00:00
Ray Smith e79600483f backend-drm: always create gem_handle_refcnt hash table
Devices created via drm_device_create have this hash table, but those
created via drm_backend_create don't.

Signed-off-by: Ray Smith <rsmith@brightsign.biz>
2024-06-07 11:27:27 +00:00
Ray Smith 80f096d9d2 backend-drm: don't leak gem_handle_refcnt in drm_destroy
Signed-off-by: Ray Smith <rsmith@brightsign.biz>
2024-06-07 11:27:27 +00:00
Ray Smith 433f648adb backend-headless: Don't try to finish frame if it was cancelled
When multiple outputs are present, a failure in one's repaint will
cause any repaints of all other outputs to be cancelled. If this
happens during the headless "frame" time, the assertion on
repaint_status in weston_output_finish_frame fails.

Do the same as the DRM backend does in its equivalent callback
drm_output_update_complete and don't finish the frame.

Signed-off-by: Ray Smith <rsmith@brightsign.biz>
2024-06-07 11:00:25 +00:00
Marius Vlad dedcfb40dd gitlab-ci.yml: Update CI_BUILD_REF_NAME
With GitLab 16.0 CI_BUILD_REF_NAME was replaced with CI_COMMIT_REF_NAME.
which might explain why we do not seem to install the documentation on
https://wayland.pages.freedesktop.org/weston/

This should makes that docs deplay stage run.

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-06-07 09:49:52 +00:00
Leandro Ribeiro 2ac5777316 clients: make main event loop more robust
This makes the toytoolkit event loop more robust. Now it uses the
canonical wl_display_prepare_read(), read() and cancel().

Also, it allows functions that run before the event loop to create
Wayland queues and dispatch events related to such queue. Before our
changes, this would cause issues, because of how the loop was written
and also because dispatch_queue() reads the display fd and queue them on
the appropriate event queues, it doesn't read only the events related to
the queue we are interested.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-05 10:25:27 +00:00
Leandro Ribeiro bcd76c372b libweston: fix indentation of a few files
Recently I accidentally created a few files using spaces instead of
tabs. This patch fixes that.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
2024-06-04 17:32:39 -03:00
Loïc Molinari 06436d8adc gl-renderer: Define attrib array locations in an enum
This makes the code slightly easier to read and prevents using
incorrect locations now that shader permutations can provide different
vertex streams.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2024-06-04 17:24:12 +00:00