From 0a5504e59f90abecedd81a8435b88a60fe098f29 Mon Sep 17 00:00:00 2001 From: Keith Packard Date: Thu, 5 Oct 2006 09:11:29 -0700 Subject: [PATCH] Fix DPI at startup in RandR 1.2 code. Use requested monitor resolution to compute the appropriate screen size when resizing the screen during RandR initialization. --- src/i830_randr.c | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/i830_randr.c b/src/i830_randr.c index 3c594d8a..e4075f26 100644 --- a/src/i830_randr.c +++ b/src/i830_randr.c @@ -832,12 +832,25 @@ I830RandRCreateScreenResources12 (ScreenPtr pScreen) mode = pScrn->currentMode; if (mode) { + int mmWidth, mmHeight; + + if (mode->HDisplay == pScreen->width && + mode->VDisplay == pScreen->height) + { + mmWidth = pScrn->widthmm; + mmHeight = pScrn->heightmm; + } + else + { +#define MMPERINCH 25.4 + mmWidth = (double) mode->HDisplay / pScrn->xDpi * MMPERINCH; + mmHeight = (double) mode->VDisplay / pScrn->yDpi * MMPERINCH; + } I830RandRScreenSetSize (pScreen, mode->HDisplay, mode->VDisplay, - pScreen->mmWidth, - pScreen->mmHeight); - + mmWidth, + mmHeight); } for (i = 0; i < MAX_DISPLAY_PIPES; i++)