xserver: Branch 'master' - 3 commits

Adam Jackson ajax at kemper.freedesktop.org
Mon Jun 30 13:10:34 PDT 2008


 hw/xfree86/ddc/edid.h           |    5 ++++-
 hw/xfree86/ddc/interpret_edid.c |   14 ++++++++++++++
 hw/xfree86/ddc/print_edid.c     |   28 +++++++++++++++++-----------
 hw/xfree86/ddc/xf86DDC.c        |   32 ++++++++++++++++----------------
 hw/xfree86/ddc/xf86DDC.h        |    2 +-
 hw/xfree86/loader/xf86sym.c     |    1 +
 hw/xfree86/modes/xf86Crtc.c     |    5 +++--
 7 files changed, 56 insertions(+), 31 deletions(-)

New commits:
commit bed12dd3df0129b7f28d0a42d470266bd3ae6b38
Author: Adam Jackson <ajax at redhat.com>
Date:   Sat Jun 21 16:07:54 2008 -0400

    Do EEDID in RANDR 1.2.

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index fd72053..5a71bcf 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -2625,15 +2625,16 @@ xf86OutputGetEDIDModes (xf86OutputPtr output)
     return xf86DDCGetModes(scrn->scrnIndex, edid_mon);
 }
 
+/* maybe we should care about DDC1?  meh. */
 _X_EXPORT xf86MonPtr
 xf86OutputGetEDID (xf86OutputPtr output, I2CBusPtr pDDCBus)
 {
     ScrnInfoPtr	scrn = output->scrn;
     xf86MonPtr mon;
 
-    mon = xf86DoEDID_DDC2 (scrn->scrnIndex, pDDCBus);
+    mon = xf86DoEEDID(scrn->scrnIndex, pDDCBus, TRUE);
     if (mon)
-        xf86DDCApplyQuirks (scrn->scrnIndex, mon);
+        xf86DDCApplyQuirks(scrn->scrnIndex, mon);
 
     return mon;
 }
commit 4fc18b5fc31aa287e807ee520dc9117296e3d306
Author: Adam Jackson <ajax at redhat.com>
Date:   Sat Jun 21 16:07:36 2008 -0400

    Hexdump the whole EDID block if extensions present.

diff --git a/hw/xfree86/ddc/print_edid.c b/hw/xfree86/ddc/print_edid.c
index f5442ad..5e89b40 100644
--- a/hw/xfree86/ddc/print_edid.c
+++ b/hw/xfree86/ddc/print_edid.c
@@ -462,22 +462,28 @@ print_number_sections(int scrnIndex, int num)
 xf86MonPtr
 xf86PrintEDID(xf86MonPtr m)
 {
-    CARD16 i, j;
+    CARD16 i, j, n;
     char buf[EDID_WIDTH * 2 + 1];
 
-    if (!(m)) return NULL;
+    if (!m) return NULL;
 
-    print_vendor(m->scrnIndex,&m->vendor);
-    print_version(m->scrnIndex,&m->ver);
-    print_display(m->scrnIndex,&m->features, &m->ver);
-    print_established_timings(m->scrnIndex,&m->timings1);
-    print_std_timings(m->scrnIndex,m->timings2);
-    print_detailed_monitor_section(m->scrnIndex,m->det_mon);
-    print_number_sections(m->scrnIndex,m->no_sections);
+    print_vendor(m->scrnIndex, &m->vendor);
+    print_version(m->scrnIndex, &m->ver);
+    print_display(m->scrnIndex, &m->features, &m->ver);
+    print_established_timings(m->scrnIndex, &m->timings1);
+    print_std_timings(m->scrnIndex, m->timings2);
+    print_detailed_monitor_section(m->scrnIndex, m->det_mon);
+    print_number_sections(m->scrnIndex, m->no_sections);
+
+    /* extension block section stuff */
 
     xf86DrvMsg(m->scrnIndex, X_INFO, "EDID (in hex):\n");
- 
-    for (i = 0; i < 128; i += j) {
+
+    n = 128;
+    if (m->flags & EDID_COMPLETE_RAWDATA)
+	n += m->no_sections * 128;
+
+    for (i = 0; i < n; i += j) {
 	for (j = 0; j < EDID_WIDTH; ++j) {
 	    sprintf(&buf[j * 2], "%02x", m->rawData[i + j]);
 	}
commit b4fbc31e109f1efe78613597f9a91d5363523493
Author: Adam Jackson <ajax at redhat.com>
Date:   Sat Jun 21 16:00:05 2008 -0400

    Actually fetch all blocks of EEDID if asked to.

diff --git a/hw/xfree86/ddc/edid.h b/hw/xfree86/ddc/edid.h
index a4e79da..45caf6e 100644
--- a/hw/xfree86/ddc/edid.h
+++ b/hw/xfree86/ddc/edid.h
@@ -531,6 +531,9 @@ struct detailed_monitor_section {
   } section;				/* max: 80 */
 };
 
+/* flags */
+#define EDID_COMPLETE_RAWDATA	0x1
+
 typedef struct {
   int scrnIndex;
   struct vendor vendor;
@@ -539,7 +542,7 @@ typedef struct {
   struct established_timings timings1;
   struct std_timings timings2[8];
   struct detailed_monitor_section det_mon[4];
-  void *vdif; /* unused */
+  unsigned long flags;
   int no_sections;
   Uchar *rawData;
 } xf86Monitor, *xf86MonPtr;
diff --git a/hw/xfree86/ddc/interpret_edid.c b/hw/xfree86/ddc/interpret_edid.c
index b319699..941fec2 100644
--- a/hw/xfree86/ddc/interpret_edid.c
+++ b/hw/xfree86/ddc/interpret_edid.c
@@ -118,6 +118,20 @@ xf86InterpretEDID(int scrnIndex, Uchar *block)
     return NULL;
 }
 
+xf86MonPtr
+xf86InterpretEEDID(int scrnIndex, Uchar *block)
+{
+    xf86MonPtr m;
+
+    m = xf86InterpretEDID(scrnIndex, block);
+    if (!m)
+	return NULL;
+
+    /* extension parse */
+
+    return m;
+}
+
 static void
 get_vendor_section(Uchar *c, struct vendor *r)
 {
diff --git a/hw/xfree86/ddc/xf86DDC.c b/hw/xfree86/ddc/xf86DDC.c
index 8dda35a..0d86776 100644
--- a/hw/xfree86/ddc/xf86DDC.c
+++ b/hw/xfree86/ddc/xf86DDC.c
@@ -197,21 +197,17 @@ DDC2Read(I2CDevPtr dev, int block, unsigned char *R_Buffer)
  * Attempts to probe the monitor for EDID information, if NoDDC and NoDDC2 are
  * unset.  EDID information blocks are interpreted and the results returned in
  * an xf86MonPtr.  Unlike xf86DoEDID_DDC[12](), this function will return
- * the complete EDID data, including all extension blocks.
+ * the complete EDID data, including all extension blocks, if the 'complete'
+ * parameter is TRUE;
  *
  * This function does not affect the list of modes used by drivers -- it is up
  * to the driver to decide policy on what to do with EDID information.
  *
  * @return pointer to a new xf86MonPtr containing the EDID information.
  * @return NULL if no monitor attached or failure to interpret the EDID.
- *
- * nblocks is an in/out parameter.  If non-zero, it defines the number of
- * blocks to read from the monitor; zero (or NULL pointer) means read all.
- * If non-NULL, on return it will be filled in with the number of blocks
- * read.
  */
 xf86MonPtr
-xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, int *nblocks)
+xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool complete)
 {
     ScrnInfoPtr pScrn = xf86Screens[scrnIndex];
     unsigned char *EDID_block = NULL;
@@ -242,16 +238,21 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, int *nblocks)
 	return NULL;
 
     if (DDC2Read(dev, 0, EDID_block)) {
-	tmp = xf86InterpretEDID(scrnIndex, EDID_block);
-    }
+	int i, n = EDID_block[0x7e];
+
+	if (complete && n) {
+	    EDID_block = xrealloc(EDID_block, EDID1_LEN * (1+n));
 
-    if (nblocks) {
-	if (tmp)
-	    *nblocks = tmp->no_sections;
-	else
-	    *nblocks = 0;
+	    for (i = 0; i < n; i++)
+		DDC2Read(dev, i+1, EDID_block + (EDID1_LEN * (1+i)));
+	}
+
+	tmp = xf86InterpretEEDID(scrnIndex, EDID_block);
     }
 
+    if (tmp && complete)
+	tmp->flags |= EDID_COMPLETE_RAWDATA;
+
     return tmp;
 }
 
@@ -269,8 +270,7 @@ xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, int *nblocks)
 xf86MonPtr
 xf86DoEDID_DDC2(int scrnIndex, I2CBusPtr pBus)
 {
-    int nblocks = 1;
-    return xf86DoEEDID(scrnIndex, pBus, &nblocks);
+    return xf86DoEEDID(scrnIndex, pBus, FALSE);
 }
 
 /* 
diff --git a/hw/xfree86/ddc/xf86DDC.h b/hw/xfree86/ddc/xf86DDC.h
index 6e5bf6f..8e1eaac 100644
--- a/hw/xfree86/ddc/xf86DDC.h
+++ b/hw/xfree86/ddc/xf86DDC.h
@@ -35,7 +35,7 @@ extern xf86MonPtr xf86DoEDID_DDC2(
    I2CBusPtr pBus
 );
 
-extern xf86MonPtr xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, int *nblocks);
+extern xf86MonPtr xf86DoEEDID(int scrnIndex, I2CBusPtr pBus, Bool);
 
 extern xf86MonPtr xf86PrintEDID(
     xf86MonPtr monPtr
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index 91ca4f7..6576fe8 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -1007,6 +1007,7 @@ _X_HIDDEN void *xfree86LookupTab[] = {
     SYMFUNC(xf86DoEDID_DDC2)
     SYMFUNC(xf86InterpretEDID)
     SYMFUNC(xf86PrintEDID)
+    SYMFUNC(xf86DoEEDID)
     SYMFUNC(xf86DDCMonitorSet)
     SYMFUNC(xf86SetDDCproperties)
 


More information about the xorg-commit mailing list