summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Romanick <idr@freedesktop.org>2009-04-06 12:44:18 -0700
committerIan Romanick <ian.d.romanick@intel.com>2009-04-09 14:44:17 -0700
commit98c2c9ef8c9da654fa3af95145c2f92b296bdb47 (patch)
tree940ee6b91e564e93fc10b4249561324474355c72
parentd805c82068feffda03266855a843de261a45865c (diff)
downloadmesa-98c2c9ef8c9da654fa3af95145c2f92b296bdb47.tar.gz
DRI2: Provide an interface for drivers to flush front-buffer rendering
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com> Reviewed-by: Kristian Høgsberg <krh@redhat.com> (cherry picked from commit 82634ee8df7328b9235abd8352d33b0b3d953600)
-rw-r--r--include/GL/internal/dri_interface.h15
-rw-r--r--src/glx/x11/dri2_glx.c10
2 files changed, 24 insertions, 1 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index 27cc1be7ff3..09ae940f697 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -636,7 +636,7 @@ struct __DRIbufferRec {
};
#define __DRI_DRI2_LOADER "DRI_DRI2Loader"
-#define __DRI_DRI2_LOADER_VERSION 1
+#define __DRI_DRI2_LOADER_VERSION 2
struct __DRIdri2LoaderExtensionRec {
__DRIextension base;
@@ -644,6 +644,19 @@ struct __DRIdri2LoaderExtensionRec {
int *width, int *height,
unsigned int *attachments, int count,
int *out_count, void *loaderPrivate);
+
+ /**
+ * Flush pending front-buffer rendering
+ *
+ * Any rendering that has been performed to the
+ * \c __DRI_BUFFER_FAKE_FRONT_LEFT will be flushed to the
+ * \c __DRI_BUFFER_FRONT_LEFT.
+ *
+ * \param driDrawable Drawable whose front-buffer is to be flushed
+ * \param loaderPrivate Loader's private data that was previously passed
+ * into __DRIdri2ExtensionRec::createNewDrawable
+ */
+ void (*flushFrontBuffer)(__DRIdrawable *driDrawable, void *loaderPrivate);
};
/**
diff --git a/src/glx/x11/dri2_glx.c b/src/glx/x11/dri2_glx.c
index 6a031d41851..5acb3dd0724 100644
--- a/src/glx/x11/dri2_glx.c
+++ b/src/glx/x11/dri2_glx.c
@@ -257,6 +257,15 @@ static void dri2WaitGL(__GLXDRIdrawable *pdraw)
XFixesDestroyRegion(pdraw->psc->dpy, region);
}
+
+static void dri2FlushFrontBuffer(__DRIdrawable *driDrawable,
+ void *loaderPrivate)
+{
+ (void) driDrawable;
+ dri2WaitGL((__GLXDRIdrawable *) loaderPrivate);
+}
+
+
static void dri2DestroyScreen(__GLXscreenConfigs *psc)
{
/* Free the direct rendering per screen data */
@@ -311,6 +320,7 @@ dri2GetBuffers(__DRIdrawable *driDrawable,
static const __DRIdri2LoaderExtension dri2LoaderExtension = {
{ __DRI_DRI2_LOADER, __DRI_DRI2_LOADER_VERSION },
dri2GetBuffers,
+ dri2FlushFrontBuffer
};
static const __DRIextension *loader_extensions[] = {