[Mesa-dev] [PATCH 1/4] dri: Add a flushSwapBuffers method to the image loader extension
Thomas Hellstrom
thellstrom at vmware.com
Wed Aug 2 12:23:53 UTC 2017
This method may be used by dri drivers to make sure all outstanding
buffer swaps have been flushed to hardware.
Also make sure we're allowed to bump the image loader extension version
without actually providing the getCapability method that was introduced
with the previous version.
Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
---
include/GL/internal/dri_interface.h | 16 +++++++++++++++-
src/gallium/state_trackers/dri/dri_screen.c | 3 ++-
2 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index 31f1eba..f676ac5 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -1747,7 +1747,7 @@ struct __DRIimageList {
};
#define __DRI_IMAGE_LOADER "DRI_IMAGE_LOADER"
-#define __DRI_IMAGE_LOADER_VERSION 2
+#define __DRI_IMAGE_LOADER_VERSION 3
struct __DRIimageLoaderExtensionRec {
__DRIextension base;
@@ -1791,6 +1791,20 @@ struct __DRIimageLoaderExtensionRec {
* \since 2
*/
unsigned (*getCapability)(void *loaderPrivate, enum dri_loader_cap cap);
+
+ /**
+ * Flush swap buffers
+ *
+ * Make sure any outstanding swap buffers have been submitted to the
+ * device.
+ *
+ * \param driDrawable Drawable whose swaps need to be flushed
+ * \param loaderPrivate Loader's private data that was previously passed
+ * into __DRIdri2ExtensionRec::createNewDrawable
+ *
+ * \since 3
+ */
+ void (*flushSwapBuffers)(__DRIdrawable *driDrawable, void *loaderPrivate);
};
/**
diff --git a/src/gallium/state_trackers/dri/dri_screen.c b/src/gallium/state_trackers/dri/dri_screen.c
index f888abd..60ea611 100644
--- a/src/gallium/state_trackers/dri/dri_screen.c
+++ b/src/gallium/state_trackers/dri/dri_screen.c
@@ -96,7 +96,8 @@ dri_loader_get_cap(struct dri_screen *screen, enum dri_loader_cap cap)
if (dri2_loader && dri2_loader->base.version >= 4)
return dri2_loader->getCapability(screen->sPriv->loaderPrivate, cap);
- if (image_loader && image_loader->base.version >= 2)
+ if (image_loader && image_loader->base.version >= 2 &&
+ image_loader->getCapability)
return image_loader->getCapability(screen->sPriv->loaderPrivate, cap);
return 0;
--
2.7.4
More information about the mesa-dev
mailing list