Commit Graph

9672 Commits

Author SHA1 Message Date
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
Loïc Molinari 26a69cb2f2 gl-renderer: Rename fan debug mode to wireframe debug
There's no fans anymore, so wireframe makes more sense now.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2024-06-04 17:24:12 +00:00
Loïc Molinari 23ae2e7f32 gl-renderer: Batch paint node's draw calls in fan debug mode
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>
2024-06-04 17:24:12 +00:00
Loïc Molinari 22d9b9815f gl-renderer: Use compile-time annotation in vertex shader
Reuse fragment shader's compile-time annotation logic in vertex
shader for consistency.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2024-06-04 17:24:12 +00:00
Loïc Molinari f7a14ba0e7 gl-renderer: Batch paint node's draw calls
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>
2024-06-04 17:24:12 +00:00
Jeffy Chen 523a2b75f1 clients/desktop-shell: Reset panel clock timer everytime
In case of the system time changed in between.

Signed-off-by: Jeffy Chen <jeffy.chen@rock-chips.com>
2024-05-30 09:22:23 +00:00
Loïc Molinari ce1705435f gl-renderer: Do not expose clipper_clip() in header
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>
2024-05-30 09:09:45 +00:00
Loïc Molinari bef1f5fd7d gl-renderer: Remove support for non-quad polygons from clipper
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>
2024-05-30 09:09:45 +00:00
Michael Olbrich 5e43ef81ae backend-wayland: don't wait for one frame when starting the repaint loop
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>
2024-05-29 13:20:11 +00:00
Naveen Kumar ad039cdfd2 backend-drm: Enable atomic async flip support
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>
2024-05-28 09:33:51 +00:00
Alexandros Frantzis 8988c9436b clients/simple-egl: Allow translucent 16-bit surfaces
This allows users to get r5g5b5a1 configs which currently (in Mesa) interact
badly with EGL_EXT_present_opaque, and act as a good test case for the EGL
implementation.

Users can still get a 16-bit surface without alpha by using the "-o" flag.

Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2024-05-28 12:22:38 +03:00
Alexandros Frantzis e59eca5187 clients/simple-egl: Add option to use EGL_EXT_present_opaque
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2024-05-28 12:22:38 +03:00
Alexandros Frantzis 479a0247c9 clients/simple-egl: Display RGBA information for selected EGL config
Signed-off-by: Alexandros Frantzis <alexandros.frantzis@collabora.com>
2024-05-28 12:22:38 +03:00
Marius Vlad f6294962fd clients/simple-damage: Remove zwp_fullscreen support
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-05-27 16:49:21 +00:00
Marius Vlad 5d78f418a1 clients/dmabuf-v4l: Remove zwp_fullscreen support
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-05-27 16:49:21 +00:00
Marius Vlad e2c6568dd6 clients/dmabuf-egl: Remove zwp_fullscreen support
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-05-27 16:49:21 +00:00
Marius Vlad 68214419e9 clients/simple-shm: Remove zwp_fullscreen support
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-05-27 16:49:21 +00:00
Marius Vlad 50a6411bb6 clients/fullscreen: Remove zwp_fullscreen client support
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2024-05-27 16:49:21 +00:00
Jonas Ådahl 6975cf4265 terminal: Avoid too large character grid when resized
When resizing the terminal, the row/columns would end up potentially too tall
and/or wide, meaning the widget would grow each time the window was configured
with a size.

Fix this by making sure the calculated rows and columns don't loose too much
precision, and if they do, shrink instead of grow, as that is expected by the
xdg_toplevel configure event.

Signed-off-by: Jonas Ådahl <jadahl@gmail.com>
2024-05-27 16:28:48 +00:00
Loïc Molinari d4fe0a42fd gl-renderer: Assume axis alignment using node's valid_transform
Assume axis alignment using node's valid_transform boolean instead of
relying on the transform flags of the weston_view struct. This is more
reliable since matrix flags could erroneously hang around after a
series of transforms. Additionally, nodes with standard output
transforms like translations, flips and rotations by 90° can now take
the fast axis aligned path.

Signed-off-by: Loïc Molinari <loic.molinari@collabora.com>
2024-05-27 16:21:21 +00:00