From 22f4ff1026eeffc566f87453d7f1f70dc23ad4e0 Mon Sep 17 00:00:00 2001 From: Mario Kleiner Date: Fri, 1 Oct 2021 08:49:10 +0200 Subject: [PATCH] modesetting: Handle mixed VRR and non-VRR display setups better. In a setup with both VRR capable and non-VRR capable displays, it was so far inconsistent if the driver would allow use of VRR support or not, as "is_connector_vrr_capable" was set to whatever the capabilities of the last added drm output were. Iow. the plugging order of monitors determined the outcome. Fix this: Now if at least one display is VRR capable, the driver will treat an X-Screen as capable for VRR, plugging order no longer matters. Tested with a dual-display setup with one VRR monitor and one non-VRR monitor. This is also beneficial with the new Option "AsyncFlipSecondaries". When we are at it, also add some so far missing description of the "VariableRefresh" driver option, copied from amdgpu-ddx. Signed-off-by: Mario Kleiner (cherry picked from commit 017ce263376aa64a495c4d71a140a24b1dff7054) --- hw/xfree86/drivers/modesetting/drmmode_display.c | 2 +- hw/xfree86/drivers/modesetting/modesetting.man | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/drivers/modesetting/drmmode_display.c b/hw/xfree86/drivers/modesetting/drmmode_display.c index d6df28f5a..48dccad73 100644 --- a/hw/xfree86/drivers/modesetting/drmmode_display.c +++ b/hw/xfree86/drivers/modesetting/drmmode_display.c @@ -3309,7 +3309,7 @@ drmmode_output_init(ScrnInfoPtr pScrn, drmmode_ptr drmmode, drmModeResPtr mode_r } } - ms->is_connector_vrr_capable = + ms->is_connector_vrr_capable |= drmmode_connector_check_vrr_capable(drmmode->fd, drmmode_output->output_id); return 1; diff --git a/hw/xfree86/drivers/modesetting/modesetting.man b/hw/xfree86/drivers/modesetting/modesetting.man index bb948380b..71790011e 100644 --- a/hw/xfree86/drivers/modesetting/modesetting.man +++ b/hw/xfree86/drivers/modesetting/modesetting.man @@ -71,6 +71,13 @@ One of \*qglamor\*q or \*qnone\*q. Default: glamor. Enable DRI3 page flipping. The default is .B on. .TP +.BI "Option \*qVariableRefresh\*q \*q" boolean \*q +Enables support for enabling variable refresh on the Screen's CRTCs +when an suitable application is flipping via the Present extension. +.br +The default is +.B off. +.TP .BI "Option \*qAsyncFlipSecondaries\*q \*q" boolean \*q Use async flips for secondary video outputs on multi-display setups. If a screen has multiple displays attached and DRI3 page flipping is used, then only one of