i915: Fix EGL make current
authorJakob Bornecrantz <jakob@tungstengraphics.com>
Mon, 7 Jul 2008 13:49:09 +0000 (15:49 +0200)
committerJakob Bornecrantz <jakob@tungstengraphics.com>
Mon, 7 Jul 2008 13:49:09 +0000 (15:49 +0200)
src/gallium/winsys/egl_drm/intel/intel_egl.c

index 4d7e0f4bd5786b1c47d884abbd96560cdc45e5d6..98928979e756781b75a7cba0a9db8a5a128fa98c 100644 (file)
@@ -593,12 +593,15 @@ drm_make_current(_EGLDriver *drv, EGLDisplay dpy, EGLSurface draw, EGLSurface re
        if (!b)
                return EGL_FALSE;
 
-       /* XXX this is where we'd do the hardware context switch */
-       (void) drawSurf;
-       (void) readSurf;
-       (void) ctx;
+       if (ctx) {
+               if (!drawSurf || !readSurf)
+                       return EGL_FALSE;
+
+               intel_make_current(ctx->context, drawSurf->drawable, readSurf->drawable);
+       } else {
+               intel_make_current(NULL, NULL, NULL);
+       }
 
-       intel_make_current(ctx->context, drawSurf->drawable, readSurf->drawable);
        return EGL_TRUE;
 }