backend/drm: use DRM_IOCTL_MODE_CLOSEFB instead of RMFB

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.
This commit is contained in:
Simon Ser 2023-10-16 13:10:11 +02:00
parent 395a08f5d1
commit ae3d7a697c
2 changed files with 7 additions and 3 deletions

View file

@ -394,8 +394,12 @@ void drm_fb_destroy(struct wlr_drm_fb *fb) {
wl_list_remove(&fb->link);
wlr_addon_finish(&fb->addon);
if (drmModeRmFB(drm->fd, fb->id) != 0) {
wlr_log(WLR_ERROR, "drmModeRmFB failed");
int ret = drmModeCloseFB(drm->fd, fb->id);
if (ret == -EINVAL) {
ret = drmModeRmFB(drm->fd, fb->id);
}
if (ret != 0) {
wlr_log(WLR_ERROR, "Failed to close FB: %s", strerror(-ret));
}
free(fb);

View file

@ -109,7 +109,7 @@ wayland_server = dependency('wayland-server',
)
drm = dependency('libdrm',
version: '>=2.4.114',
version: '>=2.4.118',
fallback: 'libdrm',
default_options: [
'intel=disabled',