Commit Graph

9293 Commits

Author SHA1 Message Date
Philipp Zabel 5c1adb1cab ivi-layout: Remove weston_view_schedule_repaint()
There is no need to manually schedule a repaint anymore, it will be
triggered by changes to opacity or transform.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-07-25 10:46:59 +03:00
Philipp Zabel 1ad9687571 ivi-layout: Use weston_view_move_to_layer()
Use the weston_view_move_to_layer() helper instead of calling
weston_layer_entry_insert() / weston_view_unmap() directly.

This requires us to stop just clearing out the layer view list and then
adding visible surfaces' views to it. Instead, we have to explicitly
move all views onto or off of the layers.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-07-25 10:46:59 +03:00
Philipp Zabel d0dc464f15 ivi-layout: Use weston_view_set_alpha()
Stop setting view->alpha directly. Use weston_view_set_alpha() to also
apply damage as required.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-07-25 10:46:59 +03:00
Philipp Zabel 2df127c180 ivi-layout: Use weston_view_add/remove_transform()
Stop manipulating the view->geometry.transformation_list directly and
replace weston_view_geometry_dirty() and weston_view_update_transform()
calls with weston_view_add/remove_transform().

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-07-25 10:46:59 +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 760d60f508 desktop-shell: Remove unnecessary repaint schedules
We don't need to explicitly schedule a repaint once we've reconfigured
some views.

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 c4d24c01b3 desktop-shell: store xwayland positions in weston_coord
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-19 07:48:33 -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 9056a11460 desktop-shell: Use weston_coord for configure_static_view
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-07-19 07:41:33 -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 5b1207a425 Revert "clients/window: Update min_allocation for smaller widths/heights"
This seems to break interactive resize, giving invalid/0/negative values
to pending allocations.

This reverts commit 9555118095.

Fixes: #780
Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
2023-07-19 14:40:03 +03: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
Daniel Stone 4a26a28682 frontend: Fix build error when Xwayland disabled
Add another wrapper so we can build with -Dxwayland=false.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Fixes: 388702c181 ("frontend: Explicitly destroy Xwayland from frontend code")
Closes: wayland/weston#779
2023-07-18 11:44:11 +01:00
Philipp Zabel f8611607ec doc: add workaround for doxygen 1.9.6 bug with cairo >= 1.17.6
Add a workaround to fix rendering the dot files with doxygen 1.9.6
and cairo 1.17.8 on Fedora 38.

This is fixed upstream in doxygen 1.9.7, for details see:

  https://github.com/doxygen/doxygen/issues/9319

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-07-17 14:12:20 +00:00
Philipp Zabel 40df321d7c libweston: Document struct weston_mode
The main point of this is to write down that the refresh field is in
units of mHz.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-07-17 15:25:46 +02: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
Philipp Zabel 1ffcc535ef hmi-controller: Do not call hmi_controller_destroy() from _create()
Move the destroy listener registration to the top, to avoid having
to call hmi_controller_destroy() for cleanup when it fails.

This would segfault trying to remove the destroy listener from a list
when its link was never initialized or inserted into any list.

The failure case can be hit by setting both modules=hmi-controller.so in
weston.ini and --modules=hmi-controller.so on the command line.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-07-14 11:44:46 +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
Simon Ser 8c4128df5d clients/simple-dmabuf-feedback: do not block until rendering completes
glFinish() blocks until all commands have finished. This is
unnecessary: we can use glFlush() and rely on implicit sync
instead.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-07-14 10:49:44 +00:00
Simon Ser 0349f15269 clients/simple-dmabuf-egl: do not block until rendering completes
glFinish() blocks until all commands have finished. This is
unnecessary: we can use glFlush() and rely on implicit sync
instead.

Signed-off-by: Simon Ser <contact@emersion.fr>
2023-07-14 10:49:44 +00:00
Philipp Zabel 3523de6b8f man: Document tls-cert and tls-key config options
Document the new tls-cert and tls-key config options in the weston-rdp
and weston-vnc man pages.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-07-14 10:45:25 +00:00
Philipp Zabel 19a715b348 frontend: Add tls-cert and tls-key config options
Add tls-cert and tls-key config options in the [rdp] and [vnc] sections
in weston.ini. This allows to statically configure the TLS key and
certificate files instead of requiring them to be supplied via command
line arguments.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-07-14 10:45:25 +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
Daniel Stone 43cc77d4e9 tests: Check that test-surface unmaps on NULL
Make sure that committing a NULL buffer to a test-surface results in a
paint node disappearing.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-11 15:27:28 +00:00
Daniel Stone caac97be6a tests: Don't remap surfaces with NULL buffer
On attaching a NULL wl_buffer, weston_surface_attach() will unmap the
surface. Don't immediately remap it within committed() if we don't have
a buffer.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-11 15:27:28 +00:00
Daniel Stone 5b14a094e7 tests: Use weston_view_move_to_layer()
Use the helper, don't mark stuff as mapped ourselves. Set the position
before the view, so when it's marked as mapped, it's already in
position.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-11 15:27:28 +00:00
Daniel Stone e61d15dd76 tests: Move surface mapping earlier in surface-shell
The surface needs to mapped before a view can be mapped. Fix this.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-07-11 15:27:28 +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 9c116e1f13 libweston.h: Move struct weston_plane earlier in the file
We're going to move primary planes from compositor to output, so we need
struct weston_plane to precede struct weston_output.

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