diff options
Diffstat (limited to 'hw/xwin/winrandr.c')
-rw-r--r-- | hw/xwin/winrandr.c | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/hw/xwin/winrandr.c b/hw/xwin/winrandr.c index 1c1047a45..46f0cf417 100644 --- a/hw/xwin/winrandr.c +++ b/hw/xwin/winrandr.c @@ -42,17 +42,17 @@ static Bool winRandRGetInfo(ScreenPtr pScreen, Rotation * pRotations) { - rrScrPrivPtr pRRScrPriv; - RROutputPtr output; - - pRRScrPriv = rrGetScrPriv(pScreen); - output = pRRScrPriv->outputs[0]; - winDebug("winRandRGetInfo ()\n"); /* Don't support rotations */ *pRotations = RR_Rotate_0; + return TRUE; +} + +static void +winRandRUpdateMode(ScreenPtr pScreen, RROutputPtr output) +{ /* Delete previous mode */ if (output->modes[0]) { @@ -83,8 +83,6 @@ winRandRGetInfo(ScreenPtr pScreen, Rotation * pRotations) mode = RRModeGet(&modeInfo, name); output->crtc->mode = mode; } - - return TRUE; } /* @@ -95,6 +93,7 @@ winDoRandRScreenSetSize(ScreenPtr pScreen, CARD16 width, CARD16 height, CARD32 mmWidth, CARD32 mmHeight) { + rrScrPrivPtr pRRScrPriv; winScreenPriv(pScreen); winScreenInfo *pScreenInfo = pScreenPriv->pScreenInfo; WindowPtr pRoot = pScreen->root; @@ -136,6 +135,10 @@ winDoRandRScreenSetSize(ScreenPtr pScreen, // and arrange for it to be repainted pScreen->PaintWindow(pRoot, &pRoot->borderClip, PW_BACKGROUND); + // Set mode to current display size + pRRScrPriv = rrGetScrPriv(pScreen); + winRandRUpdateMode(pScreen, pRRScrPriv->primaryOutput); + /* Indicate that a screen size change took place */ RRScreenSizeNotify(pScreen); } @@ -272,6 +275,24 @@ winRandRInit(ScreenPtr pScreen) /* Ensure we have space for exactly one mode */ output->modes = malloc(sizeof(RRModePtr)); output->modes[0] = NULL; + + /* 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; + } + } } /* |