assorted fixes for server-side direct rendering (bug 5199)
authorBrian Paul <brian.paul@tungstengraphics.com>
Tue, 29 Nov 2005 23:01:43 +0000 (23:01 +0000)
committerBrian Paul <brian.paul@tungstengraphics.com>
Tue, 29 Nov 2005 23:01:43 +0000 (23:01 +0000)
include/GL/internal/dri_interface.h
src/mesa/drivers/dri/common/dri_util.c
src/mesa/drivers/dri/common/dri_util.h
src/mesa/drivers/dri/common/glcontextmodes.c

index e63415db026baea49c5c38d9809fb9112d17dfc5..0f3555b576e7a20f591209be33c95ce5b0298dff 100644 (file)
@@ -39,7 +39,6 @@
 #define DRI_INTERFACE_H
 
 #include <GL/internal/glcore.h>
-#include <xf86drm.h>
 #include <drm.h>
 
 /**
index 421f24ccb1c0b2832d1a2f0ce6379c2fec9a1669..d7640759dee55ed075acc1f618c64c9e34f52b70 100644 (file)
@@ -133,9 +133,8 @@ static void __driGarbageCollectDrawables(void *drawHash)
            __DRIdrawablePrivate *pdp = (__DRIdrawablePrivate *)pdraw->private;
            dpy = pdp->driScreenPriv->display;
            if (! (*dri_interface->windowExists)(dpy, draw)) {
-               /* Destroy the local drawable data in the hash table, if the
-                  drawable no longer exists in the Xserver */
-               drmHashDelete(drawHash, draw);
+               /* Destroy the local drawable data, if the drawable no
+                  longer exists in the Xserver */
                (*pdraw->destroyDrawable)(dpy, pdraw->private);
                _mesa_free(pdraw);
            }
@@ -667,6 +666,7 @@ driDestroyDrawable(__DRInativeDisplay *dpy, void *drawablePrivate)
         (*psp->DriverAPI.DestroyBuffer)(pdp);
        if ((*dri_interface->windowExists)(dpy, pdp->draw))
            (void)(*dri_interface->destroyDrawable)(dpy, scrn, pdp->draw);
+       drmHashDelete(psp->drawHash, pdp->draw);
        if (pdp->pClipRects) {
            _mesa_free(pdp->pClipRects);
            pdp->pClipRects = NULL;
index a5e907e7261bffa40d2b8916608d4222ec202063..b9b38f39cd676bd23a3534009116a81e630674d8 100644 (file)
@@ -54,6 +54,7 @@
 #include <GL/gl.h>
 #include "drm.h"
 #include "drm_sarea.h"
+#include "xf86drm.h"
 #include "GL/internal/glcore.h"
 #include "GL/internal/dri_interface.h"
 
index 4bff387ae0a4f9e34593584b0bfaf56885a5eb76..5e9e352f2c6128f02ef89fc18ef4643494685dab 100644 (file)
@@ -157,8 +157,8 @@ _gl_copy_visual_to_context_mode( __GLcontextModes * mode,
     mode->greenMask = config->greenMask;
     mode->blueMask = config->blueMask;
     mode->alphaMask = config->alphaMask;
-    mode->rgbBits = config->bufferSize;
-    mode->indexBits = config->bufferSize;
+    mode->rgbBits = mode->rgbMode ? config->bufferSize : 0;
+    mode->indexBits = mode->colorIndexMode ? config->bufferSize : 0;
 
     mode->accumRedBits = config->accumRedSize;
     mode->accumGreenBits = config->accumGreenSize;