Mesa (master): Add dri2::{Allocate,Release}Buffer extension

Kristian Høgsberg krh at kemper.freedesktop.org
Mon Feb 7 14:10:22 UTC 2011


Module: Mesa
Branch: master
Commit: 1b8ef9416bf3a4d2d47fcf9935063af57da2975d
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=1b8ef9416bf3a4d2d47fcf9935063af57da2975d

Author: Benjamin Franzke <benjaminfranzke at googlemail.com>
Date:   Fri Feb  4 11:59:12 2011 +0100

Add dri2::{Allocate,Release}Buffer extension

---

 include/GL/internal/dri_interface.h    |    8 ++++++++
 src/mesa/drivers/dri/common/dri_util.c |   20 +++++++++++++++++++-
 src/mesa/drivers/dri/common/dri_util.h |    6 ++++++
 3 files changed, 33 insertions(+), 1 deletions(-)

diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
index 0351526..2fb729a 100644
--- a/include/GL/internal/dri_interface.h
+++ b/include/GL/internal/dri_interface.h
@@ -786,6 +786,14 @@ struct __DRIdri2ExtensionRec {
 					   const __DRIconfig *config,
 					   __DRIcontext *shared,
 					   void *data);
+
+   __DRIbuffer *(*allocateBuffer)(__DRIscreen *screen,
+				  unsigned int attachment,
+				  unsigned int format,
+				  int width,
+				  int height);
+   void (*releaseBuffer)(__DRIscreen *screen,
+			 __DRIbuffer *buffer);
 };
 
 
diff --git a/src/mesa/drivers/dri/common/dri_util.c b/src/mesa/drivers/dri/common/dri_util.c
index bf8cf6e..82638fa 100644
--- a/src/mesa/drivers/dri/common/dri_util.c
+++ b/src/mesa/drivers/dri/common/dri_util.c
@@ -481,6 +481,22 @@ dri2CreateNewDrawable(__DRIscreen *screen,
     return pdraw;
 }
 
+static __DRIbuffer *
+dri2AllocateBuffer(__DRIscreen *screen,
+		   unsigned int attachment, unsigned int format,
+		   int width, int height)
+{
+    return (*screen->DriverAPI.AllocateBuffer)(screen, attachment, format,
+					       width, height);
+}
+
+static void
+dri2ReleaseBuffer(__DRIscreen *screen, __DRIbuffer *buffer)
+{
+   (*screen->DriverAPI.ReleaseBuffer)(screen, buffer);
+}
+
+
 static int
 dri2ConfigQueryb(__DRIscreen *screen, const char *var, GLboolean *val)
 {
@@ -930,7 +946,9 @@ const __DRIdri2Extension driDRI2Extension = {
     dri2CreateNewDrawable,
     dri2CreateNewContext,
     dri2GetAPIMask,
-    dri2CreateNewContextForAPI
+    dri2CreateNewContextForAPI,
+    dri2AllocateBuffer,
+    dri2ReleaseBuffer
 };
 
 const __DRI2configQueryExtension dri2ConfigQueryExtension = {
diff --git a/src/mesa/drivers/dri/common/dri_util.h b/src/mesa/drivers/dri/common/dri_util.h
index ffffb99..3d3d5c9 100644
--- a/src/mesa/drivers/dri/common/dri_util.h
+++ b/src/mesa/drivers/dri/common/dri_util.h
@@ -223,6 +223,12 @@ struct __DriverAPIRec {
 
     /* DRI2 Entry point */
     const __DRIconfig **(*InitScreen2) (__DRIscreen * priv);
+
+    __DRIbuffer *(*AllocateBuffer) (__DRIscreen *screenPrivate,
+				    unsigned int attachment,
+				    unsigned int format,
+				    int width, int height);
+    void (*ReleaseBuffer) (__DRIscreen *screenPrivate, __DRIbuffer *buffer);
 };
 
 extern const struct __DriverAPIRec driDriverAPI;




More information about the mesa-commit mailing list