summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@redhat.com>2008-03-11 00:35:31 -0400
committerKristian Høgsberg <krh@redhat.com>2008-03-11 00:56:16 -0400
commitbc504ffbba3dec2e3467bab8ba1ac25db6dd317e (patch)
tree8b39a0a300ce7dd63a221302c2d176b4ae772b45
parentb2657ec5981122e7cc0bda0d8802aec63cde9014 (diff)
DRI2: Add DRI2AuthConnection().
DRI2 uses the same authentication scheme as XF86DRI, so implement this entry point so DRI2 protocol code can access it.
-rw-r--r--hw/xfree86/dri2/dri2.c11
-rw-r--r--hw/xfree86/dri2/dri2.h2
2 files changed, 13 insertions, 0 deletions
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index d2664b1cb..d5273877e 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -342,6 +342,17 @@ DRI2Connect(ScreenPtr pScreen, int *fd, const char **driverName,
return TRUE;
}
+Bool
+DRI2AuthConnection(ScreenPtr pScreen, drm_magic_t magic)
+{
+ DRI2ScreenPtr ds = DRI2GetScreen(pScreen);
+
+ if (ds == NULL || drmAuthMagic(ds->fd, magic))
+ return FALSE;
+
+ return TRUE;
+}
+
unsigned int
DRI2GetPixmapHandle(PixmapPtr pPixmap, unsigned int *flags)
{
diff --git a/hw/xfree86/dri2/dri2.h b/hw/xfree86/dri2/dri2.h
index a31908508..126087a2f 100644
--- a/hw/xfree86/dri2/dri2.h
+++ b/hw/xfree86/dri2/dri2.h
@@ -58,6 +58,8 @@ Bool DRI2Connect(ScreenPtr pScreen,
const char **driverName,
unsigned int *sareaHandle);
+Bool DRI2AuthConnection(ScreenPtr pScreen, drm_magic_t magic);
+
unsigned int DRI2GetPixmapHandle(PixmapPtr pPixmap,
unsigned int *flags);