Commit Graph

8931 Commits

Author SHA1 Message Date
Daniel Stone
ead8bd5fdb surface: Only rebuild paint node regions when necessary
Rebuilding regions can be an expensive operation, and we're adding more
of them. This means we need to be clever about when we actually do them.

Only dirty the paint nodes when the transform or buffer size has
actually changed, not on every commit.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-21 08:02:59 +00:00
Daniel Stone
8532c28761 surface: Start tracking weston_surface_status
Akin to the paint_node_status we already have, start also tracking a
surface dirty status. This will allow us to minimise the updates we need
to make.

Currently this is only collected, with no functional change made.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-21 08:02:59 +00:00
Daniel Stone
4863ee5ef1 surface: Move presentation-feedback discard to commit
There's no reason for it to belong in attach, really.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-21 08:02:59 +00:00
Daniel Stone
f6d81e42d4 surface: Convert a couple of ints to bools
Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-21 08:02:59 +00:00
Michael Tretter
914be30bc0 backend-drm: change default for required-outputs to any
On a desktop system, the expected behavior during a Weston start is that if any
monitor can be enabled, Weston starts up and enables the monitor. Outputs that
could not be enabled, stay disabled. This helps the user in debugging the failed
outputs.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
2023-06-20 19:46:11 +00:00
Michael Tretter
20508c148e backend-drm: add config option require-outputs
If Weston fails to configure a DRM output for whatever reason, it will fail to
start. Depending on the use-case, this may or may not be the correct behavior.

Add the "require-outputs" option to allow configuring the error behavior on
missing outputs.

Add documentation of the possible options to the man page.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
2023-06-20 19:46:11 +00:00
Michael Tretter
98e398e78b backend-drm: print failing output in error message
Print the name of the failing output to help debugging.

Signed-off-by: Michael Tretter <m.tretter@pengutronix.de>
2023-06-20 19:46:11 +00:00
Philipp Zabel
72e2da24f9 backend-vnc: render bypass support
If there is an opaque full-screen view with a compatible SHM client
buffer left after peeling off the client-side cursor view, bypass the
renderer and let Neat VNC read from the client buffer directly.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-06-20 09:21:14 +02:00
Philipp Zabel
8f18958cc5 backend-vnc: use weston_region_global_to_output
Instead of directly converting damage from pixman_region32_t in
global coordinates to pixman_region16_t in local coordinates,
use weston_region_global_to_output() to convert to pixman_region32_t
in local coordinates and then convert again to pixman_region16_t
in the same coordinate system, using vnc_region32_to_region16().

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-06-19 21:36:17 +00:00
Daniel Stone
7c8685769d CI: Enable ASan memory-leak checking
Now that we clean up everything to do with wet_process, we can enable
memleak checking in CI.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
42f071e881 tests/drm: Fix leaks in drm-writeback-screenshot-test
We were leaking a couple of buffers (both input and output), and also a
couple of filenames.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
be55909779 backend-drm: Don't leak writeback-format property blob
We were freeing the writeback-format blob on error, but not on success.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
2896a0e9ab text-backend: Don't restart client on exit
When we're shutting down, don't try to restart the IM client.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
570bf1824a desktop-shell: Don't restart client on exit
When we're shutting down, don't try to restart the shell client.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
9aa68248a9 backend-drm: Use weston_compositor.shutting_down
We previously had our own local variable for this, but now we can just
use the one in weston_compositor.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
579019a78d libweston: Add weston_compositor.shutting_down
It does what it says on the box: is true when the compositor is in the
process of shutting down.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
52987b0354 frontend: Clean up wet_processes on exit
When we exit, clean up any process we launched.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
388702c181 frontend: Explicitly destroy Xwayland from frontend code
Currently Xwayland is cleaned up by a destroy listener. The problem with
this is that this is true for both libweston's Xwayland support as well
as the frontend's.

Add an explicit destroy step to Xwayland frontend which will cleanly
destroy the process as well as any other resources.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
10f6b99ac0 frontend: Return user-data pointer from Xwayland init
Return a void * from wet_load_xwayland, so we can later pass it back to
explicitly call the cleanup.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
eff5e7e0f3 xwayland: Add client destroy listener
Make sure that we consistently mark the client as NULL when it's
destroyed, and destroy it on process exit as well, so we have a
consistent state.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
506901d918 xwayland: Rename destroy_listener to be more explicit
compositor_destroy_listener tells us exactly what it is.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
104676ec1f xwayland: Remove process exit status from libweston API
This shouldn't be relevant to the core.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
f360818960 tests/xwayland: Ensure $DISPLAY is correctly set
We rely on the Xwayland launcher setting $DISPLAY to connect to our own
X server. Make very sure in the tests that we're actually getting that
set properly.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
e64232a808 xwayland: Only pass Xwayland wl_client to libweston
Remove all handling of process/PID internals from libweston's Xwayland
launcher, and keep this only in the frontend. libweston now only sees
the wl_client and nothing else.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
d5bcc26078 frontend: Factor out wet_process_destroy
Reuse the body of the process cleanup as a separate function.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
991b3fb2e0 frontend: Inline process_handle_sigchld
Now that we have wet_process everywhere, print out the process exit
status in the main handler.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
9a7c88c2e9 frontend: Make wet_client_launch allocate new wet_process
Every time we call wet_client_launch, we now allocate a new wet_process,
which is always cleaned up by the compositor core and not by the users.
In doing this, weston_client_launch is renamed to wet_client_launch,
since wet_ is for the frontend and weston_ is for libweston.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
31dcd987a6 frontend: Allocate new wet_process for Xwayland
Instead of reusing an inline wet_process struct, allocate a new
wet_process every time we go to launch Xwayland.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
a72d0c1bb0 frontend: Allow NULL wet_process cleanup handler
Don't call cleanup if we haven't been given anything to call.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
c2cd15ed11 frontend: Add data argument to wet_process cleanup
wet_process provides a cleanup function which can be called, but only
passes the process itself. This relies on the process struct being
inlined in something else meaningful, and means that we can't allocate
them on demand.

Add a 'data' argument which allows users to pass meaningful data to
their cleanup handler.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
abe893d8ea frontend: Rename weston_client_start to wet_client_start
It's not libweston, so it shouldn't be weston_.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
348465cd7a frontend: Inline wet_watch_process
Now we only have one place we launch processes, we can just inline this
wl_list_insert.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
4326d3c768 frontend: Rename weston_process to wet_process
It's not a libweston thing, it's a part of the frontend.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
d8114aa888 frontend: Remove process_info
This is just an empty shell around weston_process.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
ca55f0549b frontend: Move path into weston_process
We have this everywhere, so we can move it out of process_info.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:47 +01:00
Daniel Stone
2a9f7aabdb CI: Require wayland 1.22 for wl_client_add_destroy_late_listener
We need this in coming patches.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 21:32:46 +01:00
Daniel Stone
e35977f3a0 CI: Add Debian bookworm jobs
Bookworm has just been released. Add jobs which start using it, but keep
bullseye around as the LTS release, to make sure we can build on new and
old distributions.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 20:09:03 +00:00
Daniel Stone
0e4aa29e4b CI: Upgrade Mesa and kernel
Debian bookworm needs a newer version of Mesa to build against LLVM 15.
Upgrade Mesa and the kernel whilst we're at it, just to make sure that
things keep working.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 20:09:03 +00:00
Daniel Stone
64ae26702d CI: Bump virtme snapshot version
Apparently qemu upstream has deprecated -watchdog and just uses the more
generic -device now.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 20:09:03 +00:00
Daniel Stone
c2d5199937 CI: Force pip to install packages
Newer versions of Debian make you pass --break-system-packages to pip in
order for it to install packages. Since we do want to keep using pip for
controlled versions rather than the distribution packages, add this
flag.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 20:09:03 +00:00
Daniel Stone
c7f09dbbac CI: Rename debian jobs to debian-lts
Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 20:09:03 +00:00
Daniel Stone
ef55d79727 CI: Parameterise LLVM version
Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 20:09:03 +00:00
Daniel Stone
5ccb33ac02 CI: Upgrade ci-templates version
This is required to support Debian bookworm.

Signed-off-by: Daniel Stone <daniels@collabora.com>
2023-06-19 20:09:03 +00:00
Derek Foreman
db51409b9a desktop-shell: Pass a weston_coord to calc_input_panel_position
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-06-19 13:09:03 +00:00
Derek Foreman
aea5ca97ae kiosk-shell: Use weston_coord for grabs
Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-06-19 13:09:03 +00:00
Derek Foreman
643c9b929f desktop-shell: use weston_coord in weston_move_*_grab
Replace some wl_fixed_t pairs with weston_coord.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-06-19 13:09:03 +00:00
Derek Foreman
2ac566d281 libweston: Add more weston_coord arithmetic helpers
Until now we've only had the unadorned arithmetic functions, but they're
easy to abuse and tedious to use.

For now, we just add weston_coord_global_add/sub functions and use them
where appropriate.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-06-19 13:09:03 +00:00
Derek Foreman
d961e59d4a libweston: Add getters for view position/offset
This is stored as an unadorned weston_coord internally, but with getter
functions we can put together the appropriate global or surface
coordinate.

Use them where appropriate.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-06-19 13:09:03 +00:00
Derek Foreman
1f81c082b5 libweston: Add weston_coord_truncate()
Truncating a weston coord to integer values is something we do
frequently enough to warrant a helper function.

Use this in the kiosk and desktop shells where appropriate.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
2023-06-19 13:09:03 +00:00
Philipp Zabel
ca1f6936c4 backend-rdp: GL renderer support
Let the GL renderer render to FBOs for RDP outputs and read the pixels
into the RDP frame buffer. This allows to run the RDP backend with the
GL renderer.

Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
2023-06-15 15:48:26 +00:00