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);