xserver: Branch 'master'

Keith Packard keithp at kemper.freedesktop.org
Tue Mar 6 09:37:10 EET 2007


 hw/xfree86/modes/xf86RandR12.c |   24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

New commits:
diff-tree bed76caa6caaea6a6598755b82a54425a9d9f73e (from 47f8361c3a64834587e54507653d8d5b258c2530)
Author: Keith Packard <keithp at guitar.keithp.com>
Date:   Mon Mar 5 23:36:00 2007 -0800

    Use EDID data to set screen physical size at server startup.
    
    Screen physical size is set to a random value before the RandR code gets
    control, override that and reset it to a value based on the compat_output
    physical size (if available). If that output has no physical size, just use
    96dpi as the default resolution and set the physical size as appropriate.
    (cherry picked from commit 843077f23a1b49bd712d931421753e3a09d4008c)

diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 052d12a..ce780b6 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -422,8 +422,28 @@ xf86RandR12CreateScreenResources (Screen
 	}
 	else
 	{
-	    mmWidth = pScreen->mmWidth;
-	    mmHeight = pScreen->mmHeight;
+	    xf86OutputPtr   output = config->output[config->compat_output];
+	    xf86CrtcPtr	    crtc = output->crtc;
+
+	    if (crtc && crtc->mode.HDisplay &&
+		output->mm_width && output->mm_height)
+	    {
+		/*
+		 * If the output has a mode and a declared size, use that
+		 * to scale the screen size
+		 */
+		DisplayModePtr	mode = &crtc->mode;
+		mmWidth = output->mm_width * width / mode->HDisplay;
+		mmHeight = output->mm_height * height / mode->VDisplay;
+	    }
+	    else
+	    {
+		/*
+		 * Otherwise, just set the screen to 96dpi
+		 */
+		mmWidth = width * 25.4 / 96;
+		mmHeight = height * 25.4 / 96;
+	    }
 	}
 	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 		   "Setting screen physical size to %d x %d\n",



More information about the xorg-commit mailing list