summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTiago Vignatti <tiago.vignatti@nokia.com>2010-01-22 17:58:17 +0200
committerTiago Vignatti <tiago.vignatti@nokia.com>2010-06-03 11:55:05 +0300
commitcdcb575664d3d60b662c542e782de83a047165c9 (patch)
tree63c3d767398becb01cdc18875bb6d82ff610ca18
parent643cb6e87c10ab554c03ada81930001a8ebcc909 (diff)
DRI2: add AuthMagic hook for driver side support
With this new hook, drmAuthMagic becomes useless and should be deprecated. You might want to implement AuthMagic on driver side instead. Signed-off-by: Tiago Vignatti <tiago.vignatti@nokia.com> Signed-off-by: Pauli Nieminen <ext-pauli.nieminen@nokia.com> Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
-rw-r--r--hw/xfree86/dri2/dri2.c13
-rw-r--r--hw/xfree86/dri2/dri2.h8
2 files changed, 18 insertions, 3 deletions
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 29c917f21..03255a25d 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -96,2 +96,3 @@ typedef struct _DRI2Screen {
DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC;
+ DRI2AuthMagicProcPtr AuthMagic;
@@ -970,4 +971,4 @@ DRI2Authenticate(ScreenPtr pScreen, drm_magic_t magic)
- if (ds == NULL || drmAuthMagic(ds->fd, magic))
- return FALSE;
+ if (ds == NULL || (*ds->AuthMagic)(ds->fd, magic))
+ return FALSE;
@@ -1042,2 +1043,10 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info)
+ if (info->version >= 5) {
+ ds->AuthMagic = info->AuthMagic;
+ }
+
+ if (!ds->AuthMagic)
+ ds->AuthMagic = drmAuthMagic;
+
+
/* Initialize minor if needed and set to minimum provied by DDX */
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index be44bdd75..29b1d9b2e 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -68,2 +68,4 @@ typedef void (*DRI2WaitProcPtr)(WindowPtr pWin,
unsigned int sequence);
+typedef int (*DRI2AuthMagicProcPtr)(int fd, uint32_t magic);
+
/**
@@ -161,3 +163,3 @@ typedef void (*DRI2InvalidateProcPtr)(DrawablePtr pDraw,
*/
-#define DRI2INFOREC_VERSION 4
+#define DRI2INFOREC_VERSION 5
@@ -185,2 +187,6 @@ typedef struct {
const char * const *driverNames;
+
+ /* added in version 5 */
+
+ DRI2AuthMagicProcPtr AuthMagic;
} DRI2InfoRec, *DRI2InfoPtr;