Commit 05d2472c authored by Dave Airlie's avatar Dave Airlie

xf86dga: handle DGAAvailable for gpu screens. (v2)

v2: Split out DGAAvailable into two interfaces, one for calls from protocol
decoding and one for internal usage, after discussion with ajax and keithp.
Reviewed-by: Keith Packard's avatarKeith Packard <keithp@keithp.com>
Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
parent 3cbc4c10
......@@ -521,17 +521,26 @@ 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)
{
......
......@@ -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);
......
......@@ -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))
......
......@@ -97,7 +97,7 @@ xColorItem *pdefs;
}
writeColormap = scrninfp->vtSema;
if (DGAAvailable(scrnIndex)) {
if (DGAScreenAvailable(pmap->pScreen)) {
writeColormap = writeColormap ||
(DGAGetDirectMode(scrnIndex) &&
!(DGAGetFlags(scrnIndex) & XF86DGADirectColormap)) ||
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment