Age | Commit message (Collapse) | Author |
|
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.
|
|
This field's ownership is unclear: it's in wlr_input_device, but
it's not managed by the common code, it's up to each individual
backend to use it and clean it up.
Since this is a backend implementation detail, move it to the
backend-specific structs.
|
|
|
|
There's no guarantee that the parent Wayland compositor uses
CLOCK_MONOTONIC for reporting presentation timestamps, they could
be using e.g. CLOCK_MONOTONIC_RAW or another system-specific clock.
Forward the value via wlr_backend_impl.get_presentation_clock.
References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3254#note_1143061
|
|
The parameters are used when the client is in the process of
building a buffer. There's no reason why this internal
implementation detail should be exposed in our public header.
|
|
|
|
|
|
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3181
|
|
|
|
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3183
|
|
This will allow the DRM backend to reload its lessee list.
|
|
All graphics drivers supporting cursor planes support ARGB8888,
the default cursor format, so this fallback is almost certainly
unused.
Essentially all cursor themes use alpha transparency to make it
clearer where relative to the screen content the cursor hotspot is.
It is better to fall back to a slightly slower software cursor than
it is to fall back to the opaque square that is a hardware cursor
without an alpha channel.
|
|
This change introduces new double buffered state to the wlr_output,
corresponding to the buffer format to render to.
The format being rendered to does not control the bit depth of colors
being sent to the display; it does generally determine the format with
which screenshot data is provided. The DRM backend _may_ sent higher
bit depths if the render format depth is increased, but hardware and
other limitations may apply.
|
|
Most (and possibly all) compositors using wlroots only ever render
fully opaque content. To provide better performance, this change
switches the default format used by wlr_output buffers from
ARGB8888 to the opaque XRGB8888.
Compositors like mutter, kwin, and weston already default to
XRGB8888, so this change is unlikely to expose any new bugs in
underlying drivers and hardware.
This does not affect the hardware cursor's buffer format, which is
still ARGB8888 by default.
As part of this change, the X11 backend (which does not support
changing format at runtime) now picks a true color, 24 bit depth
visual (i.e. XRGB8888) instead of a 32 bit depth (ARGB8888) one.
|
|
This makes it possible for the two functions using output_pick_format
(output_pick_cursor_format and output_create_swapchain) to select
different buffer formats.
|
|
|
|
|
|
|
|
The backend and renderer don't directly interact together, so there's
no point in checking that their buffer caps intersect. What we want to
check is that:
- The backend and allocator buffer caps are compatible, because the
backend consumes buffers to display them.
- The renderer and allocator buffer caps are compatible, because the
renderer imports buffers to sample them or render to them.
For instance, when running with the DRM backend and the Pixman renderer,
the (backend & renderer) check will fail because backend = DMABUF and
renderer = DATA_PTR.
|
|
This option was added with commit
8e346922508aa3eaccd6e12f2917f6574f349843.
|
|
|
|
|
|
|
|
|
|
|
|
|