Commit Graph

2526 Commits

Author SHA1 Message Date
Simon Ser 756dedae20 Add a new renderer API
Goals:

- Extensibility: we need to be able to add new params to the calls
  to render a texture/rect. For instance we'll need to add fences to
  the render texture operation for explicit sync purposes.
- No implicit state: no more bind_buffer, begin, end.
- No matrices: these hurt Pixman and we don't need them.
- Clip regions for optimized damage repainting.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3188
2023-04-25 17:25:10 +02:00
Simon Ser 44069dfd5e output-layer: add cropping support
Add a src_box state field. Use the SRC_* KMS props in the DRM
backend, reject the layers in the Wayland backend (for now, we can
support it later via viewporter).
2023-04-20 10:39:46 +02:00
Simon Ser 92b726ef67 render/vulkan: use full names for extension command fields
This makes grepping much easier.
2023-04-18 15:58:55 +00:00
Simon Ser 25d9055281 xcursor: sync with libwayland
xcursor.c was copied over from libwayland-cursor. A lot of
cosmetic imporvements have been merged upstream. Copy-paste the
new version.
2023-04-18 14:54:25 +00:00
Andri Yngvason 00489b11a0 seat: Provide dummy resources for inert seats 2023-04-18 08:29:30 +00:00
Simon Ser dae2deb3c9 compositor: add wlr_surface_set_preferred_buffer_transform()
References: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/220
2023-04-14 17:07:26 +02:00
Simon Ser 42edd36785 compositor: add wlr_surface_set_preferred_buffer_scale()
References: https://gitlab.freedesktop.org/wayland/wayland/-/merge_requests/220
2023-04-14 17:07:26 +02:00
Simon Ser 0bb574239d compositor: pass version in wlr_compositor_create
This allows wlroots to support newer versions of the interface
without breaking the API.
2023-04-14 17:07:26 +02:00
Alexander Orzechowski b1e38fc7ea output: Drop output_is_direct_scanout 2023-04-06 22:39:08 +02:00
Simon Ser 9ef98452a3 output-damage: drop
Compositors can migrate to wlr_damage_ring.
2023-04-06 20:34:30 +00:00
Simon Ser 079ff9e6fb output: add wlr_output_is_direct_scanout_allowed()
This lets compositors check whether direct scan-out is possible.
Compositors will soon be responsible for manually calling this
function.
2023-04-06 21:42:08 +02:00
Simon Ser 835208db98 output-layer: add support for scaling buffers
This allows callers to set a destination size different from the
buffer size to scale them.

The DRM backend supports this. The Wayland backend doesn't yet
(we'd need to wire up viewporter).
2023-04-04 19:39:38 +02:00
Simon Ser 89dcecba39 backend/wayland: only unmap layers when necessary 2023-03-28 22:58:29 +00:00
Simon Ser e00c4cd7dc output-layer: cache current state
The will be used by the Wayland backend to figure out whether
updating sub-surface position is necessary.
2023-03-28 22:58:29 +00:00
Rose Hudson 37f42e2df2 backend/wayland: support touch cancel events
since wayland doesn't provide a touch id in cancel events, track what
points are active so we can cancel all of them

timestamp is also not provided - use 0 because no one's paying attention
to that anyway

Closes #3000
2023-03-24 11:47:08 +00:00
zccrs 5602fb1373 backend/wayland: fix undefined reference to wlr_wl_input_device_get_seat
Amend b7e9ad79 to remove wlr_wl_input_device_get_seat definition.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3611
2023-03-20 09:49:54 +08:00
Kirill Primak a3489f2c64 xdg-shell: improve unmapping logic slightly 2023-03-12 11:09:36 +00:00
Simon Ser 1b6fac4aa6 output-layer: require all layers in wlr_output_state.layers
- Simplifies the backends
- Avoids having two ways to do the same thing: previously one could
  disable a layer by either omitting it from wlr_output_state.layers,
  or by passing a NULL buffer
- We can change our mind in the future: we can allow users to omit
  some layers and define a meaning without breaking the API.

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4017#note_1783997
2023-03-10 11:16:01 +00:00
Kirill Primak ad51983b23 xwm: make atom_map static 2023-03-09 18:51:47 +00:00
Simon Ser cab47d33e2 util/log: prefix WLR_REL_SRC_DIR with underscore
Just like _WLR_FILENAME and _WLR_ATTRIB_PRINTF, this makes it more
obvious that this isn't part of our API.
2023-03-01 00:52:18 +01:00
Simon Ser a160304289 backend/drm: use libdisplay-info for CVT mode generation 2023-02-28 14:44:02 +00:00
Simon Ser 35da997001 backend/drm: use libdisplay-info to parse EDID 2023-02-28 14:44:02 +00:00
Simon Ser 40117e1e0d render/vulkan: prefer render node for wlr_renderer_get_drm_fd()
Instead of returning a primary node from wlr_renderer_get_drm_fd(),
prefer to return a render node if any.
2023-02-28 14:25:21 +00:00
Simon Ser fef8ab22e3 output: introduce wlr_output_configure_primary_swapchain()
The goal is to simplify wlr_output by moving all of its rendering
API into separate helpers. Here is a first step to sunset
wlr_output_attach_render(). Instead, compositors call
wlr_output_configure_primary_swapchain(), wlr_swapchain_acquire(),
wlr_renderer_begin_with_buffer() and wlr_output_attach_buffer().

Note that compositors can supply a base struct wlr_output_state.
This is useful to allocate a buffer suitable for submission with
a modeset, for instance.

Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3079
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3197
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3984
2023-02-24 18:22:20 +00:00
Simon Ser b33ab26fe7 render/swapchain: make public
We've had this struct for a while. It'd be useful for compositors
if they want to manage the swap chains themselves instead of being
forced to use wlr_output's. Some compositors might also want to use
a swapchain without an output.
2023-02-21 17:14:31 +01:00
Simon Ser 3874577d3c output-layer: document interactions with screen capture
When e.g. screencopy-v1 is active, callers are responsible for
disabling output layers.
2023-02-21 10:35:30 +00:00
Simon Ser 8338d17d7e backend/drm: drop wlr_drm_layer.pending_{width,height}
No need to store this info in struct wlr_drm_layer. We can just
extract the size when we need it.
2023-02-21 09:45:47 +00:00
Simon Ser 7215bd1e0f output: expose wlr_output_state_set_buffer() 2023-02-21 09:43:43 +00:00
Simon Ser 4629d0ef40 output: expose wlr_output_state_finish()
Same as the original function, but check for the bitfield before
calling pixman_region32_fini(), because that function expects an
initialized region.
2023-02-21 09:43:43 +00:00
Alexander Orzechowski 3ef9f91283 wlr_scene: Add dmabuf_feedback helper 2023-02-20 17:21:17 -05:00
Alexander Orzechowski 323f0b94db wlr_scene: Cleanup header includes
We don't need to pull wlr_compositor.
2023-02-20 16:53:59 -05:00
Simon Ser 849c362ffb linux-dmabuf-v1: add helper for output layer feedback events 2023-02-20 18:38:57 +01:00
Simon Ser 22d9df2af4 backend/drm: send output layer feedback events 2023-02-20 18:38:57 +01:00
Simon Ser e1335a792a output-layer: add feedback event 2023-02-20 18:38:57 +01:00
Simon Ser 4d6fbb2289 backend/drm: add support for output layers 2023-02-20 18:38:57 +01:00
Simon Ser 2398621b8b backend/drm: add libliftoff composition layer
This will be useful for implementing the output layers API.
2023-02-20 18:38:57 +01:00
Simon Ser 9d43e7e4d6 backend/drm: add libliftoff interface 2023-02-20 18:38:57 +01:00
Simon Ser b4e9487312 backend/drm: init wlr_drm_plane for all plane types 2023-02-20 18:38:57 +01:00
Simon Ser cd17b18495 backend/wayland: implement output layers 2023-02-20 18:38:57 +01:00
Simon Ser 3e0ce761ad output: add wlr_output_set_layers() 2023-02-20 18:38:09 +01:00
Simon Ser 2f29b0c438 Add wlr_output_layer
This is based on previous work [1] [2].

This new API allows compositors to display buffers without needing to
perform rendering operations. This API can be implemented on Wayland
using subsurfaces and on DRM using KMS planes.

Compared to [1], this approach leverages wlr_addon_set to let backends
attach their own private state to layers, removes the pending
state (necessary for interop with wlr_output_commit_state()) and
enum wlr_output_layer_state_field.

[1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/1985
[2]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3447
2023-02-20 18:38:09 +01:00
John Lindgren 068280201a xwayland: Read and publish _NET_WM_STRUT_PARTIAL property
This is needed for compositors that want to reserve space for
XWayland panels.  Such a feature can be useful in a "transitional"
setup, where only the X11 window manager and compositor is replaced
but other components of an X11 desktop environment are still used.

This change simply reads the X11 property; the compositor is free
to ignore it.  Thus, compositors that don't want to support such a
"transitional" feature are not impacted.

v2: Update xwayland_surface_associate()
2023-02-13 12:57:20 -05:00
Kenny Levinsen 1225f81a6a scene: Add fractional scale handling 2023-02-08 16:31:39 +01:00
Kenny Levinsen efb8df8b22 wp-fractional-scale-v1: new protocol implementation
This implements the WIP wp-fractional-scale-v1 protocol.
2023-02-08 16:31:39 +01:00
Simon Ser 0c966f102c linux-dmabuf-v1: add wlr_linux_dmabuf_feedback_v1_init_with_options() 2023-02-06 19:14:15 +00:00
Simon Ser b264ec7767 linux-dmabuf-v1: add basic helpers for feedback 2023-02-06 19:14:15 +00:00
Simon Ser 5cd14dfc91 linux-dmabuf-v1: stop using const in feedback
Instead of using const pointers, use structs owned by the tranche.
This will allow wlroots to expose helpers to build feedback
objects.
2023-02-06 19:14:15 +00:00
Alexander Orzechowski 7b32c25a4f wlr_scene: Rename wlr_scene_surface_from_buffer
This renames it to wlr_scene_surface_try_from_buffer to be more clear
that this function can return NULL. This is inline with the rest of
wlroots[1].

[1] https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3991
2023-02-04 02:57:42 -05:00
Simon Ser cfa7696d7b backend/wayland: handle wl_registry.global_remove for wl_seat
Destroy the struct wlr_wl_seat when the global is removed.
2023-02-02 18:24:38 +00:00
Simon Ser 2b5eb0733e backend/wayland: make destroy_wl_seats() handle a single seat
Instead of destroying all seats, destroy a single one. We only need
to destroy all seats at one call-site (backend_destroy), but we'll
need to destroy a single seat elsewhere in the next commit.
2023-02-02 18:24:38 +00:00