aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
2021-12-02render/egl: improve modifier support detectionSimon Ser
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
2021-12-02render/pixman: advertise MOD_INVALID instead of MOD_LINEARSimon Ser
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'
2021-12-01render/egl: add wlr_egl_create_with_contextSimon Ser
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.
2021-12-01render/egl: store IMG_context_priority in wlr_eglSimon Ser
The next commit will split extension lookup and context initialization.
2021-12-01Fix uninitialized variable errors in release modeQuantum
When using `meson --buildtype=release`, `-Wextra -Werror` is passed. This includes `-Werror=maybe-uninitialized`, which complains about the instances fixed in this commit.
2021-11-30backend/wayland: improve wayland input device nameMoon Sungjoon
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3332 This makes input device names include it's type name
2021-11-30tinywl: use wlr_sceneIsaac Freund
2021-11-30scene: add wlr_scene_get_scene_outputSimon Ser
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.
2021-11-30types/wlr_drm_lease_v1: add NULL check to drm lease resource destroySimon Zeni
2021-11-30output: add wlr_output_get_primary_formatsSimon Ser
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
2021-11-30output: fix typo in wlr_output_impl.get_primary_formats docsSimon Ser
The buffer capabilities indicate whether the formats returned are for DMA-BUFs or shared memory buffers.
2021-11-30output: don't leave dangling cursor_front_bufferSimon Ser
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.
2021-11-30output: destroy swapchain when disabledSimon Ser
This avoids consuming GPU memory when an output is disabled.
2021-11-29linux-dmabuf-v1: fix implicit checkRouven Czerwinski
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>
2021-11-29backend/drm: poison buffers which cannot be scanned outSimon Ser
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
2021-11-29Insert new outputs at the end of the listJohn Lindgren
This prevents auto-configuring a new output from changing the position of existing outputs. (v2: simplify insert-at-end logic)
2021-11-28Added whitespace between "output" and "(not"Jonathan Wong
2021-11-27linux-dmabuf-v1: filter out LINEAR if implicitRouven Czerwinski
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
2021-11-26scene: add support for viewporterSimon Ser
If the surface has a source box set, use that. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3172
2021-11-26render: add DMA-BUF docsSimon Ser
Document some of the assumptions for DMA-BUF buffer sharing and modifiers.
2021-11-26backend/drm: always add LINEAR to supported modifiersSimon Ser
2021-11-26render/drm_format_set: remove special LINEAR caseSimon Ser
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.
2021-11-26render/egl: always add LINEAR to supported modifiersSimon Ser
2021-11-26backend/drm: fail on explicit modifier in drmModeAddFB2Simon Ser
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.
2021-11-26Require INVALID for implicit format modifiersSimon Ser
See [1] for the motivation. [1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/75
2021-11-26render/drm_format_set: add wlr_drm_format_hasSimon Ser
2021-11-25scene: add wlr_scene_xdg_surface_createSimon Ser
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.
2021-11-25backend: remove noop backendSimon Zeni
2021-11-25backend/headless: drop wlr_headless_backend_create_with_rendererSimon Ser
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.
2021-11-25render: introduce WLR_RENDER_DRM_DEVICESimon Ser
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
2021-11-25backend/headless: stop picking a DRM FDSimon Ser
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.
2021-11-25render/allocator: fallback to renderer DRM FD in autocreateSimon Ser
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.
2021-11-25render: pick DRM FD in autocreateSimon Ser
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.
2021-11-24docs/env_vars: drop WLR_DIRECT_TTYSimon Ser
The direct session is gone, so this env var isn't looked up anymore.
2021-11-23render/vulkan: Optimize vertex shaderJoshua Ashton
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>
2021-11-23render/vulkan: quiet glslangValidatorSimon Ser
This suppresses the output filename printed to stdout. Errors and warnings should still be printed to stderr as usual.
2021-11-23input-device: remove wlr_input_device.linkSimon Ser
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.
2021-11-22wlr_drag: emit destroy after wl_data_device.leaveIsaac Freund
2021-11-22backend/wayland: report parent presentation clockSimon Ser
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
2021-11-22linux-dmabuf-v1: hide wlr_linux_buffer_params_v1Simon Ser
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.
2021-11-19ci/archlinux: enable address and undefined sanitizersSimon Zeni
2021-11-19tinywl: build with meson if examples option is enabledSimon Zeni
2021-11-19backend/drm: scan leases on ueventSimon Ser
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3181
2021-11-19drm-lease-v1: listen to lease destroy eventSimon Ser
2021-11-19backend/drm: introduce wlr_drm_leaseSimon Ser
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3183
2021-11-19Introduce WLR_DEVICE_LEASE eventsSimon Ser
This will allow the DRM backend to reload its lessee list.
2021-11-19output: remove XRGB8888 cursor fallback formatManuel Stoeckl
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.
2021-11-19output: Add function to set preferred render formatManuel Stoeckl
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.
2021-11-19output: use XRGB8888 format instead of ARGB8888Manuel Stoeckl
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.
2021-11-19output: lift up output format fallback logicManuel Stoeckl
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.