Merge remote branch 'origin/gallium-0.2' into gallium-0.2
[mesa.git] / src / glx / x11 / dri_glx.c
index d2a06619493f2667ccb5e5537ee537929edad166..47203f50087f09088ecb53679103872f24c08100 100644 (file)
@@ -37,7 +37,6 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 #include <X11/Xlib.h>
 #include <X11/extensions/Xfixes.h>
 #include <X11/extensions/Xdamage.h>
-#include "glheader.h"
 #include "glxclient.h"
 #include "glcontextmodes.h"
 #include "xf86dri.h"
@@ -421,7 +420,7 @@ CallCreateNewScreen(Display *dpy, int scrn, __GLXscreenConfigs *psc,
 
     XF86DRICloseConnection(dpy, scrn);
 
-    ErrorMessageF("reverting to indirect rendering\n");
+    ErrorMessageF("reverting to software direct rendering\n");
 
     return NULL;
 }
@@ -445,6 +444,7 @@ static void driDestroyContext(__GLXDRIcontext *context,
     (*psc->core->destroyContext)(pcp->driContext);
 
     XF86DRIDestroyContext(psc->dpy, psc->scr, pcp->hwContextID);
+    Xfree(pcp);
 }
 
 static Bool driBindContext(__GLXDRIcontext *context,
@@ -569,6 +569,11 @@ static __GLXDRIdrawable *driCreateDrawable(__GLXscreenConfigs *psc,
     return pdraw;
 }
 
+static void driSwapBuffers(__GLXDRIdrawable *pdraw)
+{
+   (*pdraw->psc->core->swapBuffers)(pdraw->driDrawable);
+}
+
 static void driDestroyScreen(__GLXscreenConfigs *psc)
 {
     /* Free the direct rendering per screen data */
@@ -635,11 +640,12 @@ static __GLXDRIscreen *driCreateScreen(__GLXscreenConfigs *psc, int screen,
        return NULL;
     }
 
-    driBindExtensions(psc);
+    driBindExtensions(psc, 0);
 
     psp->destroyScreen = driDestroyScreen;
     psp->createContext = driCreateContext;
     psp->createDrawable = driCreateDrawable;
+    psp->swapBuffers = driSwapBuffers;
 
     return psp;
 }