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>
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>
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>
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>