Commit graph

6332 commits

Author SHA1 Message Date
Simon Ser
b64e7e88bf output: add output_cursor_set_texture() 2023-05-06 17:48:56 +00:00
Simon Ser
b03f71fe5f render/vulkan: add support for NV12 2023-05-04 20:07:20 +00:00
Alexander Orzechowski
5adb1be3a7 drm_format_set_intersect: Require initialized dst and remove assert
The usages in linux_dmabuf zero out the dst before passing it so this
change should be fine.
2023-05-04 18:19:33 +00:00
Alexander Orzechowski
1ee75786b4 drm_format_set_union: Require initialized dst and remove assert 2023-05-04 18:19:33 +00:00
novenary
d7917d2076 xwayland: allow compositor to set withdrawn state 2023-05-04 18:05:00 +00:00
Simon Ser
2827ec6b7b xwayland: enable use of a xserver subproject
Makes it easier to work on Xwayland and wlroots features in
parallel.

References: https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/1048
2023-05-04 18:02:32 +00:00
Simon Ser
403eac51c4 render/vulkan: fix code style for function brackets 2023-05-04 13:31:29 +02:00
Alexander Orzechowski
ec796afb6e wlr_compositor: Decide opacity from new has_buffer flag.
`wlr_surface_get_texture` will always return NULL if the compositor was
not given a renderer.
2023-05-04 11:53:26 +02:00
Alexander Orzechowski
394accbe4a wlr_compositer: Keep track if surface has committed a buffer before.
This would break if you are running with a NULL renderer.
2023-05-04 11:53:26 +02:00
Alexander Orzechowski
2dd9549085 drm_format_set: Mark as unstable
This is supposed to be an unstable interface and it was a mistake that
this header was not included.
2023-05-03 19:08:14 +02:00
Alexander Orzechowski
cbe8876050 linux_dmabuf_v1: Use wlr_drm_format_set_union 2023-05-03 12:38:28 -04:00
Austin Shafer
ec37d55a5e Add union function for format sets 2023-05-03 12:06:48 -04:00
Simon Ser
bf8ae8a036 output/cursor: fix buffer size when nested and scaled
The Wayland, X11 and headless backends don't really care about the
cursor size. We were picking a size identical to the texture size
in that case. This is incorrect for LoDPI cursor textures on HiDPI
outputs: in that case, we need to scale up the cursor texture.

Fixes the cursor being chopped off under the Wayland backend with
scale > 1.
2023-05-03 11:32:51 +02:00
Simon Ser
a93fc8afd6 render: introduce blend mode
Allow callers to pick the blend mode when rendering a rect. The
"none" mode can be used to disable blending and clear rects.
2023-05-02 21:32:51 +02:00
Simon Ser
6b7d1d732a render/pixman: fix scaling in render_pass_add_texture()
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3642
Fixes: 6830bfc17f ("render/pixman: implement render pass API")
2023-05-02 15:49:17 +00:00
Alexander Orzechowski
d5320e5f20 tinywl: Release everything before destroy
This makes -Db_sanatize=address happy.
2023-05-02 10:48:31 -04:00
Simon Ser
f5a5712a02 render/vulkan: use VK_KHR_synchronization2
This simplifies the vkQueueSubmit call, removing the need to pass
timeline semaphore point values as separate arrays.
2023-04-28 15:36:39 +00:00
Simon Ser
6830bfc17f render/pixman: implement render pass API 2023-04-25 17:26:35 +02:00
Simon Ser
6ce371a317 render/pixman: add begin_pixman_data_ptr_access()
This logic is used twice.
2023-04-25 17:26:35 +02:00
Simon Ser
d7fcc1e96f scene: port to wlr_render_pass 2023-04-25 17:26:35 +02:00
Simon Ser
587852056c output: add wlr_output_add_software_cursors_to_render_pass()
Same as wlr_output_render_software_cursors(), but takes a
struct wlr_render_pass.
2023-04-25 17:26:34 +02:00
Simon Ser
471249ae4f render/pass: add legacy render pass implementation
Add a render pass implementation which leverages the legacy
rendering API. This is helpful during the migration.
2023-04-25 17:25:10 +02:00
Simon Ser
4a1ad32534 render: add render pass helpers 2023-04-25 17:25:10 +02:00
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
Edgars Cīrulis
17ad034480 xcursor: Resolve warning in xcursor_build_theme_dir
Signed-off-by: Edgars Cīrulis <edgarsscirulis@gmail.com>
2023-04-25 10:16:59 +00:00
ptrcnull
56502be1d1 backend/x11: prevent segfault on empty DRI3 response 2022-05-01 06:13:58 +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
d795824346 render/vulkan: fix signedness of strcmp() return value
strcmp() returns a signed integer.
2023-04-19 15:29:53 +02:00
Simon Ser
62e60ba889 render/vulkan: use initializer in vulkan_change_layout_queue() 2023-04-19 15:29:26 +02:00
Simon Ser
74e8fd8a9a render/vulkan: remove extra newline 2023-04-19 15:29:11 +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
Andri Yngvason
3898bb482d seat: Let client manage its own resources
This makes seat_client resources inert when seats and/or input devices are
destroyed, rather than destroying the resources.

When the client calls e.g. wl_keyboard_release(), it's not expecting the
keyboard global to be already destroyed, so this results in an error such
as this:

    wl_display@1: error 0: invalid object 22
2023-04-18 08:29:30 +00:00
Andri Yngvason
1689a3503b wlr_seat: Extract seat_client_create() function 2023-04-18 08:29:30 +00:00
Alexander Orzechowski
eac2eaa6a9 wlr_scene: Fix potential use-after-free in wlr_scene_buffer_set_buffer
Fixes: #3636
2023-04-16 14:01:54 +02:00
Alexander Orzechowski
39be67df46 wlr_scene: Send presentation event before direct scanout output commit
We were doing it too late before and surfaces were never getting
the presentation event.
2023-04-14 22:29:24 +02: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
Kirill Primak
87e7584dd4 compositor: use defunct_role_object error 2023-04-14 17:04:00 +02:00
Kirill Primak
fac7a5cc9d subcompositor: use bad_parent error 2023-04-14 17:00:17 +02:00
Kirill Primak
49435cb27b subcompositor: simplify get_subsurface handler 2023-04-14 16:59:55 +02:00
Manuel Stoeckl
40dde59475 render/gles2: use byte-aligned rows for glReadPixels
Setting the GLESv2 parameter GL_PACK_ALIGNMENT to 1 ensures that the
stride of the glReadPixels output matches the value computed in
`pack_stride`. Since the default value of GL_PACK_ALIGNMENT is 4, this
does not make a difference under normal use; but without this patch
the stride can be incorrect; for example, with RGB565 buffers and
screenshots of regions with odd width.
2023-04-12 14:04:25 +00:00
Simon Ser
9affcaa93c xcursor: adjust style, use calloc()
Adjust the code style for wlroots, and use calloc() for structs.
2023-04-11 20:05:27 +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
7abda952d0 output: drop direct scan-out check in output_basic_test()
wlr_output is not well-suited to checking whether direct scan-out
is happening or not. Compositors may want to use their own external
swapchains, for instance.

Additionally, ab7eabac84 ("output: leverage
wlr_output_configure_primary_swapchain()") makes it so
output_basic_test() is called before the output swapchain is
initialized, resulting in false positives.

References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3620
2023-04-06 21:46:45 +02:00
Simon Ser
ec5135cb09 scene: check wlr_output_is_direct_scanout_allowed() 2023-04-06 21:43:43 +02: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