Age | Commit message (Collapse) | Author |
|
|
|
|
|
We only need base POSIX here.
|
|
Since we only use the backend capabilities here we can simply pass
them in directly. This allows other locations to create an allocator
even if they don't have a backend. They can simply specify the caps
they want instead.
|
|
This also fixes a memleak.
|
|
The kernel patches [1] have been merged.
[1]: https://patchwork.freedesktop.org/series/120103/
|
|
We can grab the event loop from the wlr_session instead.
|
|
Leave it up to the compositor to decide what to do when a backend
becomes unavailable.
|
|
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
|
|
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.
|
|
Allows compositors to figure out whether a DRM backend is
secondary on a multi-GPU setup.
|
|
This is unused.
|
|
This function touches queued_fb/current_fb, which the renderer has
nothing to do with.
|
|
|
|
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.
|
|
Many files used to require wlr_matrix but no longer do.
|
|
We don't need the whole wl_display here anymore. The wl_event_loop
is enough.
|
|
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.
|
|
These aren't really tied to wlr_output.
|
|
drm_crtc_commit() already ensures that atomic-only flags are
disallowed.
|
|
Instead of having this condition checked in multiple places,
centralize it so that they don't go out-of-sync.
|
|
This chunk of code was moved by mistake.
Fixes: 3b53d1cbf199 ("backend/drm: introduce page-flip tracking struct")
|
|
When we destroy the backend, page flips will no longer be invoked meaning
those won't clean up the page flips for us.
|
|
|
|
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
|
|
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>
|
|
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
|
|
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.
|
|
We can just assume CLOCK_MONOTONIC everywhere.
Simplifies the backend API, and fixes clock mismatches when multiple
backends are used together with different clocks.
|
|
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;
|
|
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
|
|
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
|
|
|
|
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")
|
|
Atomic doesn't support such flags yet.
|
|
|
|
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
|
|
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
|
|
|
|
https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3664#note_2020392
we're gonna have to trust Simon on this one 🤞
|
|
|
|
|
|
|
|
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
|
|
wlr_client_buffer is a bad indicator for direct scan-out.
Compositors might use the underlying wlr_buffer instead.
|
|
This slightly improves type safety.
The culprits were found with:
git grep -E '\([a-z0-9_ ]+ \*\)\W?[a-z]'
|
|
This is a bit more type-safe.
|
|
This fixes an issue where the panel_orientation parameter was set but wlroots was ignoring it and
returning OUTPUT_TRANSFORM_NORMAL.
Fixes 2e12de96
|
|
|
|
Removes duplication across all the backends to finally apply the mode
to the output.
|