diff options
author | Jon Turney <jon.turney@dronecode.org.uk> | 2018-03-08 14:25:54 +0000 |
---|---|---|
committer | Jon Turney <jon.turney@dronecode.org.uk> | 2018-03-12 15:11:42 +0000 |
commit | eb51b0ffd1698506c9bccdb11936157710d81e74 (patch) | |
tree | d580ca3dc43fc0742df44cb6acd86d78304122f6 | |
parent | e9fef5a369801039d015734c1352b8418a84dd6c (diff) |
hw/xwin: Improve data returned for RANDR queriescygwin-patches-for-1.19
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
-rw-r--r-- | hw/xwin/winrandr.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c index 1bd97f963..46f0cf417 100644 --- a/hw/xwin/winrandr.c +++ b/hw/xwin/winrandr.c @@ -278,6 +278,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; + } + } } /* |