From ff6b771eeea763c19d057e8741a2cadb37db9b68 Mon Sep 17 00:00:00 2001 From: Jon Turney Date: Thu, 8 Mar 2018 14:25:54 +0000 Subject: [PATCH] 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 --- hw/xwin/winrandr.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c index 30b7c5f6b..038d63bde 100644 --- a/hw/xwin/winrandr.c +++ b/hw/xwin/winrandr.c @@ -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; + } + } } /*