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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
This doesn't just handle censoring protected content anymore, fix the name
and the comments.
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
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>
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>
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>
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>
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>
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>
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>
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>
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>
Recently I accidentally created a few files using spaces instead of
tabs. This patch fixes that.
Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
This makes the code slightly easier to read and prevents using
incorrect locations now that shader permutations can provide different
vertex streams.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
Index vertices from the damage mesh as lines and emit a single draw
call in fan debug mode. A new shader path and an additional vertex
stream are added in order to filter the color of the solid shader
variant per sub-mesh.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
A paint node with 'n' rects damaged by 'm' quads emits 'n*m' OpenGL
draw calls. This commit batches the 'n*m' clipped polygons into an
indexed triangle strip damage mesh using degenerate triangles. A
single draw call per paint node is emitted to reduce API overhead.
Fan debug mode is disabled for now and will be added back using
batching in the next commits.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
There is no need to expose it since it can be accessed by passing
non-axis aligned quads. Move existing tests to the quad clipper.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
The added complexity is unnecessary, it is limited to polygons of
length less than or equal to 8, there is currently no use for that
feature nor any plans to use it and tests are non-existent.
Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
The repaint loop is started when a client provides a new frame while the
compositor is idle. This frame should be shown as soon as possible. So it makes
no sense to commit the previous frame one more time before rendering the next
frame.
Just call weston_output_finish_frame() directly to start repainting immediately.
As a side effect, this fixes an issue when the output is resized when no
fullscreen shell is involved: At that point, parent.draw_initial_frame is
already false, so draw_initial_frame() is not called. But when resizing, the old
buffers are removed so the commit happens without a buffer attached to the
surface. So the surface is invisible for one frame until the next one is
rendered.
draw_initial_frame() is not removed here, because it is still needed for the
synchronous resize that happens with the fullscreen shell.
Signed-off-by: Michael Olbrich <m.olbrich@pengutronix.de>
Since DRM_CAP_ATOMIC_ASYNC_PAGE_FLIP capability is available in the
mainline kernel, now we should enable back tearing support.
v2:
- Bump kernel version to 6.9
- include the fallback definitions
Reviewed-by: Marius Vlad <marius.vlad@collabora.com>
Reviewed-by: Derek Foreman <derek.foreman@collabora.com>
Signed-off-by: Naveen Kumar <naveen1.kumar@intel.com>