Age | Commit message (Collapse) | Author |
|
This is a client example, it shouldn't use a compositor library
like wlroots.
|
|
wayland-client isn't really used by wlroots core, so let's move the
dep to where it's needed in the Wayland backend.
|
|
|
|
Implement a basic version of linux-dmabuf-unstable-v1 version 4.
Only default hints are implemented.
The new wlr_linux_dmabuf_feedback_v1 data structure will allow
compositors to define their own custom hints in the future. This
data structure makes it easy to describe feedback metadata.
It's converted to a "compiled" form suitable for marshalling over
the Wayland socket via feedback_compile.
|
|
This allows compositors to initialize wl_shm without initializing
other globals like linux-dmabuf.
|
|
|
|
Before this commit, it would keep the node at the top or make it second-
topmost.
|
|
This lets backends immediately release committed buffers if they
want to.
|
|
|
|
|
|
This allows output commit listeners to access the newly committed
buffer. Currently wlr_output.front_buffer is used but it'll get
removed in the next commit.
|
|
This intersects two DRM format sets. This is useful for implementing
DMA-BUF feedback in compositors, see e.g. the Sway PR [1].
[1]: https://github.com/swaywm/sway/pull/6313
|
|
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3336
|
|
DRM formats with an empty modifier list are invalid. Instead of
emptying the list, reduce it to { INVALID }.
Add a check to make sure the renderer and backend support implicit
modifiers, so that we don't fallback on e.g. Vulkan.
Closes: https://github.com/swaywm/sway/issues/6692
|
|
Support for EXT_image_dma_buf_import_modifiers doesn't necessarily
indicate support for modifiers. For instance, Mesa will advertise
EXT_image_dma_buf_import_modifiers for all drivers. This is a trick
to allow EGL clients to enumerate supported formats (something
EXT_image_dma_buf_import is missing). For more information, see [1].
Add a new wlr_egl.has_modifiers flag which indicates whether
modifiers are supported. It's set to true if any
eglQueryDmaBufModifiersEXT query returned a non-empty list.
Use that flag to figure out whether the buffer modifier should be
passed to the EGL implementation on import.
[1]: https://github.com/KhronosGroup/EGL-Registry/issues/142
|
|
The backends and allocators use INVALID, but the renderer uses
LINEAR. Running a compositor with WLR_RENDERER=pixman results in:
00:00:00.744 [types/output/render.c:59] Failed to pick primary buffer format for output 'WL-1'
|
|
This allows creating a wlr_egl from an already-existing EGL display
and context. This is useful to allow compositors to choose the exact
EGL initialization parameters.
|
|
The next commit will split extension lookup and context
initialization.
|
|
When using `meson --buildtype=release`, `-Wextra -Werror` is passed.
This includes `-Werror=maybe-uninitialized`, which complains about
the instances fixed in this commit.
|
|
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3332
This makes input device names include it's type name
|
|
|
|
This allows getting a wlr_scene_output from a wlr_output. Since an
output can only be added once to a scene-graph there's no ambiguity.
This is useful for compositors using wlr_scene_attach_output_layout:
the output layout integration automatically creates a scene-graph
output for each wlr_output added to the layout.
|
|
|
|
This allows compositors to get primary formats without manually
calling wlr_output_impl.get_primary_formats.
For example, the Sway patch for linux-dmabuf feedback [1] needs
this.
[1]: https://github.com/swaywm/sway/pull/6313
|
|
The buffer capabilities indicate whether the formats returned are
for DMA-BUFs or shared memory buffers.
|
|
Sometimes we were calling wlr_output_impl.set_cursor with a NULL
buffer, but we weren't clearing wlr_output.cursor_front_buffer.
Avoid leaving a dangling buffer behind.
Introduce a helper function output_set_hardware_cursor which calls
wlr_output_impl.set_cursor and keeps cursor_front_buffer in sync.
|
|
This avoids consuming GPU memory when an output is disabled.
|
|
The implicit check to filter out LINEAR for dmabuf checked for INVALID
twice instead of checking for INVALID & LINEAR. Fix this.
Fixes: d37eb5c2eaed ("linux-dmabuf-v1: filter out LINEAR if implicit")
Reported-by: Dawid Czeluśniak <czelusniakdawid@gmail.com>
|
|
Rather than repeatedly trying to import DMA-BUFs which cannot be
scanned out, mark the failed ones with a special "poison" marker.
Inspired from [1].
[1]: https://gitlab.freedesktop.org/wayland/weston/-/merge_requests/731
|
|
This prevents auto-configuring a new output from changing the
position of existing outputs.
(v2: simplify insert-at-end logic)
|
|
|
|
If only INVALID and LINEAR are valid modifiers, we need to filter out
LINEAR since Xwayland won't be able to allocate a BO with the explicit
linear modifier on hardware that does not support explicit modifiers.
The addition of LINEAR is an internal implementation detail which
simplifies the wlroots architecture for now.
Evntually Xwayland should be fixed to filter out modifiers that are not
supported by the GBM implementation, see [1]. This could be done by
querying EGL for the supported modifiers.
[1]: https://gitlab.freedesktop.org/xorg/xserver/-/issues/1166
|
|
If the surface has a source box set, use that.
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3172
|
|
Document some of the assumptions for DMA-BUF buffer sharing and
modifiers.
|
|
|
|
This was used to make the intersection of INVALID and LINEAR result
in LINEAR. We can now just require LINEAR to be in both lists.
|
|
|
|
drmModeAddFB2 doesn't support explicit modifiers. Only accept INVALID
which indicates an implicit modifier and LINEAR which may indicate
that GBM_BO_USE_LINEAR has been used.
|
|
See [1] for the motivation.
[1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/75
|
|
|
|
This allows compositors to easily add an xdg_surface to the
scene-graph while retaining the ability to unconstraint popups
and decide their final position.
Compositors can handle new popups with the wlr_xdg_shell.new_surface
event, get the parent scene-graph node via wlr_xdg_popup.parent.data,
create a new scene-graph node via wlr_scene_xdg_surface_tree_create,
and unconstraint the popup if they want to.
|
|
|
|
The headless backend no longer needs a parent renderer: it no longer
needs to return it in wlr_backend_impl.get_renderer, nor does it
need to return its DRM FD in wlr_backend_impl.get_drm_fd. Drop this
function altogether since it now behaves exactly like
wlr_headless_backend_create.
|
|
This env var allows to override the DRM node used by the GLES2 and
Vulkan renderers. It's especially useful to select a DRM node when
running with the headless backend.
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/2656
|
|
Sometimes the headless backend is used standalone with the Pixman
renderer, sometimes it's used together with another backend which
has already picked a DRM FD. In both of these cases it doesn't make
sense to pick a DRM FD.
Broadly speaking the headless backend doesn't really care which DRM
device is used for the buffers it receives. So it doesn't really
make sense to tie it to a particular DRM device.
Let the backend users (e.g. wlr_renderer_autocreate) open an arbitrary
DRM FD as needed instead.
|
|
If the backend doesn't have a DRM FD, fallback to the renderer's.
This accomodates for the situation where the headless backend hasn't
picked a DRM FD in particular, but the renderer has picked one.
|
|
If the backend hasn't picked a DRM FD but supports DMA-BUF, pick
an arbitrary render node. This will allow removing the DRM device
selection logic from the headless backend.
|
|
The direct session is gone, so this env var isn't looked up
anymore.
|
|
This ends up being a horrible global load:
s_getpc_b64 s[4:5] // 000000000000: BE841C80
v_add_u32 v0, s2, v0 // 000000000004: 68000002
v_sub_co_u32 v1, vcc, 0, v0 // 000000000008: 34020080
v_max_i32 v1, v0, v1 // 00000000000C: 1A020300
v_and_b32 v1, 3, v1 // 000000000010: 26020283
v_cmp_lt_i32 s[0:1], v0, 0 // 000000000014: D0C10000 00010100
v_sub_co_u32 v0, vcc, 0, v1 // 00000000001C: 34000280
v_cndmask_b32 v0, v1, v0, s[0:1] // 000000000020: D1000000 00020101
v_lshlrev_b32 v1, 3, v0 // 000000000028: 24020083
v_mad_u32_u24 v0, v0, 8, 4 // 00000000002C: D1C30000 02111100
v_min_u32 v1, 32, v1 // 000000000034: 1C0202A0
v_min_u32 v0, 32, v0 // 000000000038: 1C0000A0
s_getpc_b64 s[0:1] // 00000000003C: BE801C00
s_add_u32 s0, s0, 0x0000003c // 000000000040: 8000FF00 0000003C
s_addc_u32 s1, s1, 0 // 000000000048: 82018001
global_load_dword v1, v[1:2], s[0:1] // 00000000004C: DC508000 01000001
global_load_dword v0, v[0:1], s[0:1] // 000000000054: DC508000 00000000
v_mov_b32 v2, 0 // 00000000005C: 7E040280
v_mov_b32 v3, 1.0 // 000000000060: 7E0602F2
s_waitcnt vmcnt(0) // 000000000064: BF8C0F70
exp pos0, v1, v0, v2, v3 done // 000000000068: C40008CF 03020001
exp param0, off, off, off, off // 000000000070: C4000200 00000000
s_endpgm // 000000000078: BF810000
v_cndmask_b32 v0, s0, v0, vcc // 00000000007C: 00000000
v_cndmask_b32 v0, s0, v0, vcc // 000000000080: 00000000
v_add_f16 v192, s0, v0 // 000000000084: 3F800000
v_cndmask_b32 v0, s0, v0, vcc // 000000000088: 00000000
v_add_f16 v192, s0, v0 // 00000000008C: 3F800000
v_add_f16 v192, s0, v0 // 000000000090: 3F800000
v_cndmask_b32 v0, s0, v0, vcc // 000000000094: 00000000
v_add_f16 v192, s0, v0 // 000000000098: 3F800000
v_cndmask_b32 v0, s0, v0, vcc // 00000000009C: 00000000
With some bit magic, we can get something much nicer:
v_add_u32 v0, s2, v0 // 000000000000: 68000002
v_add_u32 v1, 1, v0 // 000000000004: 68020081
v_and_b32 v1, 2, v1 // 000000000008: 26020282
v_cvt_f32_i32 v1, v1 // 00000000000C: 7E020B01
v_mul_f32 v1, 0.5, v1 // 000000000010: 0A0202F0
v_and_b32 v0, 2, v0 // 000000000014: 26000082
v_cvt_f32_i32 v0, v0 // 000000000018: 7E000B00
v_mul_f32 v0, 0.5, v0 // 00000000001C: 0A0000F0
v_mov_b32 v2, 0 // 000000000020: 7E040280
v_mov_b32 v3, 1.0 // 000000000024: 7E0602F2
exp pos0, v1, v0, v2, v3 done // 000000000028: C40008CF 03020001
exp param0, off, off, off, off // 000000000030: C4000200 00000000
s_endpgm // 000000000038: BF810000
The above output was based on just shoving it in ShaderPlayground -- I was not able to use pipeline feedback as I was unable to get RenderDoc working due to the EXT_physical_device_drm requirement.
I additionally considered using >> 1 instead of * 0.5, but AMD has dedicated modifiers to merge a * 0.5, * 2.0, etc in a single instruction. (Albeit, not taken advantage of in the code above, but might with ACO)
Signed-off-by: Joshua Ashton <joshua@froggi.es>
|
|
This suppresses the output filename printed to stdout. Errors and
warnings should still be printed to stderr as usual.
|