[Mesa-dev] [Bug 30220] New: Change windowExistsErrorHandler to drawableExistsErrorHandler in glxcmds.c ?

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Thu Sep 16 00:52:32 PDT 2010


https://bugs.freedesktop.org/show_bug.cgi?id=30220

           Summary: Change windowExistsErrorHandler to
                    drawableExistsErrorHandler in glxcmds.c ?
           Product: Mesa
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: GLX
        AssignedTo: mesa-dev at lists.freedesktop.org
        ReportedBy: jpsinthemix at verizon.net


Created an attachment (id=38733)
 --> (https://bugs.freedesktop.org/attachment.cgi?id=38733)
patch to Change windowExistsErrorHandler to drawableExistsErrorHandler in
glxcmds.c 

There currently exists a situation in KDE-4.5.X where at certain moments, a
current context does not have a valid associated Window, but does have a valid
pixmap drawable. If, at such a moment, a call is made to glXDestroyContext() on
another no longer needed non-current context, glXDestroyContext() releases
pixmap-associated resources that are in use by the current context, resulting
in system hangs.

A possible patch to remedy this changes BadWindow to BadDrawable in
windowExistsErrorHandler of Mesa-7.8.3-rc1.old/src/glx/glxcmds.c (I have also
attached the patch; does this make sense?):


--- Mesa-7.8.3-rc1.old/src/glx/glxcmds.c        2010-09-16 03:14:45.074000414
-0400
+++ Mesa-7.8.3-rc1.new/src/glx/glxcmds.c        2010-09-16 03:37:43.932000358
-0400
@@ -68,14 +68,14 @@

 #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)

-static Bool windowExistsFlag;
+static Bool drawableExistsFlag;
 static int
-windowExistsErrorHandler(Display * dpy, XErrorEvent * xerr)
+drawableExistsErrorHandler(Display * dpy, XErrorEvent * xerr)
 {
    (void) dpy;

-   if (xerr->error_code == BadWindow) {
-      windowExistsFlag = GL_FALSE;
+   if (xerr->error_code == BadDrawable) {
+      drawableExistsFlag = GL_FALSE;
    }
    return 0;
 }
@@ -98,13 +98,13 @@
    /* Set no-op error handler so Xlib doesn't bail out if the windows
     * has alreay been destroyed on the server. */
    XSync(dpy, GL_FALSE);
-   oldXErrorHandler = XSetErrorHandler(windowExistsErrorHandler);
+   oldXErrorHandler = XSetErrorHandler(drawableExistsErrorHandler);

    if (__glxHashFirst(sc->drawHash, &draw, (void *) &pdraw) == 1) {
       do {
-         windowExistsFlag = GL_TRUE;
+         drawableExistsFlag = GL_TRUE;
          XGetWindowAttributes(dpy, draw, &xwa); /* dummy request */
-         if (!windowExistsFlag) {
+         if (!drawableExistsFlag) {
             /* Destroy the local drawable data, if the drawable no
                longer exists in the Xserver */
             (*pdraw->destroyDrawable) (pdraw);

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the mesa-dev mailing list