modesetting: Fix RandR output leasing while TearFree is enabled.

Since commit a94dd9536 ("modesetting: add support for TearFree page flips"),
whenever TearFree and PageFlip is simultaneously enabled (which is the
default now), the driver does enable DRM universal plane support, just
as when atomic modesetting is enabled.

Leasing RandR / DRM outputs with universal planes enabled requires
also adding the drm_plane object to the set of leased objects,
otherwise the drmModeCreateLease() ioctl will fail.

Adding a drm_plane object under this condition was omitted, so fix
this omission, and thereby fix RandR output leasing.

Fixes: a94dd9536 ("modesetting: add support for TearFree page flips")
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Part-of: <https://gitlab.freedesktop.org/xorg/xserver/-/merge_requests/2332>
(cherry picked from commit f37bd8de26)
This commit is contained in:
Mario Kleiner 2026-09-27 03:57:40 +02:00 • committed by Enrico Weigelt
commit 81e6f606a1

View file

@ -4074,11 +4074,15 @@ drmmode_create_lease(RRLeasePtr lease, int *fd)
int lease_fd;
uint32_t *objects;
drmmode_lease_private_ptr lease_private;
Bool universalplanes = FALSE;
nobjects = ncrtc + noutput;
if (ms->atomic_modeset)
/* Atomic modesetting, or tearfree with pageflipping, enables universal planes */
if (ms->atomic_modeset || (ms->drmmode.pageflip && ms->drmmode.tearfree_enable)) {
universalplanes = TRUE;
nobjects += ncrtc; /* account for planes as well */
}
if (nobjects == 0)
return BadValue;
@ -4102,7 +4106,7 @@ drmmode_create_lease(RRLeasePtr lease, int *fd)
drmmode_crtc_private_ptr drmmode_crtc = crtc->driver_private;
objects[i++] = drmmode_crtc->mode_crtc->crtc_id;
if (ms->atomic_modeset)
if (universalplanes)
objects[i++] = drmmode_crtc->plane_id;
}