Package: libgl1-mesa-glx Version: 7.7.1-4 Severity: normal Tags: upstream patch
libGL does not fallback to indirect rendering automatically when necessary, setting LIBGL_ALWAYS_INDIRECT environment variable is usually required (application fails with "Error: couldn't find RGB GLX visual or fbconfig" or similar error otherwise). The patch fixes handling of incompatible visuals and fbconfigs between local DRI driver and remote GLX display, fallback driver is used instead of useless empty configuration. -- System Information: Debian Release: 6.0.1 APT prefers stable-updates APT policy: (500, 'stable-updates'), (500, 'stable') Architecture: amd64 (x86_64) Kernel: Linux 2.6.32-5-amd64 (SMP w/16 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages libgl1-mesa-glx depends on: ii libc6 2.11.2-10 Embedded GNU C Library: Shared lib ii libdrm2 2.4.21-1~squeeze3 Userspace interface to kernel DRM ii libx11-6 2:1.3.3-4 X11 client-side library ii libxdamage1 1:1.1.3-1 X11 damaged region extension libra ii libxext6 2:1.1.2-1 X11 miscellaneous extension librar ii libxfixes3 1:4.0.5-1 X11 miscellaneous 'fixes' extensio ii libxxf86vm1 1:1.1.0-2 X11 XFree86 video mode extension l Versions of packages libgl1-mesa-glx recommends: ii libgl1-mesa-dri 7.7.1-4 A free implementation of the OpenG libgl1-mesa-glx suggests no packages. -- no debconf information
--- mesa.orig/src/glx/x11/drisw_glx.c 2011-07-21 19:35:46.819907934 +0200 +++ mesa/src/glx/x11/drisw_glx.c 2011-07-21 22:35:05.767907534 +0200 @@ -349,6 +349,7 @@ psc->__driScreen = NULL; if (psc->driver) dlclose(psc->driver); + psc->driver = NULL; } static __GLXDRIscreen * @@ -359,6 +360,7 @@ const __DRIconfig **driver_configs; const __DRIextension **extensions; const char *driverName = "swrast"; + __GLcontextModes *visuals, *configs; int i; psp = Xcalloc(1, sizeof *psp); @@ -398,10 +400,19 @@ goto handle_error; } + configs = driConvertConfigs(psc->core, psc->configs, driver_configs); + visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs); + + if (configs == NULL || visuals == NULL) { + driDestroyScreen(psc); + ErrorMessageF("driver supports no visual or config\n"); + goto handle_error; + } + driBindExtensions(psc, 0); - psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs); - psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs); + psc->configs = configs; + psc->visuals = visuals; psc->driver_configs = driver_configs; --- mesa.orig/src/glx/x11/dri_common.c 2011-07-21 23:03:42.471907705 +0200 +++ mesa/src/glx/x11/dri_common.c 2011-07-22 09:51:46.207906621 +0200 @@ -331,7 +331,7 @@ tail = tail->next; } - _gl_context_modes_destroy(modes); + /* _gl_context_modes_destroy(modes); */ return head.next; } --- mesa.orig/src/glx/x11/dri_glx.c 2011-07-21 23:08:01.888032664 +0200 +++ mesa/src/glx/x11/dri_glx.c 2011-07-21 23:17:43.692033344 +0200 @@ -316,6 +316,7 @@ int junk; const __DRIconfig **driver_configs; __GLcontextModes *visual; + __GLcontextModes *visuals, *configs; /* DRI protocol version. */ dri_version.major = driDpy->driMajor; @@ -424,8 +425,20 @@ goto handle_error; } - psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs); - psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs); + configs = driConvertConfigs(psc->core, psc->configs, driver_configs); + visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs); + + if (configs == NULL || visuals == NULL) { + if (configs != NULL) _gl_context_modes_destroy(configs); + if (visuals != NULL) _gl_context_modes_destroy(visuals); + ErrorMessageF("driver supports no visual or config\n"); + goto handle_error; + } + + _gl_context_modes_destroy(psc->configs); + _gl_context_modes_destroy(psc->visuals); + psc->configs = configs; + psc->visuals = visuals; psc->driver_configs = driver_configs; --- mesa.orig/src/glx/x11/dri2_glx.c 2011-07-21 23:23:34.147907316 +0200 +++ mesa/src/glx/x11/dri2_glx.c 2011-07-21 23:27:07.319907259 +0200 @@ -308,6 +308,10 @@ (*psc->core->destroyScreen) (psc->__driScreen); close(psc->fd); psc->__driScreen = NULL; + if (psc->driver) + dlclose(psc->driver); + psc->driver = NULL; + } /** @@ -425,6 +429,7 @@ const __GLXDRIdisplayPrivate *const pdp = (__GLXDRIdisplayPrivate *) priv->dri2Display; __GLXDRIscreen *psp; + __GLcontextModes *visuals, *configs; char *driverName, *deviceName; drm_magic_t magic; int i; @@ -496,10 +501,22 @@ goto handle_error; } - driBindExtensions(psc, 1); + configs = driConvertConfigs(psc->core, psc->configs, driver_configs); + visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs); - psc->configs = driConvertConfigs(psc->core, psc->configs, driver_configs); - psc->visuals = driConvertConfigs(psc->core, psc->visuals, driver_configs); + if (configs == NULL || visuals == NULL) { + if (configs != NULL) _gl_context_modes_destroy(configs); + if (visuals != NULL) _gl_context_modes_destroy(visuals); + ErrorMessageF("driver supports no visual or config\n"); + goto handle_error; + } + + _gl_context_modes_destroy(psc->configs); + _gl_context_modes_destroy(psc->visuals); + psc->configs = configs; + psc->visuals = visuals; + + driBindExtensions(psc, 1); psc->driver_configs = driver_configs;