From: Jakob Bornecrantz Date: Mon, 7 Jul 2008 13:49:09 +0000 (+0200) Subject: i915: Fix EGL make current X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=7420bc05a862db09b8d5f34a7760fa19b578b4d0;p=mesa.git i915: Fix EGL make current --- 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; }