xf86-video-intel: Branch 'modesetting' - src/i830_randr.c

Keith Packard keithp at kemper.freedesktop.org
Wed Dec 20 02:45:41 EET 2006


 src/i830_randr.c |   24 +++++++++++++++---------
 1 files changed, 15 insertions(+), 9 deletions(-)

New commits:
diff-tree 2ef4c5e8f6444aad192304e5a2f7a0c77bfb917d (from b00951a5c87ca8c596ee9cc73d96d598eec60751)
Author: Keith Packard <keithp at guitar.keithp.com>
Date:   Tue Dec 19 16:45:39 2006 -0800

    Re-initialize physical screen size only if -dpi was passed.
    
    Physical screen size from the config file or DDC will already
    be set correctly in the screen structure, unless it was computed from the
    virtual size using the -dpi command line option. Recompute physical size as
    we reset the screen size if the -dpi option was used.

diff --git a/src/i830_randr.c b/src/i830_randr.c
index 290cb10..0a10384 100644
--- a/src/i830_randr.c
+++ b/src/i830_randr.c
@@ -835,9 +835,10 @@ xf86RandR12CreateScreenResources12 (Scre
     XF86RandRInfoPtr	randrp = XF86RANDRINFO(pScreen);
     int			c;
     int			width, height;
+    int			mmWidth, mmHeight;
 
     /*
-     * Compute width of screen
+     * Compute size of screen
      */
     width = 0; height = 0;
     for (c = 0; c < config->num_crtc; c++)
@@ -854,14 +855,19 @@ xf86RandR12CreateScreenResources12 (Scre
     
     if (width && height)
     {
-	int mmWidth, mmHeight;
-
-	mmWidth = pScreen->mmWidth;
-	mmHeight = pScreen->mmHeight;
-	if (width != pScreen->width)
-	    mmWidth = mmWidth * width / pScreen->width;
-	if (height != pScreen->height)
-	    mmHeight = mmHeight * height / pScreen->height;
+	/*
+	 * Compute physical size of screen
+	 */
+	if (monitorResolution) 
+	{
+	    mmWidth = width * 25.4 / monitorResolution;
+	    mmHeight = height * 25.4 / monitorResolution;
+	}
+	else
+	{
+	    mmWidth = pScreen->mmWidth;
+	    mmHeight = pScreen->mmHeight;
+	}
 	xf86DrvMsg(pScrn->scrnIndex, X_INFO,
 		   "Setting screen physical size to %d x %d\n",
 		   mmWidth, mmHeight);



More information about the xorg-commit mailing list