[Mesa-dev] [PATCH 2/3] dri_interface: add an interface for setting damage region

Harish Krupo harish.krupo.kps at intel.com
Wed Jul 4 12:52:59 UTC 2018


Implementors of this interface provide ability to render only
to damaged regions on the framebuffer.

Signed-off-by: Harish Krupo <harish.krupo.kps at intel.com>
---
 include/GL/internal/dri_interface.h | 25 +++++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index c32cdd3767..c4da3fd18a 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -83,6 +83,7 @@ typedef struct __DRI2throttleExtensionRec	__DRI2throttleExtension;
 typedef struct __DRI2fenceExtensionRec          __DRI2fenceExtension;
 typedef struct __DRI2interopExtensionRec	__DRI2interopExtension;
 typedef struct __DRI2blobExtensionRec           __DRI2blobExtension;
+typedef struct __DRI2damageExtensionRec         __DRI2damageExtension;
 
 typedef struct __DRIimageLoaderExtensionRec     __DRIimageLoaderExtension;
 typedef struct __DRIimageDriverExtensionRec     __DRIimageDriverExtension;
@@ -460,6 +461,30 @@ struct __DRI2fenceExtensionRec {
    int (*get_fence_fd)(__DRIscreen *screen, void *fence);
 };
 
+/**
+ * Extension for damage rendering
+ */
+
+#define __DRI2_DAMAGE "DRI2_Damage"
+#define __DRI2_DAMAGE_VERSION 1
+
+struct __DRI2damageExtensionRec {
+   __DRIextension base;
+
+   /**
+    * Provides rectangles to the driver to restrict its rendering
+    * to those rectangles.
+    *
+    * \param ctx     the context where commands are flushed
+    * \param size    total elements in the array
+    * \param rects   the array of rectangles
+    *
+    * Calling this function with size: 0 and rects: NULL should reset the
+    * damage to the full surface.
+    */
+   GLboolean (*set_damage_region)(__DRIcontext *ctx, GLuint size, GLint *rects);
+
+};
 
 /**
  * Extension for API interop.
-- 
2.18.0



More information about the mesa-dev mailing list