diff options
author | Uday Kiran Pichika <pichika.uday.kiran@intel.com> | 2020-08-19 16:20:15 +0530 |
---|---|---|
committer | Martin Peres <martin.peres@free.fr> | 2020-09-08 08:00:20 +0000 |
commit | 97f858d336a85cb49de6275918793c773d5d9db1 (patch) | |
tree | d20d0d866b416f61eebc8c9b4c1964dbfb868e28 | |
parent | ede2c32ce116138ddf081932ea2c33bd6f4b6990 (diff) |
modesetting: Allow users to opt-in VRR support
Fetch VariableRefresh option value from X conf file for
modesetting backend DDX driver. This option defaults to false,
and must be set to "true" in conf file for variable refresh
support in the DDX driver.
Signed-off-by: Uday Kiran Pichika <pichika.uday.kiran@intel.com>
-rw-r--r-- | hw/xfree86/drivers/modesetting/driver.c | 8 | ||||
-rw-r--r-- | hw/xfree86/drivers/modesetting/driver.h | 1 |
2 files changed, 9 insertions, 0 deletions
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c index 63ec0ba92..12e58e4f6 100644 --- a/hw/xfree86/drivers/modesetting/driver.c +++ b/hw/xfree86/drivers/modesetting/driver.c @@ -139,6 +139,7 @@ static const OptionInfoRec Options[] = { {OPTION_ZAPHOD_HEADS, "ZaphodHeads", OPTV_STRING, {0}, FALSE}, {OPTION_DOUBLE_SHADOW, "DoubleShadow", OPTV_BOOLEAN, {0}, FALSE}, {OPTION_ATOMIC, "Atomic", OPTV_BOOLEAN, {0}, FALSE}, + {OPTION_VARIABLE_REFRESH, "VariableRefresh", OPTV_BOOLEAN, {0}, FALSE}, {-1, NULL, OPTV_NONE, {0}, FALSE} }; @@ -1188,6 +1189,13 @@ PreInit(ScrnInfoPtr pScrn, int flags) ms->drmmode.shadow_enable ? "YES" : "NO"); ms->drmmode.shadow_enable2 = msShouldDoubleShadow(pScrn, ms); + } else { + if (!pScrn->is_gpu) { + MessageType from = xf86GetOptValBool(ms->drmmode.Options, OPTION_VARIABLE_REFRESH, + &ms->vrr_support) ? X_CONFIG : X_DEFAULT; + xf86DrvMsg(pScrn->scrnIndex, from, "VariableRefresh: %sabled\n", + ms->vrr_support ? "en" : "dis"); + } } ms->drmmode.pageflip = diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h index 7391bc4ab..2791b97c1 100644 --- a/hw/xfree86/drivers/modesetting/driver.h +++ b/hw/xfree86/drivers/modesetting/driver.h @@ -56,6 +56,7 @@ typedef enum { OPTION_ZAPHOD_HEADS, OPTION_DOUBLE_SHADOW, OPTION_ATOMIC, + OPTION_VARIABLE_REFRESH, } modesettingOpts; typedef struct |