aboutsummaryrefslogtreecommitdiff
path: root/backend
AgeCommit message (Collapse)Author
2024-01-25backend/multi: emit destroy signal before destroying child backendsSimon Ser
Some users might want to destroy the multi backend when a child backend is being destroyed. However, they can't destroy the multi backend if it's already in the process of being destroyed. The destroy signal was changed to be emitted after destroying child backends in babdd6ccf757 ("backend: fix use-after-free when destroying backends"). However, this was done to accomodate for an old "output_remove" event on backends, which has long been dropped in favor of wlr_output.events.destroy. This patch follows the same principle as 5d639394f3e8 ("types/output: emit destroy event before destroying global").
2024-01-23backend/wayland: populate pointer axis relative directionSimon Ser
2024-01-23backend/libinput: populate pointer axis relative directionSimon Ser
2024-01-17backend/x11: handle touchpoint allocation failureKirill Primak
2024-01-04Fix bool return typesSimon Ser
This makes wlroots build in C23 mode. C23 is more strict and rejects implicit conversions from bool to a pointer.
2023-12-30backend/drm: save current refresh rateSimon Ser
wlr_output.refresh is populated by core wlr_output, and thus will be zero for a custom mode with an unset refresh rate. Save the refresh rate from the drmModeModeInfo in wlr_drm_connector instead. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3791
2023-12-21backend: fix build against upcoming `gcc-14` (`-Werror=calloc-transposed-args`)Sergei Trofimovich
`gcc-14` added a new `-Wcalloc-transposed-args` warning recently. It detected minor infelicity in `calloc()` API usage in `wlroots`: ../backend/libinput/tablet_pad.c: In function 'add_pad_group_from_libinput': ../backend/libinput/tablet_pad.c:36:38: error: 'calloc' sizes specified with 'sizeof' in the earlier argument and not in the later argument [-Werror=calloc-transposed-args] 36 | group->rings = calloc(sizeof(unsigned int), group->ring_count); | ^~~~~~~~ ../backend/libinput/tablet_pad.c:36:38: note: earlier argument should specify number of elements, later size of each element
2023-12-12backend/drm: return secondary backend DRM FDSimon Ser
It can be useful for compositors to get the real DRM FD instead of the one from the parent compositor. For instance, some compositors might want to perform some DRM IOCTLs there to check the driver name, fetch some DRM resources, etc. This will also be a requirement for direct scanout on secondary GPUs.
2023-12-12backend/drm: add wlr_drm_backend_get_parent()Simon Ser
Allows compositors to figure out whether a DRM backend is secondary on a multi-GPU setup.
2023-11-30backend/x11: Use wlr_texture_read_pixelsAlexander Orzechowski
2023-11-30backend/drm: remove wlr_drm_renderer.backendSimon Ser
This is unused.
2023-11-30backend/drm: move drm_plane_finish_surface() to drm.cSimon Ser
This function touches queued_fb/current_fb, which the renderer has nothing to do with.
2023-11-30backend/drm: split wlr_drm_fb related functions into separate fileSimon Ser
2023-11-28backend/drm: use DRM_IOCTL_MODE_CLOSEFB instead of RMFBSimon Ser
RMFB implicitly performs a modeset to turn off any CRTC which is using the FB. This prevents seamless transitions between two DRM masters from working. Use the new CLOSEFB IOCTL which doesn't turn off anything and leave it up to the compositor to turn off outputs on shutdown if it wants to.
2023-11-27backend/x11: don't send ConfigureRequest with the same sizeKirill Primak
Under X11, ConfigureNotify means that the window has already been resized. Sending ConfigureRequest with the received size is not only useless, but also can confuse the window manager, which will probably reply with the current (i.e. *old*) size causing a configure loop. Fixes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3769
2023-11-26backend/x11: check buffer format in output_test()Kirill Primak
2023-11-25Cleanup wlr_matrix.h includesSimon Ser
Many files used to require wlr_matrix but no longer do.
2023-11-23output: take wl_event_loop in wlr_output_init()Simon Ser
We don't need the whole wl_display here anymore. The wl_event_loop is enough.
2023-11-23backend/session: take wl_event_loop instead of wl_displaySimon Ser
wl_display holds a lot more than wlr_session needs: wlr_session only needs to wait for a FD to become readable, but wl_display provides full access to the Wayland client and protocol objects. Switch to wl_event_loop to better reflect the above.
2023-11-23util/transform: move over wl_output_transform helpersSimon Ser
These aren't really tied to wlr_output.
2023-11-19backend/drm: drop unnecessary flags in legacy interfaceSimon Ser
drm_crtc_commit() already ensures that atomic-only flags are disallowed.
2023-11-19backend/drm: add wlr_drm_connector_state.nonblockSimon Ser
Instead of having this condition checked in multiple places, centralize it so that they don't go out-of-sync.
2023-11-19backend/drm: fix pending page-flip checkSimon Ser
This chunk of code was moved by mistake. Fixes: 3b53d1cbf199 ("backend/drm: introduce page-flip tracking struct")
2023-11-17backend/drm: Destroy page flips on backend destroyAlexander Orzechowski
When we destroy the backend, page flips will no longer be invoked meaning those won't clean up the page flips for us.
2023-11-17backend/drm: Track page flips in listAlexander Orzechowski
2023-11-17backend/drm: introduce page-flip tracking structSimon Ser
Introduce a per-page-flip tracking struct passed to the kernel when we request a page-flip event for an atomic commit. The kernel will pass us back this pointer when delivering the event. This eliminates any risk of mixing up events together. In particular, if two events are pending, or if the CRTC of a connector is swapped, we no longer blow up in the page-flip event handler. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3753
2023-11-17backend/drm: free fb latersunzhguy
since 4932e0d347f("backend/drm: ensure plane surfaces are cleaned up on shutdown") at finish_drm_resources called drm_plane_finsh_surface has already free the fb Signed-off-by: zhoulei zhoulei@kylinos.cn Signed-off-by: sunzhguy <sunzhigang1@kylinos.cn>
2023-11-15backend/drm: leave CRTCs on when shutting downSimon Ser
This avoids a black screen during multiple seconds on shutdown. To fully allow for flicker-free transitions between DRM masters, we will also need [1]. [1]: https://gitlab.freedesktop.org/wlroots/wlroots/-/merge_requests/4394 Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3497
2023-11-15backend/drm: ensure plane surfaces are cleaned up on shutdownSimon Ser
Right now this is done "by chance" because we disable all CRTCs on shutdown. However, we'll stop doing this. Plus, if disabling a CRTC fails, we don't cleanup properly.
2023-10-30backend: drop wlr_backend_get_presentation_clock()Simon Ser
We can just assume CLOCK_MONOTONIC everywhere. Simplifies the backend API, and fixes clock mismatches when multiple backends are used together with different clocks.
2023-10-16Fix output layers order error on wayland backendJiDe Zhang
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-02docs: replace the less commonly used "::" with "."Kirill Primak
2023-10-02output: defer fake present events until after commitRose Hudson
Since headless and wayland-without-presentation-feedback were firing present inside their commit impls, present was getting fired before commit, which is cursed. Defer this with an idle timer so that commit handlers can run before present handlers.
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-21backend/headless: fix broken output frame eventsSimon Ser
frame_delay was set to 0. Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3712
2023-08-16backend/wayland: wait for xdg_surface.configure explicitlySimon Ser
We were assuming a roundtrip was enough to get an xdg_surface.configure event. That's not the case, the protocol spec doesn't make such a guarantee.
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-16backend/headless: Use output state to set init custom modeAlexander Orzechowski
2023-08-16backend/wayland: Use output state to set init custom modeAlexander Orzechowski