hw/xwin: Improve data returned for RANDR queries

Set a linear gamma ramp.  This avoids the xrandr command always warning
'Failed to get size of gamma for output default'
(perhaps we should be using GDI GetDeviceGammaRamp(), if possible?)

Make CRTC report non-zero physical dimensions initially
This commit is contained in:
Jon Turney 2018-03-08 14:25:54 +00:00
parent 2549ab2065
commit ff6b771eee
1 changed files with 15 additions and 0 deletions

View File

@ -276,6 +276,21 @@ winRandRInit(ScreenPtr pScreen)
/* Set mode to current display size */
winRandRUpdateMode(pScreen, output);
/* Make up some physical dimensions */
output->mmWidth = (pScreen->width * 25.4)/monitorResolution;
output->mmHeight = (pScreen->height * 25.4)/monitorResolution;
/* Allocate and make up a (fixed, linear) gamma ramp */
{
int i;
RRCrtcGammaSetSize(crtc, 256);
for (i = 0; i < crtc->gammaSize; i++) {
crtc->gammaRed[i] = i << 8;
crtc->gammaBlue[i] = i << 8;
crtc->gammaGreen[i] = i << 8;
}
}
}
/*