diff options
author | Ville Syrjälä <ville.syrjala@linux.intel.com> | 2016-07-26 22:50:50 +0300 |
---|---|---|
committer | Marge Bot <eric+marge@anholt.net> | 2021-06-05 00:22:22 +0000 |
commit | db83dc619c96c35a039f2d8a32e1a179c0f00d64 (patch) | |
tree | a2754b64ade28028bb9f43c16a7b71f4ea100a27 /src/mesa/drivers | |
parent | 1c312bfc41185ccd32d513557810f4e2e8b4a185 (diff) |
i915: Implement __DRI2_FLUSH version 4
DRI3 needs version 4 of __DRI2_FLUSH.
Straight up port of i965 commit 313f2bc32b86 ("intel: Add
support for the new flush_with_flags extension.").
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9734>
Diffstat (limited to 'src/mesa/drivers')
-rw-r--r-- | src/mesa/drivers/dri/i915/intel_screen.c | 24 |
1 files changed, 19 insertions, 5 deletions
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[] = { |