i915: Implement __DRI2_FLUSH version 4

DRI3 needs version 4 of __DRI2_FLUSH.

Straight up port of i965 commit 313f2bc32b ("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>
This commit is contained in:
Ville Syrjälä
2016-07-26 22:50:50 +03:00
committed by Marge Bot
parent 1c312bfc41
commit db83dc619c
+19 -5
View File
@@ -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[] = {