summaryrefslogtreecommitdiffstats
path: root/src/glx/dri2_glx.c
diff options
context:
space:
mode:
authorThomas Hellstrom <[email protected]>2018-02-26 14:27:40 +0100
committerThomas Hellstrom <[email protected]>2018-03-08 07:26:29 +0100
commitf4070956d4cd06b27c596ff4780b945537ceb84f (patch)
treebed11d8c7f0bab0a8b5a3ded89b6cedc44599381 /src/glx/dri2_glx.c
parent0c90264da4139805d34f530485a678c53809932e (diff)
glx/dri: Add a driconf option to disable GLX_SGI_video_sync
Drivers on virtual hardware don't want to expose this extension to GLX compositors, similarly to GLX_OML_sync_control, since that significantly increases latency. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]> Reviewed-by: Deepak Rawat <[email protected]>
Diffstat (limited to 'src/glx/dri2_glx.c')
-rw-r--r--src/glx/dri2_glx.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c
index 0f44635725d..91afc337505 100644
--- a/src/glx/dri2_glx.c
+++ b/src/glx/dri2_glx.c
@@ -1102,7 +1102,6 @@ dri2BindExtensions(struct dri2_screen *psc, struct glx_display * priv,
extensions = psc->core->getExtensions(psc->driScreen);
- __glXEnableDirectExtension(&psc->base, "GLX_SGI_video_sync");
__glXEnableDirectExtension(&psc->base, "GLX_SGI_swap_control");
__glXEnableDirectExtension(&psc->base, "GLX_MESA_swap_control");
__glXEnableDirectExtension(&psc->base, "GLX_SGI_make_current_read");
@@ -1207,6 +1206,7 @@ dri2CreateScreen(int screen, struct glx_display * priv)
char *driverName = NULL, *loader_driverName, *deviceName, *tmp;
drm_magic_t magic;
int i;
+ unsigned char disable;
psc = calloc(1, sizeof *psc);
if (psc == NULL)
@@ -1325,8 +1325,6 @@ dri2CreateScreen(int screen, struct glx_display * priv)
psp->getBufferAge = NULL;
if (pdp->driMinor >= 2) {
- unsigned char disable;
-
psp->getDrawableMSC = dri2DrawableGetMSC;
psp->waitForMSC = dri2WaitForMSC;
psp->waitForSBC = dri2WaitForSBC;
@@ -1338,6 +1336,11 @@ dri2CreateScreen(int screen, struct glx_display * priv)
__glXEnableDirectExtension(&psc->base, "GLX_OML_sync_control");
}
+ if (psc->config->configQueryb(psc->driScreen,
+ "glx_disable_sgi_video_sync",
+ &disable) || !disable)
+ __glXEnableDirectExtension(&psc->base, "GLX_SGI_video_sync");
+
/* DRI2 supports SubBuffer through DRI2CopyRegion, so it's always
* available.*/
psp->copySubBuffer = dri2CopySubBuffer;