From b3a7b229e1e1f212bdd185af5443311091824005 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Mon, 7 Jun 2010 21:49:43 -0700 Subject: [PATCH] Make DRI_SCREEN_PRIV just return NULL when DRI isn't initialized The code relied upon the previous devPrivate implementation which offered this convenience. Signed-off-by: Keith Packard --- hw/xfree86/dri/dristruct.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hw/xfree86/dri/dristruct.h b/hw/xfree86/dri/dristruct.h index fc929c2f9..a834bbff7 100644 --- a/hw/xfree86/dri/dristruct.h +++ b/hw/xfree86/dri/dristruct.h @@ -62,7 +62,8 @@ struct _DRIContextPrivRec }; #define DRI_SCREEN_PRIV(pScreen) ((DRIScreenPrivPtr) \ - dixLookupPrivate(&(pScreen)->devPrivates, DRIScreenPrivKey)) + (dixPrivateKeyRegistered(DRIScreenPrivKey) ? \ + dixLookupPrivate(&(pScreen)->devPrivates, DRIScreenPrivKey) : NULL)) #define DRI_SCREEN_PRIV_FROM_INDEX(screenIndex) ((DRIScreenPrivPtr) \ dixLookupPrivate(&screenInfo.screens[screenIndex]->devPrivates, \