diff options
author | Rob Clark <[email protected]> | 2013-03-12 19:31:58 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2013-03-18 14:16:43 -0400 |
commit | 4e8f5c52bb023f48b7503cf13c246f4995d56df7 (patch) | |
tree | e055419a2828b7c37b689f69189920a519fcad07 | |
parent | 5a13e051d9043c2b95333cf778b242ce94be70d5 (diff) |
DRI2: HACK: no GLX_INTEL_swap_event if no ScheduleSwap
If ddx does not support swap, don't advertise it. This is a hack to
work around current xservers which advertise this extension even when it
is clearly not supported. When:
http://lists.x.org/archives/xorg-devel/2013-February/035449.html
is merged in upstream xserver and makes it's way into most distros then
this hack can be removed. In the mean time, it is required to allow
gnome-shell/clutter/etc to work properly with a DDX driver which does
not support ScheduleSwap.
Signed-off-by: Rob Clark <[email protected]>
-rw-r--r-- | src/glx/dri2_glx.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/glx/dri2_glx.c b/src/glx/dri2_glx.c index c4f6996561e..7ce57751f24 100644 --- a/src/glx/dri2_glx.c +++ b/src/glx/dri2_glx.c @@ -1051,11 +1051,16 @@ static const struct glx_context_vtable dri2_context_vtable = { }; static void -dri2BindExtensions(struct dri2_screen *psc, const __DRIextension **extensions, +dri2BindExtensions(struct dri2_screen *psc, struct glx_display * priv, const char *driverName) { + const struct dri2_display *const pdp = (struct dri2_display *) + priv->dri2Display; + const __DRIextension **extensions; int i; + 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"); @@ -1066,10 +1071,15 @@ dri2BindExtensions(struct dri2_screen *psc, const __DRIextension **extensions, * currently unconditionally enabled. This completely breaks * systems running on drivers which don't support that extension. * There's no way to test for its presence on this side, so instead - * of disabling it uncondtionally, just disable it for drivers - * which are known to not support it. + * of disabling it unconditionally, just disable it for drivers + * which are known to not support it, or for DDX drivers supporting + * only an older (pre-ScheduleSwap) version of DRI2. + * + * This is a hack which is required until: + * http://lists.x.org/archives/xorg-devel/2013-February/035449.html + * is merged and updated xserver makes it's way into distros: */ - if (strcmp(driverName, "vmwgfx") != 0) { + if (pdp->swapAvailable && strcmp(driverName, "vmwgfx") != 0) { __glXEnableDirectExtension(&psc->base, "GLX_INTEL_swap_event"); } @@ -1212,8 +1222,7 @@ dri2CreateScreen(int screen, struct glx_display * priv) goto handle_error; } - extensions = psc->core->getExtensions(psc->driScreen); - dri2BindExtensions(psc, extensions, driverName); + dri2BindExtensions(psc, priv, driverName); configs = driConvertConfigs(psc->core, psc->base.configs, driver_configs); visuals = driConvertConfigs(psc->core, psc->base.visuals, driver_configs); |