[Openchrome-devel] xf86-video-openchrome: 7 commits - configure.ac src/via_display.c src/via_outputs.c src/via_vt1632.c src/via_vt1632.h

Kevin Brace kevinbrace at kemper.freedesktop.org
Sat Jul 2 10:20:44 UTC 2016


 configure.ac      |    2 +-
 src/via_display.c |   18 ++++++++++++++++++
 src/via_outputs.c |   27 ++++++++++++++++++---------
 src/via_vt1632.c  |   26 +++++++++++++++-----------
 src/via_vt1632.h  |    6 +++---
 5 files changed, 55 insertions(+), 24 deletions(-)

New commits:
commit 0d7ebfe40617adba1f8564c476007c975b9f0087
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sat Jul 2 05:16:31 2016 -0500

    Version bumped to 0.4.906 (Version 0.5 RC7)
    
    This seventh release candidate has many substantial VT1632A TMDS (DVI)
    transmitter related improvements.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/configure.ac b/configure.ac
index 1b4f1f6..8097793 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-openchrome],
-        [0.4.905],
+        [0.4.906],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
         [xf86-video-openchrome])
 
commit 60c76462b4f0f7cd515677310aa5c03f398d70a7
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sat Jul 2 05:15:03 2016 -0500

    Using DVI presence and the assigned I2C bus to obtain EDID
    
    Since VT1632A has hardware support to sense DVI presence, this,
    along with the assigned I2C bus, should be used to obtain EDID
    from the monitor.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_outputs.c b/src/via_outputs.c
index 63cf6e2..c180d48 100644
--- a/src/via_outputs.c
+++ b/src/via_outputs.c
@@ -929,7 +929,30 @@ via_dvi_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 static xf86OutputStatus
 via_dvi_detect(xf86OutputPtr output)
 {
-    return via_vt1632_detect(output);
+    xf86OutputStatus status = XF86OutputStatusDisconnected;
+    ScrnInfoPtr pScrn = output->scrn;
+    VIAPtr pVia = VIAPTR(pScrn);
+    ViaVT1632Ptr Private = output->driver_private;
+    xf86MonPtr mon;
+
+    /* Check for the DVI presence via VT1632A first before accessing
+     * I2C bus. */
+    status = via_vt1632_detect(output);
+    if (status == XF86OutputStatusConnected) {
+
+        /* Since DVI presence was established, access the I2C bus
+         * assigned to DVI. */
+        mon = xf86OutputGetEDID(output, Private->VT1632I2CDev->pI2CBus);
+
+        /* Is the interface type digital? */
+        if (mon && DIGITAL(mon->features.input_type)) {
+            xf86OutputSetEDID(output, mon);
+        } else {
+            status = XF86OutputStatusDisconnected;
+        }
+    }
+
+    return status;
 }
 
 static void
@@ -963,7 +986,7 @@ via_dvi_init(ScrnInfoPtr pScrn)
 {
     VIAPtr pVia = VIAPTR(pScrn);
     xf86OutputPtr output = NULL;
-    struct ViaVT1632PrivateData *private_data = NULL;
+    ViaVT1632Ptr private_data = NULL;
     I2CBusPtr pBus = NULL;
     I2CDevPtr pDev = NULL;
     I2CSlaveAddr addr = 0x10;
diff --git a/src/via_vt1632.c b/src/via_vt1632.c
index a278fd4..3cc6c83 100644
--- a/src/via_vt1632.c
+++ b/src/via_vt1632.c
@@ -67,7 +67,7 @@ via_vt1632_dump_registers(ScrnInfoPtr pScrn, I2CDevPtr pDev)
 void
 via_vt1632_power(xf86OutputPtr output, Bool powerState)
 {
-    struct ViaVT1632PrivateData * Private = output->driver_private;
+    ViaVT1632Ptr Private = output->driver_private;
     ScrnInfoPtr pScrn = output->scrn;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -85,7 +85,7 @@ via_vt1632_power(xf86OutputPtr output, Bool powerState)
 void
 via_vt1632_save(xf86OutputPtr output)
 {
-    struct ViaVT1632PrivateData * Private = output->driver_private;
+    ViaVT1632Ptr Private = output->driver_private;
     ScrnInfoPtr pScrn = output->scrn;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -106,7 +106,7 @@ via_vt1632_save(xf86OutputPtr output)
 void
 via_vt1632_restore(xf86OutputPtr output)
 {
-    struct ViaVT1632PrivateData * Private = output->driver_private;
+    ViaVT1632Ptr Private = output->driver_private;
     ScrnInfoPtr pScrn = output->scrn;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -127,7 +127,7 @@ via_vt1632_restore(xf86OutputPtr output)
 int
 via_vt1632_mode_valid(xf86OutputPtr output, DisplayModePtr pMode)
 {
-    struct ViaVT1632PrivateData * Private = output->driver_private;
+    ViaVT1632Ptr Private = output->driver_private;
     ScrnInfoPtr pScrn = output->scrn;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, 
@@ -154,7 +154,7 @@ void
 via_vt1632_mode_set(xf86OutputPtr output, DisplayModePtr mode,
                     DisplayModePtr adjusted_mode)
 {
-    struct ViaVT1632PrivateData * Private = output->driver_private;
+    ViaVT1632Ptr Private = output->driver_private;
     ScrnInfoPtr pScrn = output->scrn;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, 
@@ -200,7 +200,7 @@ via_vt1632_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 xf86OutputStatus
 via_vt1632_detect(xf86OutputPtr output)
 {
-    struct ViaVT1632PrivateData * Private = output->driver_private;
+    ViaVT1632Ptr Private = output->driver_private;
     xf86OutputStatus status;
     ScrnInfoPtr pScrn = output->scrn;
     CARD8 tmp;
@@ -262,17 +262,17 @@ via_vt1632_probe(ScrnInfoPtr pScrn, I2CDevPtr pDev) {
     return TRUE;
 }
 
-struct ViaVT1632PrivateData *
+ViaVT1632Ptr
 via_vt1632_init(ScrnInfoPtr pScrn, I2CDevPtr pDev)
 {
     VIAPtr pVia = VIAPTR(pScrn);
-    struct ViaVT1632PrivateData * Private = NULL;
+    ViaVT1632Ptr Private = NULL;
     CARD8 buf = 0;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered via_vt1632_init.\n"));
 
-    Private = xnfcalloc(1, sizeof(struct ViaVT1632PrivateData));
+    Private = xnfcalloc(1, sizeof(ViaVT1632Rec));
     if (!Private) {
         xf86DrvMsg(pScrn->scrnIndex, X_ERROR,
                     "Failed to allocate memory for DVI initialization.\n");
diff --git a/src/via_vt1632.h b/src/via_vt1632.h
index fa28dce..13f2c05 100644
--- a/src/via_vt1632.h
+++ b/src/via_vt1632.h
@@ -31,7 +31,7 @@
 #define VIA_VT1632_EDGE 0x02
 #define VIA_VT1632_PDB  0x01
 
-struct ViaVT1632PrivateData {
+typedef struct _ViaVT1632 {
 	I2CDevPtr VT1632I2CDev;
 
 	int DotclockMin;
@@ -40,7 +40,7 @@ struct ViaVT1632PrivateData {
 	CARD8 Register09;
 	CARD8 Register0A;
 	CARD8 Register0C;
-};
+} ViaVT1632Rec, *ViaVT1632Ptr;
 
 void via_vt1632_power(xf86OutputPtr output, Bool powerState);
 void via_vt1632_save(xf86OutputPtr output);
@@ -49,6 +49,6 @@ int via_vt1632_mode_valid(xf86OutputPtr output, DisplayModePtr pMode);
 void via_vt1632_mode_set(xf86OutputPtr output, DisplayModePtr mode, DisplayModePtr adjusted_mode);
 xf86OutputStatus via_vt1632_detect(xf86OutputPtr output);
 BOOL via_vt1632_probe(ScrnInfoPtr pScrn, I2CDevPtr pDev);
-struct ViaVT1632PrivateData * via_vt1632_init(ScrnInfoPtr pScrn, I2CDevPtr pDev);
+ViaVT1632Ptr via_vt1632_init(ScrnInfoPtr pScrn, I2CDevPtr pDev);
 
 #endif /* _VIA_VT1632_H_ */
commit 609ee95feeaf8d2a37536dab7fa020520c2b842b
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sat Jul 2 02:37:01 2016 -0500

    Record a log message if VT1632A did not detect DVI presence
    
    Just to make it easier to understand, if VT1632A did not detect DVI
    presence, it will record it in the log message.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_vt1632.c b/src/via_vt1632.c
index bed5c6e..a278fd4 100644
--- a/src/via_vt1632.c
+++ b/src/via_vt1632.c
@@ -201,7 +201,7 @@ xf86OutputStatus
 via_vt1632_detect(xf86OutputPtr output)
 {
     struct ViaVT1632PrivateData * Private = output->driver_private;
-    xf86OutputStatus status = XF86OutputStatusDisconnected;
+    xf86OutputStatus status;
     ScrnInfoPtr pScrn = output->scrn;
     CARD8 tmp;
 
@@ -213,6 +213,10 @@ via_vt1632_detect(xf86OutputPtr output)
         xf86DrvMsg(pScrn->scrnIndex, X_INFO, 
                     "VT1632A: DVI device is detected.\n");
         status = XF86OutputStatusConnected;
+    } else {
+        xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                    "VT1632A: DVI device was not detected.\n");
+        status = XF86OutputStatusDisconnected;
     }
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
commit fbad6a979c5946d2479fd354ec3111f47b0e056e
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sat Jul 2 02:03:42 2016 -0500

    Using VT1632A RSEN bit to detect presence, not HTPLG bit
    
    During testing, DVI detection failure in VT1632A was observed,
    and this was due to the code using HTPLG bit to determine DVI
    presence, not RSEN bit it should have been using.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_vt1632.c b/src/via_vt1632.c
index ff3e3e0..bed5c6e 100644
--- a/src/via_vt1632.c
+++ b/src/via_vt1632.c
@@ -209,7 +209,7 @@ via_vt1632_detect(xf86OutputPtr output)
                         "Entered via_vt1632_detect.\n"));
 
     xf86I2CReadByte(Private->VT1632I2CDev, 0x09, &tmp);
-    if (tmp & 0x02) {
+    if (tmp & 0x04) {
         xf86DrvMsg(pScrn->scrnIndex, X_INFO, 
                     "VT1632A: DVI device is detected.\n");
         status = XF86OutputStatusConnected;
commit 6c23391daeae6df66880d07b4e999535ce677ccf
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sat Jul 2 02:01:13 2016 -0500

    Using VT1632A to detect DVI presence, not I2C bus
    
    Since VT1632A contains the necessary hardware to detect DVI
    presence, it is a better way to detect DVI rather than relying on
    I2C bus EDID readout.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_outputs.c b/src/via_outputs.c
index fa8aa60..63cf6e2 100644
--- a/src/via_outputs.c
+++ b/src/via_outputs.c
@@ -929,19 +929,7 @@ via_dvi_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 static xf86OutputStatus
 via_dvi_detect(xf86OutputPtr output)
 {
-    xf86OutputStatus status = XF86OutputStatusDisconnected;
-    ScrnInfoPtr pScrn = output->scrn;
-    VIAPtr pVia = VIAPTR(pScrn);
-    xf86MonPtr mon;
-
-    mon = xf86OutputGetEDID(output, pVia->pI2CBus2);
-    if (mon && DIGITAL(mon->features.input_type)) {
-        xf86OutputSetEDID(output, mon);
-        status = XF86OutputStatusConnected;
-    } else {
-        status = via_vt1632_detect(output);
-    }
-    return status;
+    return via_vt1632_detect(output);
 }
 
 static void
commit 56ead733a7aeb0af75c36d8dec566c74dd2e5ece
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sat Jul 2 01:38:51 2016 -0500

    Fix for Wyse Vx0 DVI not working
    
    This temporary fix makes IGA2 to be the source of DVP0 (Digital
    Video Port 0). This fix is meant to get Wyse Vx0's DVI to work since
    its VT1632A TMDS (DVI) transmitter is connected to DVP0.
    
    Signed-off-by: Eric Kudzin <knoppix1337 at yahoo.com>
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_display.c b/src/via_display.c
index 71d89fb..eeb9e50 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -2000,6 +2000,24 @@ viaIGA2Init(ScrnInfoPtr pScrn)
      *             1: Enable */
     ViaCrtcMask(hwp, 0x79, 0x00, 0x01);
 
+    /* Set DVP0 (Digital Video Port 0) source to IGA2. */
+    /* 3X5.96[7]   - DVP0 ALPHA Enable
+     *               0: Disable
+     *               1: Enable
+     * 3X5.96[6]   - DVP0 VSYNC Polarity
+     *               0: Positive
+     *               1: Negative
+     * 3X5.96[5]   - DVP0 HSYNC Polarity
+     *               0: Positive
+     *               1: Negative
+     * 3X5.96[4]   - DVP0 Data Source Selection 0
+     *               0: Primary Display
+     *               1: Secondary Display
+     * 3X5.96[3]   - DVP0 Clock Polarity
+     * 3X5.96[2:0] - DVP0 Clock Adjust
+     *               Valid Value: 0 through 7 */
+    ViaCrtcMask(hwp, 0x96, 0x10, 0x10);
+
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Exiting viaIGA2Init.\n"));
 }
commit 0cde26be181175169116ff984a8d8609a2cbe7ca
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Jul 1 20:05:35 2016 -0500

    Not turning on and off VT1632A within via_dvi_mode_set
    
    Previously, via_dvi_mode_set callback function was turning off and
    then on during mode setting for VT1632A TMDS (DVI) transmitter.
    Turning the transmitter on and off should be handled by via_dvi_dpms
    callback function.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_outputs.c b/src/via_outputs.c
index 68ebb4e..fa8aa60 100644
--- a/src/via_outputs.c
+++ b/src/via_outputs.c
@@ -923,9 +923,7 @@ via_dvi_mode_set(xf86OutputPtr output, DisplayModePtr mode,
     ScrnInfoPtr pScrn = output->scrn;
     vgaHWPtr hwp = VGAHWPTR(pScrn);
 
-    via_vt1632_power(output, FALSE);
     via_vt1632_mode_set(output, mode, adjusted_mode);
-    via_vt1632_power(output, TRUE);
 }
 
 static xf86OutputStatus


More information about the Openchrome-devel mailing list