Browse Source

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 <robdclark@gmail.com>
tags/mesa-9.2-rc1
Rob Clark 12 years ago
parent
commit
4e8f5c52bb
1 changed files with 15 additions and 6 deletions
  1. 15
    6
      src/glx/dri2_glx.c

+ 15
- 6
src/glx/dri2_glx.c View File

@@ -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);

Loading…
Cancel
Save