aboutsummaryrefslogtreecommitdiff
path: root/backend
AgeCommit message (Collapse)Author
2021-11-19backend/multi: add asserts in wlr_multi_backend_addSimon Zeni
2021-11-18backend: remove wlr_backend_get_rendererSimon Zeni
2021-11-18backend/multi: remove backend_get_rendererSimon Zeni
2021-11-18backend/drm: stop initializing backend rendererSimon Zeni
2021-11-18backend/headless: don't store the parent rendererSimon Zeni
2021-11-18backend/x11: get renderer from wlr_x11_outputSimon Zeni
2021-11-18backend: remove backend_get_allocatorSimon Zeni
2021-11-18backend: remove backend ensure renderer and allocator checkSimon Zeni
2021-11-17Remove support for DMA-BUF flagsSimon Ser
They are never used in practice, which makes all of our flag handling effectively dead code. Also, APIs such as KMS don't provide a good way to deal with the flags. Let's just fail the DMA-BUF import when clients provide flags.
2021-11-15backend/headless: unlink input device on destroyRoman Gilg
Removing an input device requires unlinking it from the list of all headless input devices. For that implement a destroy function.
2021-11-02backend/drm: handle per-connector hotplug eventsSimon Ser
When a connector ID is specified in a hotplug event, don't scan all connectors. Only scan the connector that has changed.
2021-11-02backend/session: introduce wlr_device_change_eventSimon Ser
This struct contains additional information for session device change events, such as the DRM connector ID that has changed.
2021-10-31backend/wayland: use xdga client activationRonan Pigott
2021-10-29backend/drm: avoid creating empty FB_DAMAGE_CLIPS propSimon Ser
drmModeCreatePropertyBlob cannot create zero-sized blobs, that fails with EINVAL. Closes: https://github.com/swaywm/wlroots/issues/3297
2021-10-29backend/drm: get rid of BO handle tableSimon Ser
The BO handle table exists to avoid double-closing a BO handle, which aren't reference-counted by the kernel. But if we can guarantee that there is only ever a single ref for each BO handle, then we don't need the BO handle table anymore. This is possible if we create the handle right before the ADDFB2 IOCTL, and close the handle right after. The handles are very short-lived and we don't need to track their lifetime. Because of multi-planar FBs, we need to be a bit careful: some FB planes might share the same handle. But with a small check, it's easy to avoid double-closing the same handle (which wouldn't be a big deal anyways). There's one gotcha though: drmModeSetCursor2 takes a BO handle as input. Saving the handles until drmModeSetCursor2 time would require us to track BO handle lifetimes, so we wouldn't be able to get rid of the BO handle table. As a workaround, use drmModeGetFB to turn the FB ID back to a BO handle, call drmModeSetCursor2 and then immediately close the BO handle. The overhead should be minimal since these IOCTLs are pretty cheap. Closes: https://github.com/swaywm/wlroots/issues/3164
2021-10-27backend/drm/legacy.c: Fix memory leak in drm_legacy_crtc_set_gammaHaelwenn (lanodan) Monnier
Found via scan-build
2021-10-27backend.c: do not try to explicitly clean up the libinput backendMarkusVolk
Since libinput is an optional dependency the libinput backend is possibly undeclared. wlr_backend_destroy(backend) below will clean up the child libinput backend if any.
2021-10-27backend/x11: fix code style in get_touchpoint_from_x11_touch_idSimon Ser
2021-10-26backend/drm: add entry for Valve EDID vendorSimon Ser
As found in e.g. the Steam Deck.
2021-10-22backend/multi: implement get_buffer_capsSimon Zeni
2021-10-18Add error handling to backend creationAnthony Super
This commit adds two error-handling cases to the function attempt_dmr_backend. Specifically: - In the case where the number of found GPUs is zero, we now print a log message indicating this and return a NULL pointer - In the case where we could not successfully create a backend on any GPU, we now log a message indicating this and return a NULL pointer This allows us to provide more descriptive error messages, as well as avoid a SEGFAULT (the function `ensure_primary_backend_renderer_and_allocator` dereferences the pointer given, which could be NULL until this patch) when these cases arise.
2021-10-15output: add presented flag to presentation eventKirill Primak
2021-10-15output: disallow NULL event for wlr_output_send_present()Kirill Primak
2021-10-05backend: drop unconditional and unused <libinput.h>Jan Beich
After 70fb21c35ba4 made libinput optional the include prevents building without libinput package installed. backend/backend.c:4:10: fatal error: 'libinput.h' file not found #include <libinput.h> ^~~~~~~~~~~~
2021-10-02Fix spelling errorsElyes HAOUAS
Signed-off-by: Elyes HAOUAS <ehaouas@noos.fr>
2021-10-01Revert "Require INVALID for implicit format modifiers"Simon Ser
This reverts commit ea7357b70366588069c83f158e6a4eb2d3a702b3.
2021-10-01Revert "backend/drm: fail on explicit modifier in drmModeAddFB2"Simon Ser
This reverts commit d6be1d68b7d0542efa4dc2d19d57531484fe330a.
2021-10-01backend/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-10-01Require INVALID for implicit format modifiersSimon Ser
See [1] for the motivation. [1]: https://gitlab.freedesktop.org/wayland/wayland-protocols/-/merge_requests/75
2021-09-30backend: create renderer and allocator in wlr_backend_autocreateSimon Ser
Instead of ensuring the renderer and allocator are initialized in each backend, do it in wlr_backend_autocreate. This allows compositors to create backends without any renderer/allocator if they side-step wlr_backend_autocreate. Since the wlr_backend_get_renderer and backend_get_allocator end up calling wlr_renderer_autocreate and wlr_allocator_autocreate, it sounds like a good idea to centralize all of the opimionated bits in one place.
2021-09-27backend/wayland: send hold gesture eventsJosé Expósito
Receive hold gesture events using a Wayland listiner and emit the appropiate wlr_pointer signal.
2021-09-27backend/libinput: send hold gesture eventsJosé Expósito
Receive hold gesture events from libinput and emit the appropiate wlr_pointer signal.
2021-09-27build: check if libinput supports hold gesturesJosé Expósito
Add a project argument (LIBINPUT_HAS_HOLD_GESTURES) to allow building against old versions of libinput.
2021-09-21backend/drm: add support for panel orientationSimon Ser
Expose the panel orientation with wlr_drm_connector_get_panel_orientation. Leave it to the compositor to consume this information and configure the output accordingly. Closes: https://github.com/swaywm/wlroots/issues/1581
2021-09-08backend/drm: introduce wlr_drm_backend_get_non_master_fdSimon Zeni
2021-09-08backend/drm: implement drm lease functionSimon Zeni
2021-09-07backend/drm: drop wlr_drm_connector.desired_modeSimon Ser
Previously used by attempt_enable_needs_modeset, but this has been dropped in the previous commit.
2021-09-07backend/drm: drop attempt_enable_needs_modesetSimon Ser
Modesets require a buffer. The DRM backend tried to auto-enable outputs when a CRTC becomes available in the past, but now that fails because no buffer is available. Instead of having this magic inside the DRM backend, a better approach is to do it in the compositor or in an optional helper.
2021-09-07backend: wait for session to become activemuradm
2021-09-07backend/drm: drop drm_connector_init_rendererSimon Ser
drm_connector_set_pending_fb already takes care of this.
2021-09-07backend/drm: drop unused arg from get_possible_crtcsSimon Ser
Constify drmModeConnector while at it.
2021-09-07backend/drm: fix crash on VT switchSimon Ser
Don't set the MODE flag when disabling a CRTC. This fixes a NULL pointer dereference in drm_connector_state_init.
2021-09-07backend/drm: introduce wlr_drm_connector_stateSimon Ser
Previously, we were copying wlr_output_state on the stack and patching it up to be guaranteed to have a proper drmModeModeInfo stored in it (and not a custom mode). Also, we had a bunch of helpers deriving DRM-specific information from the generic wlr_output_state. Copying the wlr_output_state worked fine so far, but with output layers we'll be getting a wl_list in there. An empty wl_list stores two pointers to itself, copying it on the stack blindly results in infinite loops in wl_list_for_each. To fix this, rework our DRM backend to stop copying wlr_output_state, instead add a new struct wlr_drm_connector_state which holds both the wlr_output_state and additional DRM-specific information.
2021-09-07backend/drm: rename enum wlr_drm_connector_state to statusSimon Ser
"state" is easily confused with wlr_output_state.
2021-09-03backend/drm: handle drm_surface_blit errorsSimon Ser
drm_surface_blit returns NULL on error. This can happen e.g. when the source buffer cannot be imported into EGL. Closes: https://github.com/swaywm/wlroots/issues/3154
2021-08-25backend/drm: introduce wlr_drm_bo_handle_tableSimon Ser
Using GBM to import DRM dumb buffers tends to not work well. By using GBM we're calling some driver-specific functions in Mesa. These functions check whether Mesa can work with the buffer. Sometimes Mesa has requirements which differ from DRM dumb buffers and the GBM import will fail (e.g. on amdgpu). Instead, drop GBM and use drmPrimeFDToHandle directly. But there's a twist: BO handles are not ref'counted by the kernel and need to be ref'counted in user-space [1]. libdrm usually performs this bookkeeping and is used under-the-hood by Mesa. We can't re-use libdrm for this task without using driver-specific APIs. So let's just re-implement the ref'counting logic in wlroots. The wlroots implementation is inspired from amdgpu's in libdrm [2]. Closes: https://github.com/swaywm/wlroots/issues/2916 [1]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/110 [2]: https://gitlab.freedesktop.org/mesa/drm/-/blob/1a4c0ec9aea13211997f982715fe5ffcf19dd067/amdgpu/handle_table.c
2021-08-25Move allocator stuff into new directorySimon Ser
Add render/allocator/ and include/render/allocator/ to hold everything allocator-related.
2021-08-25backend/drm: generate CVT reduced modesSimon Ser
The Coordinated Video Timings (CVT) spec [1] defines two types of timings: the "CVT standard CRT" timings and the "CVT reduced blanking" timings (see section 3.6). The standard CRT timings include pauses in the video stream to allow CRT displays to reposition their electron beam at the end of each horizontal scan line [2]. While this was desirable a few decades ago, nowadays we can just generate a CVT reduced blanking timing by default. wlroots users can still set full custom DRM modes via wlr_drm_connector_add_mode. [1]: https://glenwing.github.io/docs/VESA-CVT-1.2.pdf [2]: https://en.wikipedia.org/wiki/Coordinated_Video_Timings#Reduced_blanking
2021-08-20backend/drm: try to allocate crtc for formatsRouven Czerwinski
To retrieve the formats, an allocated crtc is required. If there is no currently no crtc available, try to allocate it. This reproducable by having a disabled output and going through a suspend cycle with amdgpu. On start CRTCs look like this: 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1099] Reallocating CRTCs 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1110] State before reallocation: 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DP-1' crtc=0 state=1 desired_enabled=1 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DP-2' crtc=1 state=1 desired_enabled=1 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'HDMI-A-1' crtc=-1 state=0 desired_enabled=0 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'HDMI-A-2' crtc=-1 state=0 desired_enabled=0 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DVI-D-1' crtc=-1 state=0 desired_enabled=0 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1167] State after reallocation: 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DP-1' crtc=0 state=1 desired_enabled=1 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DP-2' crtc=1 state=1 desired_enabled=1 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'HDMI-A-1' crtc=-1 state=0 desired_enabled=0 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'HDMI-A-2' crtc=-1 state=0 desired_enabled=0 00:00:00.588 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DVI-D-1' crtc=-1 state=0 desired_enabled=0 where DP-1 is than disabled. After suspend/resume, allocation turns into: 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1099] Reallocating CRTCs 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1110] State before reallocation: 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DP-1' crtc=-1 state=1 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DP-2' crtc=1 state=3 desired_enabled=1 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'HDMI-A-1' crtc=-1 state=0 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'HDMI-A-2' crtc=-1 state=0 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1116] 'DVI-D-1' crtc=-1 state=0 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1167] State after reallocation: 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DP-1' crtc=-1 state=1 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DP-2' crtc=1 state=3 desired_enabled=1 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'HDMI-A-1' crtc=-1 state=0 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'HDMI-A-2' crtc=-1 state=0 desired_enabled=0 00:30:22.680 [DEBUG] [wlr] [backend/drm/drm.c:1174] 'DVI-D-1' crtc=-1 state=0 desired_enabled=0 where the crtc for DP-1 is now NULL. Trying to enable the output results in: 10:43:36.906 [DEBUG] [sway/config/output.c:351] Turning on output DP-1 10:43:36.906 [DEBUG] [sway/config/output.c:360] Set preferred mode 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [sway/config/output.c:366] Preferred mode rejected, falling back to another mode 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.906 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.906 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.906 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [DEBUG] [sway/config/output.c:400] Auto-detected output scale: 1.000000 10:43:36.907 [DEBUG] [sway/config/output.c:430] Committing output DP-1 10:43:36.907 [DEBUG] [wlr] [backend/drm/drm.c:464] connector DP-1: Can't enable an output without a buffer 10:43:36.907 [DEBUG] [wlr] [types/wlr_output.c:689] Attaching empty buffer to output for modeset 10:43:36.907 [ERROR] [wlr] [types/wlr_output.c:512] Failed to get primary display formats 10:43:36.907 [ERROR] [sway/config/output.c:435] Failed to commit output DP-1 where the primary format can't be queried since there is no crtc allocated for the connector. Allocating the connector inside drm_connector_get_primary_formats() fixes this issue. This is possible since the only user of get_primary_formats() is the swapchain allocation function, which is only called on output enable. Do the same thing for the cursor formats in case the user queries them before the output is enabled.
2021-08-19backend: unify startup messagesSimon Ser