summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJakob Bornecrantz <[email protected]>2008-07-07 15:49:09 +0200
committerJakob Bornecrantz <[email protected]>2008-07-07 15:49:09 +0200
commit7420bc05a862db09b8d5f34a7760fa19b578b4d0 (patch)
tree1b5d2f027dc0faec97aa25aad1c53d3ffafbddc5
parent88b806a0697efa9f7fde6aa59530675908f7294d (diff)
i915: Fix EGL make current
-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 4d7e0f4bd57..98928979e75 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;
}