xfree86: Remove useless back-pointer to pScrn from colormap code
Reviewed-by: Eric Anholt <eric@anholt.net> Signed-off-by: Adam Jackson <ajax@redhat.com>
This commit is contained in:
parent
ef22655311
commit
b56fcce761
|
@ -74,7 +74,6 @@ typedef struct _CMapLink {
|
||||||
} CMapLink, *CMapLinkPtr;
|
} CMapLink, *CMapLinkPtr;
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
ScrnInfoPtr pScrn;
|
|
||||||
CloseScreenProcPtr CloseScreen;
|
CloseScreenProcPtr CloseScreen;
|
||||||
CreateColormapProcPtr CreateColormap;
|
CreateColormapProcPtr CreateColormap;
|
||||||
DestroyColormapProcPtr DestroyColormap;
|
DestroyColormapProcPtr DestroyColormap;
|
||||||
|
@ -123,7 +122,7 @@ static int CMapSetDGAMode(ScrnInfoPtr, int, DGADevicePtr);
|
||||||
#endif
|
#endif
|
||||||
static int CMapChangeGamma(ScrnInfoPtr, Gamma);
|
static int CMapChangeGamma(ScrnInfoPtr, Gamma);
|
||||||
|
|
||||||
static void ComputeGamma(CMapScreenPtr);
|
static void ComputeGamma(ScrnInfoPtr, CMapScreenPtr);
|
||||||
static Bool CMapAllocateColormapPrivate(ColormapPtr);
|
static Bool CMapAllocateColormapPrivate(ColormapPtr);
|
||||||
static void CMapRefreshColors(ColormapPtr, int, int *);
|
static void CMapRefreshColors(ColormapPtr, int, int *);
|
||||||
static void CMapSetOverscan(ColormapPtr, int, int *);
|
static void CMapSetOverscan(ColormapPtr, int, int *);
|
||||||
|
@ -194,7 +193,6 @@ xf86HandleColormaps(ScreenPtr pScreen,
|
||||||
pScreen->InstallColormap = CMapInstallColormap;
|
pScreen->InstallColormap = CMapInstallColormap;
|
||||||
pScreen->StoreColors = CMapStoreColors;
|
pScreen->StoreColors = CMapStoreColors;
|
||||||
|
|
||||||
pScreenPriv->pScrn = pScrn;
|
|
||||||
pScrn->LoadPalette = loadPalette;
|
pScrn->LoadPalette = loadPalette;
|
||||||
pScrn->SetOverscan = setOverscan;
|
pScrn->SetOverscan = setOverscan;
|
||||||
pScreenPriv->maxColors = maxColors;
|
pScreenPriv->maxColors = maxColors;
|
||||||
|
@ -221,7 +219,7 @@ xf86HandleColormaps(ScreenPtr pScreen,
|
||||||
#endif
|
#endif
|
||||||
pScrn->ChangeGamma = CMapChangeGamma;
|
pScrn->ChangeGamma = CMapChangeGamma;
|
||||||
|
|
||||||
ComputeGamma(pScreenPriv);
|
ComputeGamma(pScrn, pScreenPriv);
|
||||||
|
|
||||||
/* get the default map */
|
/* get the default map */
|
||||||
dixLookupResourceByType((void **) &pDefMap, pScreen->defColormap,
|
dixLookupResourceByType((void **) &pDefMap, pScreen->defColormap,
|
||||||
|
@ -660,8 +658,7 @@ CMapRefreshColors(ColormapPtr pmap, int defs, int *indices)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (LOAD_PALETTE(pmap))
|
if (LOAD_PALETTE(pmap))
|
||||||
(*pScrn->LoadPalette) (pScreenPriv->pScrn, defs, indices,
|
(*pScrn->LoadPalette) (pScrn, defs, indices, colors, pmap->pVisual);
|
||||||
colors, pmap->pVisual);
|
|
||||||
|
|
||||||
if (pScrn->SetOverscan)
|
if (pScrn->SetOverscan)
|
||||||
CMapSetOverscan(pmap, defs, indices);
|
CMapSetOverscan(pmap, defs, indices);
|
||||||
|
@ -822,7 +819,7 @@ CMapSetOverscan(ColormapPtr pmap, int defs, int *indices)
|
||||||
#ifdef DEBUGOVERSCAN
|
#ifdef DEBUGOVERSCAN
|
||||||
ErrorF("SetOverscan() called from CmapSetOverscan\n");
|
ErrorF("SetOverscan() called from CmapSetOverscan\n");
|
||||||
#endif
|
#endif
|
||||||
pScrn->SetOverscan(pScreenPriv->pScrn, overscan);
|
pScrn->SetOverscan(pScrn, overscan);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -851,7 +848,7 @@ CMapUnwrapScreen(ScreenPtr pScreen)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
ComputeGamma(CMapScreenPtr priv)
|
ComputeGamma(ScrnInfoPtr pScrn, CMapScreenPtr priv)
|
||||||
{
|
{
|
||||||
int elements = priv->gammaElements - 1;
|
int elements = priv->gammaElements - 1;
|
||||||
double RedGamma, GreenGamma, BlueGamma;
|
double RedGamma, GreenGamma, BlueGamma;
|
||||||
|
@ -859,28 +856,25 @@ ComputeGamma(CMapScreenPtr priv)
|
||||||
|
|
||||||
#ifndef DONT_CHECK_GAMMA
|
#ifndef DONT_CHECK_GAMMA
|
||||||
/* This check is to catch drivers that are not initialising pScrn->gamma */
|
/* This check is to catch drivers that are not initialising pScrn->gamma */
|
||||||
if (priv->pScrn->gamma.red < GAMMA_MIN ||
|
if (pScrn->gamma.red < GAMMA_MIN || pScrn->gamma.red > GAMMA_MAX ||
|
||||||
priv->pScrn->gamma.red > GAMMA_MAX ||
|
pScrn->gamma.green < GAMMA_MIN || pScrn->gamma.green > GAMMA_MAX ||
|
||||||
priv->pScrn->gamma.green < GAMMA_MIN ||
|
pScrn->gamma.blue < GAMMA_MIN || pScrn->gamma.blue > GAMMA_MAX) {
|
||||||
priv->pScrn->gamma.green > GAMMA_MAX ||
|
|
||||||
priv->pScrn->gamma.blue < GAMMA_MIN ||
|
|
||||||
priv->pScrn->gamma.blue > GAMMA_MAX) {
|
|
||||||
|
|
||||||
xf86DrvMsgVerb(priv->pScrn->scrnIndex, X_WARNING, 0,
|
xf86DrvMsgVerb(pScrn->scrnIndex, X_WARNING, 0,
|
||||||
"The %s driver didn't call xf86SetGamma() to initialise\n"
|
"The %s driver didn't call xf86SetGamma() to initialise\n"
|
||||||
"\tthe gamma values.\n", priv->pScrn->driverName);
|
"\tthe gamma values.\n", pScrn->driverName);
|
||||||
xf86DrvMsgVerb(priv->pScrn->scrnIndex, X_WARNING, 0,
|
xf86DrvMsgVerb(pScrn->scrnIndex, X_WARNING, 0,
|
||||||
"PLEASE FIX THE `%s' DRIVER!\n",
|
"PLEASE FIX THE `%s' DRIVER!\n",
|
||||||
priv->pScrn->driverName);
|
pScrn->driverName);
|
||||||
priv->pScrn->gamma.red = 1.0;
|
pScrn->gamma.red = 1.0;
|
||||||
priv->pScrn->gamma.green = 1.0;
|
pScrn->gamma.green = 1.0;
|
||||||
priv->pScrn->gamma.blue = 1.0;
|
pScrn->gamma.blue = 1.0;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
RedGamma = 1.0 / (double) priv->pScrn->gamma.red;
|
RedGamma = 1.0 / (double) pScrn->gamma.red;
|
||||||
GreenGamma = 1.0 / (double) priv->pScrn->gamma.green;
|
GreenGamma = 1.0 / (double) pScrn->gamma.green;
|
||||||
BlueGamma = 1.0 / (double) priv->pScrn->gamma.blue;
|
BlueGamma = 1.0 / (double) pScrn->gamma.blue;
|
||||||
|
|
||||||
for (i = 0; i <= elements; i++) {
|
for (i = 0; i <= elements; i++) {
|
||||||
if (RedGamma == 1.0)
|
if (RedGamma == 1.0)
|
||||||
|
@ -933,7 +927,7 @@ CMapChangeGamma(ScrnInfoPtr pScrn, Gamma gamma)
|
||||||
pScrn->gamma.green = gamma.green;
|
pScrn->gamma.green = gamma.green;
|
||||||
pScrn->gamma.blue = gamma.blue;
|
pScrn->gamma.blue = gamma.blue;
|
||||||
|
|
||||||
ComputeGamma(pScreenPriv);
|
ComputeGamma(pScrn, pScreenPriv);
|
||||||
|
|
||||||
/* mark all colormaps on this screen */
|
/* mark all colormaps on this screen */
|
||||||
pLink = pScreenPriv->maps;
|
pLink = pScreenPriv->maps;
|
||||||
|
|
Loading…
Reference in New Issue