randr12: Initialize and keep track of updates to VidMode extension gamma value.
This way clients querying the gamma value via the VidMode extension at least get the last value set via the same, rather than always something bogus. Signed-off-by: Michel Dänzer <daenzer@vmware.com>
This commit is contained in:
parent
fc3ce861cd
commit
2c1190f888
@ -919,11 +919,6 @@ Bool
|
|||||||
xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma)
|
xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma)
|
||||||
{
|
{
|
||||||
MessageType from = X_DEFAULT;
|
MessageType from = X_DEFAULT;
|
||||||
/* Pretend we succeeded if we support better a gamma system.
|
|
||||||
* This avoids a confusing message.
|
|
||||||
*/
|
|
||||||
if (xf86_crtc_supports_gamma(scrp))
|
|
||||||
return TRUE;
|
|
||||||
#if 0
|
#if 0
|
||||||
xf86MonPtr DDC = (xf86MonPtr)(scrp->monitor->DDC);
|
xf86MonPtr DDC = (xf86MonPtr)(scrp->monitor->DDC);
|
||||||
#endif
|
#endif
|
||||||
@ -955,6 +950,11 @@ xf86SetGamma(ScrnInfoPtr scrp, Gamma gamma)
|
|||||||
scrp->gamma.green = 1.0;
|
scrp->gamma.green = 1.0;
|
||||||
scrp->gamma.blue = 1.0;
|
scrp->gamma.blue = 1.0;
|
||||||
}
|
}
|
||||||
|
/* Pretend we succeeded if we support better a gamma system.
|
||||||
|
* This avoids a confusing message.
|
||||||
|
*/
|
||||||
|
if (xf86_crtc_supports_gamma(scrp))
|
||||||
|
return TRUE;
|
||||||
xf86DrvMsg(scrp->scrnIndex, from,
|
xf86DrvMsg(scrp->scrnIndex, from,
|
||||||
"Using gamma correction (%.1f, %.1f, %.1f)\n",
|
"Using gamma correction (%.1f, %.1f, %.1f)\n",
|
||||||
scrp->gamma.red, scrp->gamma.green, scrp->gamma.blue);
|
scrp->gamma.red, scrp->gamma.green, scrp->gamma.blue);
|
||||||
|
@ -1740,6 +1740,8 @@ xf86RandR12ChangeGamma(int scrnIndex, Gamma gamma)
|
|||||||
|
|
||||||
xfree(points);
|
xfree(points);
|
||||||
|
|
||||||
|
pScrn->gamma = gamma;
|
||||||
|
|
||||||
return Success;
|
return Success;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user