[PATCH] GLX/DRI2: Do not expose INTEL_swap_event without swap control

Zack Rusin zackr at vmware.com
Thu Feb 14 15:06:57 PST 2013


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 at vmware.com>
---
 glx/glxdri2.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/glx/glxdri2.c b/glx/glxdri2.c
index b26e501..28bb8c2 100644
--- a/glx/glxdri2.c
+++ b/glx/glxdri2.c
@@ -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");
     }
-- 
1.7.10.4


More information about the xorg-devel mailing list