summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/common/xf86DGA.c15
-rw-r--r--hw/xfree86/dixmods/extmod/dgaproc.h1
-rw-r--r--hw/xfree86/modes/xf86DiDGA.c2
-rw-r--r--hw/xfree86/vgahw/vgaCmap.c2
4 files changed, 15 insertions, 5 deletions
diff --git a/hw/xfree86/common/xf86DGA.c b/hw/xfree86/common/xf86DGA.c
index 64163721f..61612c32f 100644
--- a/hw/xfree86/common/xf86DGA.c
+++ b/hw/xfree86/common/xf86DGA.c
@@ -521,18 +521,27 @@ DGAChangePixmapMode(int index, int *x, int *y, int mode)
}
Bool
-DGAAvailable(int index)
+DGAScreenAvailable(ScreenPtr pScreen)
{
if (!DGAScreenKeyRegistered)
return FALSE;
- if (DGA_GET_SCREEN_PRIV(screenInfo.screens[index]))
+ if (DGA_GET_SCREEN_PRIV(pScreen))
return TRUE;
-
return FALSE;
}
Bool
+DGAAvailable(int index)
+{
+ ScreenPtr pScreen;
+
+ assert(index < MAXSCREENS);
+ pScreen = screenInfo.screens[index];
+ return DGAScreenAvailable(pScreen);
+}
+
+Bool
DGAActive(int index)
{
DGAScreenPtr pScreenPriv;
diff --git a/hw/xfree86/dixmods/extmod/dgaproc.h b/hw/xfree86/dixmods/extmod/dgaproc.h
index b4e0ddfea..2c2fae097 100644
--- a/hw/xfree86/dixmods/extmod/dgaproc.h
+++ b/hw/xfree86/dixmods/extmod/dgaproc.h
@@ -64,6 +64,7 @@ extern _X_EXPORT void
DGASelectInput(int Index, ClientPtr client, long mask);
extern _X_EXPORT Bool DGAAvailable(int Index);
+extern _X_EXPORT Bool DGAScreenAvailable(ScreenPtr pScreen);
extern _X_EXPORT Bool DGAActive(int Index);
extern _X_EXPORT void DGAShutdown(void);
extern _X_EXPORT void DGAInstallCmap(ColormapPtr cmap);
diff --git a/hw/xfree86/modes/xf86DiDGA.c b/hw/xfree86/modes/xf86DiDGA.c
index bb954ac4b..3f1a3309f 100644
--- a/hw/xfree86/modes/xf86DiDGA.c
+++ b/hw/xfree86/modes/xf86DiDGA.c
@@ -178,7 +178,7 @@ _xf86_di_dga_reinit_internal(ScreenPtr pScreen)
ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
- if (!DGAAvailable(pScreen->myNum))
+ if (!DGAScreenAvailable(pScreen))
return TRUE;
if (!xf86_dga_get_modes(pScreen))
diff --git a/hw/xfree86/vgahw/vgaCmap.c b/hw/xfree86/vgahw/vgaCmap.c
index a1aa405a8..e7a0d023e 100644
--- a/hw/xfree86/vgahw/vgaCmap.c
+++ b/hw/xfree86/vgahw/vgaCmap.c
@@ -97,7 +97,7 @@ xColorItem *pdefs;
}
writeColormap = scrninfp->vtSema;
- if (DGAAvailable(scrnIndex)) {
+ if (DGAScreenAvailable(pmap->pScreen)) {
writeColormap = writeColormap ||
(DGAGetDirectMode(scrnIndex) &&
!(DGAGetFlags(scrnIndex) & XF86DGADirectColormap)) ||