summaryrefslogtreecommitdiff
path: root/src/glamo-dri2.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/glamo-dri2.c')
-rw-r--r--src/glamo-dri2.c43
1 files changed, 41 insertions, 2 deletions
diff --git a/src/glamo-dri2.c b/src/glamo-dri2.c
index 4186bfa..ae62ef4 100644
--- a/src/glamo-dri2.c
+++ b/src/glamo-dri2.c
@@ -57,8 +57,20 @@ typedef struct {
} GlamoDRI2BufferPrivateRec, *GlamoDRI2BufferPrivatePtr;
-static DRI2BufferPtr glamoCreateBuffers(DrawablePtr pDraw,
- unsigned int *attachments, int count)
+#ifdef USE_DRI2_1_1_0
+
+static DRI2BufferPtr glamoCreateBuffer(DrawablePtr pDraw,
+ unsigned int attachment,
+ unsigned int format)
+{
+ DRI2BufferPtr buffer;
+ return buffer;
+}
+
+#else
+
+static DRI2BufferPtr glamoCreateBuffer(DrawablePtr pDraw,
+ unsigned int *attachments, int count)
{
ScreenPtr pScreen = pDraw->pScreen;
DRI2BufferPtr buffers;
@@ -115,6 +127,26 @@ static DRI2BufferPtr glamoCreateBuffers(DrawablePtr pDraw,
return buffers;
}
+#endif
+
+#ifdef USE_DRI2_1_1_0
+
+static void glamoDestroyBuffer(DrawablePtr pDraw,
+ DRI2BufferPtr buffer)
+{
+ ScreenPtr pScreen = pDraw->pScreen;
+ int i;
+ GlamoDRI2BufferPrivatePtr private;
+
+ private = buffer.driverPrivate;
+ (*pScreen->DestroyPixmap)(private->pPixmap);
+
+ if ( buffer ) {
+ xfree(buffer.driverPrivate);
+ }
+}
+
+#else
static void glamoDestroyBuffers(DrawablePtr pDraw,
DRI2BufferPtr buffers, int count)
@@ -134,6 +166,8 @@ static void glamoDestroyBuffers(DrawablePtr pDraw,
}
}
+#endif
+
static void glamoCopyRegion(DrawablePtr pDraw, RegionPtr pRegion,
DRI2BufferPtr pDestBuffer, DRI2BufferPtr pSrcBuffer)
@@ -171,8 +205,13 @@ void driScreenInit(ScreenPtr pScreen)
dri2info.deviceName = p;
dri2info.driverName = "glamo";
+#ifdef USE_DRI2_1_1_0
+ dri2info.CreateBuffer = glamoCreateBuffer;
+ dri2info.DestroyBuffer = glamoDestroyBuffer;
+#else
dri2info.CreateBuffers = glamoCreateBuffers;
dri2info.DestroyBuffers = glamoDestroyBuffers;
+#endif
dri2info.CopyRegion = glamoCopyRegion;
if ( !DRI2ScreenInit(pScreen, &dri2info) ) return;