diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index df1abea17fc1ebb2d3af1c9202421f2f75fec48f..8f40ba19728118ba5a7010ced5befd0ce39ac841 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -1227,6 +1227,16 @@ PreInit(ScrnInfoPtr pScrn, int flags) ms->atomic_modeset = FALSE; } + /* Universal planes are implied by atomic modeset. However, if atomic modeset + is disabled, universal planes are still useful for us to understand what + modifiers the primary plane can support (see drmmode_crtc_create_planes()) + */ + ms->universal_planes = ms->atomic_modeset; + if (ms->universal_planes == FALSE) { + ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_UNIVERSAL_PLANES, 1); + ms->universal_planes = (ret == 0); + } + ms->kms_has_modifiers = FALSE; ret = drmGetCap(ms->fd, DRM_CAP_ADDFB2_MODIFIERS, &value); if (ret == 0 && value != 0) diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h index 11497104832ce2d0a337831413e5da40c4a2169a..da514c9ba4bcb396883473f4b6644197dddcafef 100644 --- a/hw/xfree86/drivers/modesetting/driver.h +++ b/hw/xfree86/drivers/modesetting/driver.h @@ -117,6 +117,7 @@ typedef struct _modesettingRec { * @{ */ Bool atomic_modeset; + Bool universal_planes; Bool pending_modeset; /** @} */ diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index c10504c32901c2157f280f8404141e75ef3aed57..a2ca1087dcbfdf2d976e38844b1c682c1993c709 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -3563,7 +3563,7 @@ drmmode_create_lease(RRLeasePtr lease, int *fd) nobjects = ncrtc + noutput; - if (ms->atomic_modeset) + if (ms->universal_planes) nobjects += ncrtc; /* account for planes as well */ if (nobjects == 0) @@ -3588,7 +3588,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 (ms->universal_planes) objects[i++] = drmmode_crtc->plane_id; }