aboutsummaryrefslogtreecommitdiff
path: root/backend
AgeCommit message (Collapse)Author
2023-05-17drm_plane_pick_render_format: return false if no format could be foundAustin Shafer
Commit 90d08f8f1c40e2a302d62052435ff2abdb08a854 changed the way wlr_drm_format_intersect worked, including passing in a destination format list. This breaks scenarios where the intersection doesn't find any matching formats, since we still have a valid destination format set. This changes it to only return true if more than one matching format is present in the intersection list.
2023-05-15backend_destroy: Similiar logic like DRM backendTobias Predel
In the logic of the DRM backend in backend_destroy, wlr_backend_finish is called first, then the outputs are destroyed and then the display->destroy.link is removed from the list. This commit applies the same order to the headless backend.
2023-05-11wlr_drm_format_set: Store formats on arrayAlexander Orzechowski
2023-05-11wlr_drm_format: Rework wlr_drm_format_intersectAlexander Orzechowski
Now it takes a reference to a destination format
2023-05-11wlr_drm_format: Introduce drm_format_finishAlexander Orzechowski
2023-05-08backend/drm: fix di_info memory leakzhoulei
2022-05-01backend/x11: prevent segfault on empty DRI3 responseptrcnull
2023-04-20output-layer: add cropping supportSimon Ser
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-04output-layer: add support for scaling buffersSimon Ser
This allows callers to set a destination size different from the buffer size to scale them. The DRM backend supports this. The Wayland backend doesn't yet (we'd need to wire up viewporter).
2023-03-28backend/wayland: only unmap layers when necessarySimon Ser
2023-03-28backend/wayland: only update layer position when necessarySimon Ser
2023-03-28backend/wayland: only re-order sub-surfaces when necessarySimon Ser
2023-03-24backend/wayland: support touch cancel eventsRose Hudson
since wayland doesn't provide a touch id in cancel events, track what points are active so we can cancel all of them timestamp is also not provided - use 0 because no one's paying attention to that anyway Closes #3000
2023-03-20backend/drm: log drm_connector_alloc_crtc() failuresSimon Ser
Helps figuring out why e.g. get_primary_formats fails.
2023-03-10output-layer: require all layers in wlr_output_state.layersSimon Ser
- Simplifies the backends - Avoids having two ways to do the same thing: previously one could disable a layer by either omitting it from wlr_output_state.layers, or by passing a NULL buffer - We can change our mind in the future: we can allow users to omit some layers and define a meaning without breaking the API. References: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4017#note_1783997
2023-03-01backend/wayland: fix leak of some globalsSimon Ser
Fix a few globals which weren't properly cleaned up. Discovered in [1]. [1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3604
2023-02-28backend/wayland: destroy zwp_linux_buffer_params_v1 objectsSimon Ser
Don't leak these.
2023-02-28backend/drm: use libdisplay-info for CVT mode generationSimon Ser
2023-02-28backend/drm: use libdisplay-info to parse EDIDSimon Ser
2023-02-27backend: move #ifdefs to nested functionsSimon Ser
Instead of littering #ifdefs everywhere, move them to the dedicated attempt_XXX_backend() functions. This makes the logic in wlr_backend_autocreate() more readable, and provides better error messages when the X11/Wayland backends are disabled at compile-time, or when WLR_BACKENDS contains a backend disabled at compile-time.
2023-02-27backend: make wlr_backend_autocreate() fail when DRM is missingSimon Ser
When we change the required dependencies for the DRM backend, Meson might auto-disable the backend for users missing the new requirements. This results in confused users [1] because they don't notice the "drm-backend: NO" line burried in the Meson logs, and then get a black screen when starting the compositor. Update wlr_backend_autocreate() to refuse to create a backend with only libinput (without DRM). Users really wanting to start their compositor with a libinput backend and without a DRM backend can manually set WLR_BACKENDS. [1]: https://github.com/swaywm/sway/issues/7457
2023-02-21render/swapchain: make publicSimon Ser
We've had this struct for a while. It'd be useful for compositors if they want to manage the swap chains themselves instead of being forced to use wlr_output's. Some compositors might also want to use a swapchain without an output.
2023-02-21backend: disable DRM backend monitor when WLR_DRM_DEVICES is usedSimon Ser
WLR_DRM_DEVICES specifies a static list of DRM devices to open at startup. Do not create DRM backends for hotplugged DRM devices when it's set. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3595
2023-02-21backend: avoid adding NULL backend in attempt_backend_by_name()Simon Ser
2023-02-21backend: create DRM backend monitor when WLR_BACKENDS is usedSimon Ser
2023-02-21backend/headless: unconditionally accept all output layersSimon Ser
We don't need to do anything special to handle these.
2023-02-21backend/drm: drop wlr_drm_layer.pending_{width,height}Simon Ser
No need to store this info in struct wlr_drm_layer. We can just extract the size when we need it.
2023-02-21backend/drm: drop unnecessary pixman_region32_t castsSimon Ser
The Pixman API now accepts const parameters.
2023-02-20backend/drm: send output layer feedback eventsSimon Ser
2023-02-20backend/drm: add support for output layersSimon Ser
2023-02-20backend/drm: add libliftoff composition layerSimon Ser
This will be useful for implementing the output layers API.
2023-02-20backend/drm: add libliftoff interfaceSimon Ser
2023-02-20backend/drm: init wlr_drm_plane for all plane typesSimon Ser
2023-02-20backend/wayland: implement output layersSimon Ser
2023-02-02backend/wayland: handle wl_registry.global_remove for wl_seatSimon Ser
Destroy the struct wlr_wl_seat when the global is removed.
2023-02-02backend/wayland: make destroy_wl_seats() handle a single seatSimon Ser
Instead of destroying all seats, destroy a single one. We only need to destroy all seats at one call-site (backend_destroy), but we'll need to destroy a single seat elsewhere in the next commit.
2023-02-02backend/drm: require hwdata pkg-config fileSimon Ser
The hardcoded fallback "/usr/share/hwdata/pnp.ids" was only a temporary solution to get things working while distributions were still working on shipping it.
2023-02-02backend/wayland: update output mode after commit is doneSimon Ser
Do not update the output mode if the commit failed in one of the error codepaths.
2023-02-02backend/wayland: allow superseding a previous commitSimon Ser
During a modeset, the core wlr_output logic will allocate a buffer with a new size and commit it. However if we still have a frame callback pending we'd refuse to perform the commit. This is inconsistent with the DRM backend, which performs a blocking modeset. This is visible when resizing the Wayland toplevel. The logs are filled with "Skipping buffer swap", and the wlr_damage_ring's bounds are not properly updated. Fix this by destroying the pending frame wl_callback.
2023-02-02backend/wayland: don't cache next item when destroying buffersSimon Ser
Because wl_buffer.release is per-buffer and not per-commit, the Wayland backend might create multiple struct wlr_wl_buffer per struct wlr_buffer. As a result, the wlr_buffer_unlock() call inside destroy_wl_buffer() can cause another struct wlr_wl_buffer to be destroyed. In backend_destroy() we were iterating the list of buffers with wl_list_for_each_safe(), which is actually not safe in this case: the next buffer is cached, but might be destroyed as a side-effect of calling destroy_wl_buffer(). Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3572
2023-01-31backend/drm: set "max bpc" property based on pixel formatSimon Ser
Since 1d581656c756 ("backend/drm: set "max bpc" to the max") we set the "max bpc" property to the maximum value. The kernel driver is supposed to clamp this value depending on hardware capabilities. All kernel drivers lower the value depending on the GPU capabilities. However, none of the drivers lower the value depending on the DP-MST link capabilities. Thus, enabling a 4k@60Hz mode can fail on some DP-MST setups due to the "max bpc" property. Additionally, it's not a good idea to unconditionally set "max bpc" to the max. A high bpc consumes more lanes and more clock speed, which means higher power consumption and the busy lanes cannot be used for something else (e.g. other data transfers on a USB-C cable). For now, let's tie the "max bpc" to the pixel format of the buffer. Introduce a heuristic to make "high bit-depth buffer" a synonym of "I want the best quality". This is not perfect: a "max bpc" higher than 8 might be desirable for pixel formats with a color depth of 8 bits, for instance when the color management KMS properties are used. But we don't really support that yet, so let's leave this for later. Closes: https://github.com/swaywm/sway/issues/7367
2023-01-18backend/drm: disable all CRTCs after VT switchSimon Ser
When the user switches away from the VT where wlroots is running, the new DRM master may mutate the KMS state in an arbitrary manner. For instance, let's say wlroots uses the following connector/CRTC mapping: - CRTC 42 drives connector DP-1 - CRTC 43 drives connector DP-2 Then the new DRM master may swap the mapping like so: - CRTC 42 drives connector DP-2 - CRTC 43 drives connector DP-1 wlroots needs to restore its own state when the user switches back. Some state is attached to wlr_drm_crtc (e.g. current FB), so reading back and adopting the CRTC/connector mapping left by the previous DRM master would be complicated (this was the source of other bugs in the past, see [1]). With the previous logic, wlroots merely tries to restore the state of each connector one after the other. This fails in the scenario described above: the kernel refuses to use CRTC 42 for DP-1, because that CRTC is already in-use for DP-2. Unfortunately with the legacy uAPI it's not possible to restore the state in one go. We need to support both legacy and atomic uAPIs, so let's fix the bug for the legacy uAPI first, and then improve the situation for the atomic uAPI as a second step [2]. We need to disable the CRTCs we're going to switch the connectors for. This sounds complicated, so let's just disable all CRTCs to simplify. This causes a black screen because of the on/off modesets, but makes VT switch much more reliable, so I'll take it. [1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/commit/c6d8a11d2c438d514473b1cbe20e5550e7227472 [2]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/3794 Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3342
2023-01-16backend/x11: fix delta_discrete valueKirill Primak
Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3563
2023-01-03backend/x11: fix initial value of wlr_x11_buffer.n_busySimon Ser
We lock the buffer there, so we need to initialize the n_busy count to 1 as well. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3556
2022-12-16backend/drm: check return value of get_drm_{connector,crtc}_props()Simon Ser
We already do it for get_drm_plane_props().
2022-12-15backend/drm: remove wlr_drm_crtc.legacy_crtcSimon Ser
We only need it for one thing: gamma size. Moreover, some bits in the drmModeCrtc will become out-of-date, for instance the current mode, so let's avoid caching the whole struct and only keep what we know won't change.
2022-12-15backend/drm: fetch fresh legacy CRTC in connector_get_current_mode()Simon Ser
connect_drm_connector() may be called long after create_drm_connector(). During that time the DRM mode might have changed. Avoid working with stale information.
2022-12-13backend/drm: drop unused arg in connector_get_current_mode()Simon Ser
2022-12-13backend/drm: prevent out-of-bounds array access on unknown subpixelSimon Ser
If the kernel adds new enum entries for subpixel, don't read past the end of the subpixel_map array.
2022-12-13backend/drm: refuse to switch CRTC for enabled connectorSimon Ser
match_obj() might return a configuration where the CRTC for an enabled connector is switched to another one. We don't support this correctly: the wlr_output common code would need to query again the supported formats, re-allocate the swapchain, etc. What's more, the kernel doesn't even support this [1]: it requires planes to be disabled to change their CRTC, it rejects commits directly switching the CRTC used by a plane. [1]: https://cgit.freedesktop.org/drm/drm-misc/tree/drivers/gpu/drm/drm_atomic.c?h=6e90293618ed476d6b11f82ce724efbb9e9a071b#n697