summaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/dri/dri2.c
diff options
context:
space:
mode:
authorThomas Hellstrom <[email protected]>2017-06-20 19:24:34 +0200
committerThomas Hellstrom <[email protected]>2017-08-03 08:01:31 +0200
commitd5ba75f8881f0869dc16f71f7395514c0a35b6e2 (patch)
tree520888733122ce7526143898cdead1e5245a91bc /src/gallium/state_trackers/dri/dri2.c
parent91c93dec980dbf7b253c124b85dc4e46d2a83587 (diff)
st/dri2 Plumb the flush_swapbuffer functionality through to dri3
Implement the state tracker manager drawable interface flush_swapbuffer method by plumbing it through to dri3 if available. Signed-off-by: Thomas Hellstrom <[email protected]> Reviewed-by: Marek Olšák <[email protected]> Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Sinclair Yeh <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers/dri/dri2.c')
-rw-r--r--src/gallium/state_trackers/dri/dri2.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index 0f71adc7689..1171e7386d7 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -861,6 +861,21 @@ dri2_flush_frontbuffer(struct dri_context *ctx,
}
}
+/**
+ * The struct dri_drawable flush_swapbuffers callback
+ */
+static void
+dri2_flush_swapbuffers(struct dri_context *ctx,
+ struct dri_drawable *drawable)
+{
+ __DRIdrawable *dri_drawable = drawable->dPriv;
+ const __DRIimageLoaderExtension *image = drawable->sPriv->image.loader;
+
+ if (image && image->base.version >= 3 && image->flushSwapBuffers) {
+ image->flushSwapBuffers(dri_drawable, dri_drawable->loaderPrivate);
+ }
+}
+
static void
dri2_update_tex_buffer(struct dri_drawable *drawable,
struct dri_context *ctx,
@@ -2218,6 +2233,7 @@ dri2_create_buffer(__DRIscreen * sPriv,
drawable->allocate_textures = dri2_allocate_textures;
drawable->flush_frontbuffer = dri2_flush_frontbuffer;
drawable->update_tex_buffer = dri2_update_tex_buffer;
+ drawable->flush_swapbuffers = dri2_flush_swapbuffers;
return TRUE;
}