diff options
author | marha <marha@users.sourceforge.net> | 2012-06-21 08:09:37 +0200 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2012-06-21 08:09:37 +0200 |
commit | da6ea6d64418710cbf7e0639dfefd2d856d53f1a (patch) | |
tree | 23900712d7923a4e77aa095f68e7a955321ba538 /xorg-server/hw/xfree86/dri2/dri2.c | |
parent | 36237c651fab7aa9e65da9c33eb89a619827edff (diff) | |
download | vcxsrv-da6ea6d64418710cbf7e0639dfefd2d856d53f1a.tar.gz vcxsrv-da6ea6d64418710cbf7e0639dfefd2d856d53f1a.tar.bz2 vcxsrv-da6ea6d64418710cbf7e0639dfefd2d856d53f1a.zip |
mesa pixman xkeyboard-config xserver git update 21 Jun 2012
Diffstat (limited to 'xorg-server/hw/xfree86/dri2/dri2.c')
-rw-r--r-- | xorg-server/hw/xfree86/dri2/dri2.c | 35 |
1 files changed, 28 insertions, 7 deletions
diff --git a/xorg-server/hw/xfree86/dri2/dri2.c b/xorg-server/hw/xfree86/dri2/dri2.c index babf32f13..d0f17896d 100644 --- a/xorg-server/hw/xfree86/dri2/dri2.c +++ b/xorg-server/hw/xfree86/dri2/dri2.c @@ -104,7 +104,8 @@ typedef struct _DRI2Screen { DRI2ScheduleSwapProcPtr ScheduleSwap; DRI2GetMSCProcPtr GetMSC; DRI2ScheduleWaitMSCProcPtr ScheduleWaitMSC; - DRI2AuthMagicProcPtr AuthMagic; + DRI2AuthMagic2ProcPtr AuthMagic; + DRI2AuthMagicProcPtr LegacyAuthMagic; DRI2ReuseBufferNotifyProcPtr ReuseBufferNotify; DRI2SwapLimitValidateProcPtr SwapLimitValidate; DRI2GetParamProcPtr GetParam; @@ -1110,12 +1111,22 @@ DRI2Connect(ScreenPtr pScreen, unsigned int driverType, int *fd, return TRUE; } +static Bool +DRI2AuthMagic (ScreenPtr pScreen, uint32_t magic) +{ + DRI2ScreenPtr ds = DRI2GetScreen(pScreen); + if (ds == NULL || (*ds->LegacyAuthMagic) (ds->fd, magic)) + return FALSE; + + return TRUE; +} + Bool DRI2Authenticate(ScreenPtr pScreen, uint32_t magic) { DRI2ScreenPtr ds = DRI2GetScreen(pScreen); - if (ds == NULL || (*ds->AuthMagic) (ds->fd, magic)) + if (ds == NULL || (*ds->AuthMagic) (pScreen, magic)) return FALSE; return TRUE; @@ -1202,8 +1213,11 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) cur_minor = 1; } + if (info->version >= 8) { + ds->AuthMagic = info->AuthMagic2; + } if (info->version >= 5) { - ds->AuthMagic = info->AuthMagic; + ds->LegacyAuthMagic = info->AuthMagic; } if (info->version >= 6) { @@ -1218,14 +1232,21 @@ DRI2ScreenInit(ScreenPtr pScreen, DRI2InfoPtr info) /* * if the driver doesn't provide an AuthMagic function or the info struct - * version is too low, it relies on the old method (using libdrm) or fail + * version is too low, call through LegacyAuthMagic */ - if (!ds->AuthMagic) + if (!ds->AuthMagic) { + ds->AuthMagic = DRI2AuthMagic; + /* + * If the driver doesn't provide an AuthMagic function + * it relies on the old method (using libdrm) or fails + */ + if (!ds->LegacyAuthMagic) #ifdef WITH_LIBDRM - ds->AuthMagic = drmAuthMagic; + ds->LegacyAuthMagic = drmAuthMagic; #else - goto err_out; + goto err_out; #endif + } /* Initialize minor if needed and set to minimum provied by DDX */ if (!dri2_minor || dri2_minor > cur_minor) |