GLX/DRI2: Do not expose INTEL_swap_event without swap control
authorZack Rusin <zackr@vmware.com>
Thu, 14 Feb 2013 23:06:57 +0000 (15:06 -0800)
committerKeith Packard <keithp@keithp.com>
Mon, 18 Mar 2013 18:23:57 +0000 (11:23 -0700)
Swap events depent on the implementation of ScheduleSwap. By
unconditionally enabling GLX_INTEL_swap_event we're breaking
the system with drivers that don't support it because the apps
are forever stuck waiting for an event that will never be
delivered. So lets enable the extension only if the hooks it
depends on are actually there.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Keith Packard <keithp@keithp.com>
glx/glxdri2.c

index 8fba6a8..e07cb56 100644 (file)
@@ -857,8 +857,6 @@ initializeExtensions(__GLXDRIscreen * screen)
     __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_copy_sub_buffer");
     LogMessage(X_INFO, "AIGLX: enabled GLX_MESA_copy_sub_buffer\n");
 
-    __glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event");
-    LogMessage(X_INFO, "AIGLX: enabled GLX_INTEL_swap_event\n");
 
 #if __DRI_DRI2_VERSION >= 3
     if (screen->dri2->base.version >= 3) {
@@ -876,8 +874,10 @@ initializeExtensions(__GLXDRIscreen * screen)
 #endif
 
     if (DRI2HasSwapControl(pScreen)) {
+        __glXEnableExtension(screen->glx_enable_bits, "GLX_INTEL_swap_event");
         __glXEnableExtension(screen->glx_enable_bits, "GLX_SGI_swap_control");
         __glXEnableExtension(screen->glx_enable_bits, "GLX_MESA_swap_control");
+        LogMessage(X_INFO, "AIGLX: enabled GLX_INTEL_swap_event\n");
         LogMessage(X_INFO,
                    "AIGLX: enabled GLX_SGI_swap_control and GLX_MESA_swap_control\n");
     }