dri: Optionally turn off a couple of GLX extensions based on driconf options

With GLX_EXT_buffer_age turned on, gnome-shell will use full-screen damage
with GLX, which severely hurts performance with architectures that emulate
page-flips with copies. Like vmware. We would like to be able to turn off that
extension. Similarly, typically the GLX_OML_sync_control doesn't make much
sense on a virtual architecture since we don't really sync to the host's
vertical retrace. We'd like to be able to turn it off as well.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
This commit is contained in:
Thomas Hellstrom
2017-05-05 05:57:27 -07:00
parent ff2978b449
commit 9d3f177e4b
3 changed files with 25 additions and 3 deletions

View File

@@ -796,6 +796,7 @@ dri3_create_screen(int screen, struct glx_display * priv)
struct glx_config *configs = NULL, *visuals = NULL;
char *driverName, *deviceName, *tmp;
int i;
unsigned char disable;
psc = calloc(1, sizeof *psc);
if (psc == NULL)
@@ -934,13 +935,19 @@ dri3_create_screen(int screen, struct glx_display * priv)
psp->waitForSBC = dri3_wait_for_sbc;
psp->setSwapInterval = dri3_set_swap_interval;
psp->getSwapInterval = dri3_get_swap_interval;
__glXEnableDirectExtension(&psc->base, "GLX_OML_sync_control");
if (psc->config->configQueryb(psc->driScreen,
"glx_disable_oml_sync_control",
&disable) || !disable)
__glXEnableDirectExtension(&psc->base, "GLX_OML_sync_control");
psp->copySubBuffer = dri3_copy_sub_buffer;
__glXEnableDirectExtension(&psc->base, "GLX_MESA_copy_sub_buffer");
psp->getBufferAge = dri3_get_buffer_age;
__glXEnableDirectExtension(&psc->base, "GLX_EXT_buffer_age");
if (psc->config->configQueryb(psc->driScreen,
"glx_disable_ext_buffer_age",
&disable) || !disable)
__glXEnableDirectExtension(&psc->base, "GLX_EXT_buffer_age");
free(driverName);
free(deviceName);