xf86-video-intel: Branch 'modesetting' - 3 commits - src/i830_crt.c src/i830_driver.c src/i830.h src/i830_modes.c src/i830_randr.c src/i830_xf86Modes.c

Eric Anholt anholt at kemper.freedesktop.org
Wed Nov 1 23:39:16 EET 2006


 src/i830.h           |   21 ++++++++-------------
 src/i830_crt.c       |    1 +
 src/i830_driver.c    |    7 -------
 src/i830_modes.c     |   13 ++++++++++++-
 src/i830_randr.c     |    8 ++------
 src/i830_xf86Modes.c |    3 +--
 6 files changed, 24 insertions(+), 29 deletions(-)

New commits:
diff-tree ffbd6ca09bc2300bf967d7c248a559d85b8706e0 (from 97c3a1b2421031e41f0b2b1630fde1dc4262d264)
Author: Eric Anholt <eric at anholt.net>
Date:   Wed Nov 1 13:05:44 2006 -0800

    Remove dead VESARec struct.

diff --git a/src/i830.h b/src/i830.h
index eca9396..a07ba8e 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -106,18 +106,6 @@ typedef struct _I830OutputRec I830Output
 #define PIPE_DFP2	1<<6
 #define PIPE_LFP2	1<<7
 
-typedef struct _VESARec {
-   /* SVGA state */
-   pointer state, pstate;
-   int statePage, stateSize, stateMode, stateRefresh;
-   CARD32 *savedPal;
-   int savedScanlinePitch;
-   xf86MonPtr monitor;
-   /* display start */
-   int x, y;
-} VESARec, *VESAPtr;
-
-
 typedef struct _I830Rec *I830Ptr;
 
 typedef void (*I830WriteIndexedByteFunc)(I830Ptr pI830, IOADDRESS addr,
@@ -480,7 +468,6 @@ typedef struct _I830Rec {
 
    /* Video BIOS support. */
    vbeInfoPtr pVbe;
-   VESAPtr vesa;
 
    Bool swfSaved;
    CARD32 saveSWF0;
diff --git a/src/i830_driver.c b/src/i830_driver.c
index 7c15174..3612af7 100644
--- a/src/i830_driver.c
+++ b/src/i830_driver.c
@@ -352,7 +352,6 @@ I830GetRec(ScrnInfoPtr pScrn)
    if (pScrn->driverPrivate)
       return TRUE;
    pI830 = pScrn->driverPrivate = xnfcalloc(sizeof(I830Rec), 1);
-   pI830->vesa = xnfcalloc(sizeof(VESARec), 1);
    return TRUE;
 }
 
@@ -360,7 +359,6 @@ static void
 I830FreeRec(ScrnInfoPtr pScrn)
 {
    I830Ptr pI830;
-   VESAPtr pVesa;
 
    if (!pScrn)
       return;
@@ -374,11 +372,6 @@ I830FreeRec(ScrnInfoPtr pScrn)
          vbeFree(pI830->pVbe);
    }
 
-   pVesa = pI830->vesa;
-   if (pVesa->savedPal)
-      xfree(pVesa->savedPal);
-   xfree(pVesa);
-
    xfree(pScrn->driverPrivate);
    pScrn->driverPrivate = NULL;
 }
diff-tree 97c3a1b2421031e41f0b2b1630fde1dc4262d264 (from 7971c401554c218c84a8c45335c9b31bbccfece7)
Author: Eric Anholt <eric at anholt.net>
Date:   Wed Nov 1 13:04:08 2006 -0800

    Remove the refresh rate appended to some mode names.
    
    This gets the SDVO and CRT outputs I have to have at least 1 common mode
    according to RandR.

diff --git a/src/i830_xf86Modes.c b/src/i830_xf86Modes.c
index 8e8a94c..166f41a 100644
--- a/src/i830_xf86Modes.c
+++ b/src/i830_xf86Modes.c
@@ -100,8 +100,7 @@ i830xf86SetModeDefaultName(DisplayModePt
     if (mode->name != NULL)
 	xfree(mode->name);
 
-    mode->name = XNFprintf("%dx%dx%.0f", mode->HDisplay, mode->VDisplay,
-			   i830xf86ModeVRefresh(mode));
+    mode->name = XNFprintf("%dx%d", mode->HDisplay, mode->VDisplay);
 }
 
 /*
diff-tree 7971c401554c218c84a8c45335c9b31bbccfece7 (from fb94c1210966f7875e5f034f10ea31c06c502c3a)
Author: Eric Anholt <eric at anholt.net>
Date:   Wed Nov 1 12:42:56 2006 -0800

    Attempt to pull monitor physical size information out of DDC EDID data.

diff --git a/src/i830.h b/src/i830.h
index a4dc4ba..eca9396 100644
--- a/src/i830.h
+++ b/src/i830.h
@@ -272,6 +272,8 @@ struct _I830OutputRec {
    /**
     * Query the device for the modes it provides.
     *
+    * This function may also update MonInfo, mm_width, and mm_height.
+    *
     * \return singly-linked list of modes or NULL if no modes found.
     */
    DisplayModePtr (*get_modes)(ScrnInfoPtr pScrn, I830OutputPtr output);
@@ -283,7 +285,13 @@ struct _I830OutputRec {
     * compatible modes added later.
     */
    DisplayModePtr probed_modes;
+
+   /** EDID monitor information */
    xf86MonPtr MonInfo;
+
+   /** Physical size of the output currently attached. */
+   int mm_width, mm_height;
+
    I2CBusPtr pI2CBus;
    I2CBusPtr pDDCBus;
    struct _I830DVODriver *i2c_drv;
diff --git a/src/i830_crt.c b/src/i830_crt.c
index 407ebe3..0225727 100644
--- a/src/i830_crt.c
+++ b/src/i830_crt.c
@@ -32,6 +32,7 @@
 #include "xf86.h"
 #include "i830.h"
 #include "i830_xf86Modes.h"
+
 static void
 i830_crt_dpms(ScrnInfoPtr pScrn, I830OutputPtr output, int mode)
 {
diff --git a/src/i830_modes.c b/src/i830_modes.c
index d6866ad..0bb17a5 100644
--- a/src/i830_modes.c
+++ b/src/i830_modes.c
@@ -641,6 +641,7 @@ i830_ddc_get_modes(ScrnInfoPtr pScrn, I8
 {
     xf86MonPtr ddc_mon;
     DisplayModePtr ddc_modes, mode;
+    int i;
 
     ddc_mon = xf86DoEDID_DDC2(pScrn->scrnIndex, output->pDDCBus);
     if (ddc_mon == NULL)
@@ -666,7 +667,17 @@ i830_ddc_get_modes(ScrnInfoPtr pScrn, I8
     }
     i830xf86PruneInvalidModes(pScrn, &ddc_modes, TRUE);
 
-    xfree(ddc_mon);
+    /* Pull out a phyiscal size from a detailed timing if available. */
+    for (i = 0; i < 4; i++) {
+	if (ddc_mon->det_mon[i].type == DT &&
+	    ddc_mon->det_mon[i].section.d_timings.h_size != 0 &&
+	    ddc_mon->det_mon[i].section.d_timings.v_size != 0)
+	{
+	    output->mm_width = ddc_mon->det_mon[i].section.d_timings.h_size;
+	    output->mm_height = ddc_mon->det_mon[i].section.d_timings.v_size;
+	    break;
+	}
+    }
 
     return ddc_modes;
 }
diff --git a/src/i830_randr.c b/src/i830_randr.c
index 69063a8..59ebcc0 100644
--- a/src/i830_randr.c
+++ b/src/i830_randr.c
@@ -698,12 +698,8 @@ I830RandRSetInfo12 (ScreenPtr pScreen)
 	    return FALSE;
 
 	RROutputSetCrtc (randrp->outputs[i], crtc);
-
-	/* We should pull info out of EDID to get the output physical
-	 * size when available.
-	 */
-	RROutputSetPhysicalSize(randrp->outputs[i], 0, 0);
-
+	RROutputSetPhysicalSize(randrp->outputs[i], pI830->output[i].mm_width,
+				pI830->output[i].mm_height);
 	RROutputSetPossibleOptions (randrp->outputs[i], possibleOptions);
 	RROutputSetCurrentOptions (randrp->outputs[i], currentOptions);
         nmode = 0;



More information about the xorg-commit mailing list