aboutsummaryrefslogtreecommitdiff
path: root/backend/drm
AgeCommit message (Collapse)Author
2023-10-12Revert "backend/drm: Automatic non-blocking commits"Simon Ser
This reverts commit 45ba35719e874f7e8651e088c0582fe50301e731. Sadly, this causes regressions on amdgpu [1] and even with these fixed, there are fundamental issues with non-blocking modesets [2]. [1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3745 [2]: https://oftc.irclog.whitequark.org/dri-devel/2023-10-11#1697031838-1697036920;
2023-10-10backend/drm: Automatic non-blocking commitsKenny Levinsen
We currently only perform non-blocking commits for non-modeset commits with a buffer attached. Perform non-blocking commits whenever there is no pending pageflip event. If a non-blocking modeset commit fails, which can happen if the driver implicitly added more CRTCs to the commit that we did not know we had to wait for, retry with a blocking commit. References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/2239
2023-10-09output: allow_artifacts -> allow_reconfigurationKenny Levinsen
The name "allow_artifacts" and associated description is very vague, and theoretically allow for tearing behavior. Clarify that we only intend to mean artifacts related to output configuration (e.g., modesets). References: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3740
2023-10-03treewide: Migrate from sizeof(struct) to sizeof(*pointer) where practicalAlexander Orzechowski
2023-10-02backend/drm: restore pending page-flip check when tearingSimon Ser
DRM_MODE_PAGE_FLIP_ASYNC doesn't allow user-space to submit new buffers before waiting for the uevent: the kernel will return EBUSY in that case. Fixes: c2aa7fd965cb ("backend/drm: Add async page flip support to legacy")
2023-09-28backend/drm: Add async page flip support to legacyvaxerski
Atomic doesn't support such flags yet.
2023-09-07backend/drm: Compute custom mode correctlyAlexander Orzechowski
2023-08-25backend/drm: drop no-op shortcutSimon Ser
Since e5fc8cd4c734 ("output: trigger frame/present events on all commits on enabled output"), any commit on an enabled output is supposed to trigger frame/present events. The DRM backend was skipping the commit completely for no-op commits. Stop doing so. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3719
2023-08-23output: trigger frame/present events on all commits on enabled outputSimon Ser
Up until now, frame/present events were only triggered when the user submitted a buffer. Change the wlr_output API so that these events are triggered when any commit is applied on an enabled output. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3708
2023-08-23backend/drm: report !presented if session is inactiveRose Hudson
2023-08-23backend/drm: don't set frame_pending on modesetRose Hudson
https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3664#note_2020392 we're gonna have to trust Simon on this one 🤞
2023-08-16backend/drm: Use output state to set init modeAlexander Orzechowski
2023-08-16backend/drm: Move output variable up in connect_drm_connectorAlexander Orzechowski
2023-08-16output: Add initialization state to wlr_output_initAlexander Orzechowski
2023-07-26backend/drm: restore custom modesSimon Ser
We were only restoring fixed modes here. The DRM backend no longer creates fixed modes when the compositor sets a custom mode, so we need to handle this situation when restoring. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3698
2023-07-14backend/drm: stop checking for wlr_client_bufferSimon Ser
wlr_client_buffer is a bad indicator for direct scan-out. Compositors might use the underlying wlr_buffer instead.
2023-07-11Use wl_container_of() instead of castsSimon Ser
This slightly improves type safety. The culprits were found with: git grep -E '\([a-z0-9_ ]+ \*\)\W?[a-z]'
2023-07-07Use struct initializers instead of memset()Simon Ser
This is a bit more type-safe.
2023-06-30backend/drm: use panel_orientation if it is setClayton Craft
This fixes an issue where the panel_orientation parameter was set but wlroots was ignoring it and returning OUTPUT_TRANSFORM_NORMAL. Fixes 2e12de96
2023-06-30backend/drm: handle output layer damageSimon Ser
2023-06-27output: Set output mode during main commitAlexander Orzechowski
Removes duplication across all the backends to finally apply the mode to the output.
2023-06-27backend/drm: Don't add pollute fixed modes list with custom modesAlexander Orzechowski
Nobody remembers why this is done and it isn't that great if people use a lot of custom modes.
2023-06-26backend/drm: remove duplicate needs_frame() in set_cursor()Simon Ser
wlr_output_update_needs_frame() is called unconditionally at the end of the function already.
2023-06-23output: add wlr_output_state_init()Simon Ser
This changes the semantics of wlr_output_state. Instead of having fields with uninitialized memory when missing from the committed bitflag, all fields are always initialized (and maybe NULL/empty), just like we do in wlr_surface_state. This reduces the chances of footguns when reading a field, and removes the need to check for the committed bitfield everywhere. A new wlr_output_state_init() function takes care of initializing the Pixman region.
2023-06-22backend/drm: fix libliftoff_plane double-freeSimon Ser
Destroying the liftoff_device invalidates all of the liftoff_planes. Destroy the liftoff_planes before the liftoff_device to fix this.
2023-06-21backend/drm: Fix typoAlexander Orzechowski
2023-06-19backend/drm: Use texture blend_mode for multigpu blitAlexander Orzechowski
2023-06-12backend/drm: clip FB damageSimon Ser
The kernel complains when the damage exceeds the FB bounds: [73850.448326] i915 0000:00:02.0: [drm:drm_atomic_check_only] [PLANE:31:plane 1A] invalid damage clip 0 0 2147483647 2147483647 Make the DRM backend behave like the Wayland one and allow compositors to damage (0, 0, INT32_MAX, INT32_MAX) to repaint everything without needing to know the exact buffer size. Closes: https://github.com/swaywm/sway/issues/7632
2023-06-05add render timer APIRose Hudson
Based on five calls: wlr_render_timer_create - creates a timer which can be reused across frames on the same renderer wlr_renderer_begin_buffer_pass - now takes a timer so that backends can record when the rendering starts and finishes wlr_render_timer_get_time - should be called as late as possible so that queries can make their way back from the GPU wlr_render_timer_destroy - self-explanatory The timer is exposed as an opaque `struct wlr_render_timer` so that backends can store whatever they want in there.
2023-05-31backend/drm: introduce wlr_drm_mode_get_info()Simon Ser
This allows compositors to get back the raw drmModeModeInfo and look at DRM-specific fields and flags.
2023-05-30backend/drm: use new rendering APISimon Ser
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-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
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-20backend/drm: log drm_connector_alloc_crtc() failuresSimon Ser
Helps figuring out why e.g. get_primary_formats fails.
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-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/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-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.