summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/gallium/winsys/egl_drm/intel/intel_egl.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/gallium/winsys/egl_drm/intel/intel_egl.c b/src/gallium/winsys/egl_drm/intel/intel_egl.c
index 4d7e0f4bd5..98928979e7 100644
--- a/src/gallium/winsys/egl_drm/intel/intel_egl.c
+++ b/src/gallium/winsys/egl_drm/intel/intel_egl.c
@@ -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;
}