diff --git a/src/mesa/drivers/dri/i915/intel_screen.c b/src/mesa/drivers/dri/i915/intel_screen.c index 7d86a660001..6135357c2a0 100644 --- a/src/mesa/drivers/dri/i915/intel_screen.c +++ b/src/mesa/drivers/dri/i915/intel_screen.c @@ -153,16 +153,21 @@ static const __DRItexBufferExtension intelTexBufferExtension = { }; static void -intelDRI2Flush(__DRIdrawable *drawable) +intelDRI2FlushWithFlags(__DRIcontext *context, + __DRIdrawable *drawable, + unsigned flags, + enum __DRI2throttleReason reason) { - GET_CURRENT_CONTEXT(ctx); - struct intel_context *intel = intel_context(ctx); + struct intel_context *intel = context->driverPrivate; if (intel == NULL) return; + struct gl_context *ctx = &intel->ctx; INTEL_FIREVERTICES(intel); - intel->need_throttle = true; + if (reason == __DRI2_THROTTLE_SWAPBUFFER || + reason == __DRI2_THROTTLE_FLUSHFRONT) + intel->need_throttle = true; if (intel->batch.used) intel_batchbuffer_flush(intel); @@ -172,11 +177,20 @@ intelDRI2Flush(__DRIdrawable *drawable) } } +static void +intelDRI2Flush(__DRIdrawable *drawable) +{ + intelDRI2FlushWithFlags(drawable->driContextPriv, drawable, + __DRI2_FLUSH_DRAWABLE, + __DRI2_THROTTLE_SWAPBUFFER); +} + static const struct __DRI2flushExtensionRec intelFlushExtension = { - .base = { __DRI2_FLUSH, 3 }, + .base = { __DRI2_FLUSH, 4 }, .flush = intelDRI2Flush, .invalidate = dri2InvalidateDrawable, + .flush_with_flags = intelDRI2FlushWithFlags, }; static struct intel_image_format intel_image_formats[] = {