[Openchrome-devel] xf86-video-openchrome: 11 commits - configure.ac src/via_analog.c src/via_fp.c src/via_tmds.c src/via_ums.h

Kevin Brace kevinbrace at kemper.freedesktop.org
Tue Apr 11 00:36:02 UTC 2017


 configure.ac     |    2 -
 src/via_analog.c |    1 
 src/via_fp.c     |   16 ++++-----
 src/via_tmds.c   |   54 +++++++++++++++------------------
 src/via_ums.h    |   90 ++++++++++++++++++++++++++++++++++++-------------------
 5 files changed, 94 insertions(+), 69 deletions(-)

New commits:
commit 2d116b3128a949faa336c332875d96f184d20ca9
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Apr 10 17:35:16 2017 -0700

    Version bumped to 0.6.106
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/configure.ac b/configure.ac
index 15361e0..11f35c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-openchrome],
-        [0.6.105],
+        [0.6.106],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
         [xf86-video-openchrome])
 
commit e4378560c3eb6bf7923798e05b67e24a9dde18e8
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Apr 10 17:33:10 2017 -0700

    Improving TMDS transmitter initialization inside via_tmds_mode_set
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_tmds.c b/src/via_tmds.c
index b8c1baa..ff1e828 100644
--- a/src/via_tmds.c
+++ b/src/via_tmds.c
@@ -887,12 +887,13 @@ via_tmds_mode_set(xf86OutputPtr output, DisplayModePtr mode,
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered via_tmds_mode_set.\n"));
 
-    /* Initialize VIA IGP integrated TMDS transmitter registers. */
-    viaTMDSInitRegisters(pScrn);
+    if (output->crtc) {
+        /* Initialize VIA IGP integrated TMDS transmitter registers. */
+        viaTMDSInitRegisters(pScrn);
 
-    viaTMDSSyncPolarity(pScrn, adjusted_mode->Flags);
+        /* Set integrated TMDS transmitter sync polarity. */
+        viaTMDSSyncPolarity(pScrn, adjusted_mode->Flags);
 
-    if (output->crtc) {
         viaTMDSSetSource(pScrn, iga->index ? 0x01 : 0x00);
     }
 
commit fe61d3ee8052381b374f6b4e6e05bc5a51aea7cb
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Apr 10 17:26:37 2017 -0700

    Made changes to viaTMDSSyncPolarity
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_tmds.c b/src/via_tmds.c
index aa62479..b8c1baa 100644
--- a/src/via_tmds.c
+++ b/src/via_tmds.c
@@ -106,34 +106,28 @@ viaTMDSInitRegisters(ScrnInfoPtr pScrn)
  * synchronization.
  */
 static void
-viaTMDSSyncPolarity(ScrnInfoPtr pScrn, DisplayModePtr mode)
+viaTMDSSyncPolarity(ScrnInfoPtr pScrn, unsigned int flags)
 {
-    vgaHWPtr hwp = VGAHWPTR(pScrn);
-    CARD8 cr97;
+    CARD8 syncPolarity = 0x00;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered viaTMDSSyncPolarity.\n"));
 
-    /* 3X5.97[6] - DVI (TMDS) VSYNC Polarity
-     *             0: Positive
-     *             1: Negative
-     * 3X5.97[5] - DVI (TMDS) HSYNC Polarity
-     *             0: Positive
-     *             1: Negative */
-    cr97 = hwp->readCrtc(hwp, 0x97);
-    if (mode->Flags & V_NHSYNC) {
-        cr97 |= 0x20;
-    } else {
-        cr97 &= (~0x20);
+    if (flags & V_NHSYNC) {
+        syncPolarity |= BIT(0);
     }
 
-    if (mode->Flags & V_NVSYNC) {
-        cr97 |= 0x40;
-    } else {
-        cr97 &= (~0x40);
+    if (flags & V_NHSYNC) {
+        syncPolarity |= BIT(1);
     }
 
-    ViaCrtcMask(hwp, 0x97, cr97, 0x60);
+    viaTMDSSetSyncPolarity(pScrn, syncPolarity);
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                "TMDS (DVI) Horizontal Sync Polarity: %s\n",
+                (syncPolarity & BIT(0)) ? "-" : "+");
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                "TMDS (DVI) Vertical Sync Polarity: %s\n",
+                (syncPolarity & BIT(1)) ? "-" : "+");
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Exiting viaTMDSSyncPolarity.\n"));
@@ -896,9 +890,7 @@ via_tmds_mode_set(xf86OutputPtr output, DisplayModePtr mode,
     /* Initialize VIA IGP integrated TMDS transmitter registers. */
     viaTMDSInitRegisters(pScrn);
 
-    /* Set integrated TMDS transmitter synchronization polarity for
-     * both horizontal synchronization and vertical synchronization. */
-    viaTMDSSyncPolarity(pScrn, adjusted_mode);
+    viaTMDSSyncPolarity(pScrn, adjusted_mode->Flags);
 
     if (output->crtc) {
         viaTMDSSetSource(pScrn, iga->index ? 0x01 : 0x00);
commit a6326d620c39d39e496e65ffa91a9613a52baaf2
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Apr 10 16:25:39 2017 -0700

    Added viaTMDSSetSyncPolarity
    
    This inline function was added to via_ums.h.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_ums.h b/src/via_ums.h
index a340fb1..519c3eb 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -273,6 +273,25 @@ viaAnalogSetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource)
                         (displaySource & 0x01) + 1));
 }
 
+static inline void
+viaTMDSSetSyncPolarity(ScrnInfoPtr pScrn, CARD8 syncPolarity)
+{
+    /* Set TMDS (DVI) sync polarity. */
+    /* 3X5.97[6] - DVI (TMDS) VSYNC Polarity
+     *             0: Positive
+     *             1: Negative
+     * 3X5.97[5] - DVI (TMDS) HSYNC Polarity
+     *             0: Positive
+     *             1: Negative */
+    ViaCrtcMask(VGAHWPTR(pScrn), 0x97, syncPolarity << 5, BIT(6) | BIT(5));
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                "TMDS (DVI) Horizontal Sync Polarity: %s\n",
+                (syncPolarity & BIT(0)) ? "-" : "+"));
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                "TMDS (DVI) Vertical Sync Polarity: %s\n",
+                (syncPolarity & BIT(1)) ? "-" : "+"));
+}
+
 /*
  * Sets CX700 or later single chipset's LVDS1 power sequence type.
  */
commit d7790d2f20ab0fe4471385a175630c82df51f72c
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Apr 10 16:12:36 2017 -0700

    Renamed viaTMDSSetSyncPolarity as viaTMDSSyncPolarity
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_tmds.c b/src/via_tmds.c
index cf093bd..aa62479 100644
--- a/src/via_tmds.c
+++ b/src/via_tmds.c
@@ -106,13 +106,13 @@ viaTMDSInitRegisters(ScrnInfoPtr pScrn)
  * synchronization.
  */
 static void
-viaTMDSSetSyncPolarity(ScrnInfoPtr pScrn, DisplayModePtr mode)
+viaTMDSSyncPolarity(ScrnInfoPtr pScrn, DisplayModePtr mode)
 {
     vgaHWPtr hwp = VGAHWPTR(pScrn);
     CARD8 cr97;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                        "Entered viaTMDSSetSyncPolarity.\n"));
+                        "Entered viaTMDSSyncPolarity.\n"));
 
     /* 3X5.97[6] - DVI (TMDS) VSYNC Polarity
      *             0: Positive
@@ -136,7 +136,7 @@ viaTMDSSetSyncPolarity(ScrnInfoPtr pScrn, DisplayModePtr mode)
     ViaCrtcMask(hwp, 0x97, cr97, 0x60);
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                        "Exiting viaTMDSSetSyncPolarity.\n"));
+                        "Exiting viaTMDSSyncPolarity.\n"));
 }
 
 /*
@@ -898,7 +898,7 @@ via_tmds_mode_set(xf86OutputPtr output, DisplayModePtr mode,
 
     /* Set integrated TMDS transmitter synchronization polarity for
      * both horizontal synchronization and vertical synchronization. */
-    viaTMDSSetSyncPolarity(pScrn, adjusted_mode);
+    viaTMDSSyncPolarity(pScrn, adjusted_mode);
 
     if (output->crtc) {
         viaTMDSSetSource(pScrn, iga->index ? 0x01 : 0x00);
commit 1b38d6044c183f0191de8826ffa1e9b44aab4734
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Apr 10 16:01:27 2017 -0700

    Added diPortType variable to VIATMDSRec record
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_tmds.c b/src/via_tmds.c
index a2dd121..cf093bd 100644
--- a/src/via_tmds.c
+++ b/src/via_tmds.c
@@ -1086,6 +1086,11 @@ viaTMDSInit(ScrnInfoPtr pScrn)
         goto exit;
     }
 
+    /* Leaving a hint for mode setting and DPMS to know which port
+     * to access. For CX700 / VX700 and VX800 integrated TMDS
+     * transmitter, it is fixed to LVDS1 (TMDS uses LVDS1 wires). */
+    pVIATMDSRec->diPortType = VIA_DI_PORT_TMDS;
+
     /* The code to dynamically designate the particular DVI (i.e., DVI-1,
      * DVI-2, etc.) for xrandr was borrowed from xf86-video-r128 DDX. */
     sprintf(outputNameBuffer, "DVI-%d", (pVia->numberDVI + 1));
diff --git a/src/via_ums.h b/src/via_ums.h
index 2133c1e..a340fb1 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -205,6 +205,7 @@ typedef struct _viaFPRec {
 
 typedef struct _VIATMDSRec {
     I2CBusPtr pVIATMDSI2CBus;
+    CARD8       diPortType;
 } VIATMDSRec, *VIATMDSRecPtr;
 
 typedef struct
commit 583498e6801b96dca63e893b69dabeed0576a2dc
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Apr 10 14:42:39 2017 -0700

    Consolidating per FP (Flat Panel) private memory storage
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_fp.c b/src/via_fp.c
index 7811d93..3a33537 100644
--- a/src/via_fp.c
+++ b/src/via_fp.c
@@ -831,7 +831,7 @@ ViaLCDPowerSequence(vgaHWPtr hwp, VIALCDPowerSeqRec Sequence)
 static void
 ViaLCDPower(xf86OutputPtr output, Bool Power_On)
 {
-    ViaPanelInfoPtr Panel = output->driver_private;
+    viaFPRecPtr Panel = output->driver_private;
     ScrnInfoPtr pScrn = output->scrn;
     vgaHWPtr hwp = VGAHWPTR(pScrn);
     VIAPtr pVia = VIAPTR(pScrn);
@@ -997,7 +997,7 @@ viaLVDSGetFPInfoFromScratchPad(xf86OutputPtr output)
 {
     ScrnInfoPtr pScrn = output->scrn;
     vgaHWPtr hwp = VGAHWPTR(pScrn);
-    ViaPanelInfoPtr panel = output->driver_private;
+    viaFPRecPtr panel = output->driver_private;
     CARD8 index;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -1235,7 +1235,7 @@ static int
 via_lvds_mode_valid(xf86OutputPtr output, DisplayModePtr pMode)
 {
     ScrnInfoPtr pScrn = output->scrn;
-    ViaPanelInfoPtr Panel = output->driver_private;
+    viaFPRecPtr Panel = output->driver_private;
 
     if (Panel->NativeWidth < pMode->HDisplay ||
         Panel->NativeHeight < pMode->VDisplay)
@@ -1255,7 +1255,7 @@ static Bool
 via_lvds_mode_fixup(xf86OutputPtr output, DisplayModePtr mode,
                     DisplayModePtr adjusted_mode)
 {
-    ViaPanelInfoPtr Panel = output->driver_private;
+    viaFPRecPtr Panel = output->driver_private;
 
     xf86SetModeCrtc(adjusted_mode, 0);
     if (!Panel->Center && (mode->HDisplay < Panel->NativeWidth ||
@@ -1290,7 +1290,7 @@ static void
 via_lvds_mode_set(xf86OutputPtr output, DisplayModePtr mode,
                     DisplayModePtr adjusted_mode)
 {
-    ViaPanelInfoPtr Panel = output->driver_private;
+    viaFPRecPtr Panel = output->driver_private;
     ScrnInfoPtr pScrn = output->scrn;
     drmmode_crtc_private_ptr iga = output->crtc->driver_private;
     VIAPtr pVia = VIAPTR(pScrn);
@@ -1368,7 +1368,7 @@ via_lvds_detect(xf86OutputPtr output)
     xf86OutputStatus status = XF86OutputStatusDisconnected;
     ScrnInfoPtr pScrn = output->scrn;
     VIAPtr pVia = VIAPTR(pScrn);
-    ViaPanelInfoPtr panel = output->driver_private;
+    viaFPRecPtr panel = output->driver_private;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered via_lvds_detect.\n"));
@@ -1400,7 +1400,7 @@ exit:
 static DisplayModePtr
 via_lvds_get_modes(xf86OutputPtr output)
 {
-    ViaPanelInfoPtr pPanel = output->driver_private;
+    viaFPRecPtr pPanel = output->driver_private;
     ScrnInfoPtr pScrn = output->scrn;
     DisplayModePtr pDisplay_Mode = NULL;
 
@@ -1506,7 +1506,7 @@ static const xf86OutputFuncsRec via_lvds_funcs = {
 void
 via_lvds_init(ScrnInfoPtr pScrn)
 {
-    ViaPanelInfoPtr Panel = (ViaPanelInfoPtr) xnfcalloc(sizeof(ViaPanelInfoRec), 1);
+    viaFPRecPtr Panel = (viaFPRecPtr) xnfcalloc(sizeof(viaFPRec), 1);
     OptionInfoPtr  Options = xnfalloc(sizeof(ViaPanelOptions));
     MessageType from = X_DEFAULT;
     VIAPtr pVia = VIAPTR(pScrn);
diff --git a/src/via_ums.h b/src/via_ums.h
index be6b66b..2133c1e 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -138,32 +138,6 @@ typedef struct ViaPanelMode {
     Bool useDithering;
 } ViaPanelModeRec, *ViaPanelModePtr ;
 
-typedef struct ViaPanelInfo {
-    Bool IsActive ;
-    /* Native physical resolution */
-    int NativeHeight;
-    int NativeWidth;
-    Bool useDualEdge;
-    Bool useDithering;
-
-    /* Native resolution index, see via_panel.c */
-    CARD8 NativeModeIndex;
-    /* Determine if we must use the hardware scaler
-     * It might be false even if the "Center" option
-     * was specified
-     */
-    Bool            Scale;
-
-    /* Panel/LCD entries */
-    CARD16      ResolutionIndex;
-    int         PanelIndex;
-    Bool        Center;
-    Bool        SetDVI;
-    /* LCD Simultaneous Expand Mode HWCursor Y Scale */
-    Bool        scaleY;
-    int         resY;
-} ViaPanelInfoRec, *ViaPanelInfoPtr ;
-
 typedef struct _VIABIOSINFO {
 	xf86OutputPtr analog;
 	xf86OutputPtr tv;
@@ -202,6 +176,30 @@ typedef struct _VIABIOSINFO {
  * Record for storing FP (Flat Panel) specific information.
  */
 typedef struct _viaFPRec {
+    Bool IsActive ;
+    /* Native physical resolution */
+    int NativeHeight;
+    int NativeWidth;
+    Bool useDualEdge;
+    Bool useDithering;
+
+    /* Native resolution index, see via_panel.c */
+    CARD8 NativeModeIndex;
+    /* Determine if we must use the hardware scaler
+     * It might be false even if the "Center" option
+     * was specified
+     */
+    Bool            Scale;
+
+    /* Panel/LCD entries */
+    CARD16      ResolutionIndex;
+    int         PanelIndex;
+    Bool        Center;
+    Bool        SetDVI;
+    /* LCD Simultaneous Expand Mode HWCursor Y Scale */
+    Bool        scaleY;
+    int         resY;
+
     I2CBusPtr pVIAFPI2CBus;
 } viaFPRec, *viaFPRecPtr;
 
commit c2f76b51e96e57d28b0c3dfbdc265999b8cfcf27
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Apr 10 01:02:25 2017 -0700

    Removed reference to via_bios.h inside via_ums.h
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_ums.h b/src/via_ums.h
index 83c359f..be6b66b 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -26,8 +26,8 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
-#ifndef _VIA_BIOS_H_
-#define _VIA_BIOS_H_ 1
+#ifndef _VIA_UMS_H_
+#define _VIA_UMS_H_ 1
 
 #include "via_vgahw.h"
 
@@ -447,4 +447,4 @@ void ViaVT162xInit(ScrnInfoPtr pScrn);
 I2CDevPtr ViaCH7xxxDetect(ScrnInfoPtr pScrn, I2CBusPtr pBus, CARD8 Address);
 void ViaCH7xxxInit(ScrnInfoPtr pScrn);
 
-#endif /* _VIA_BIOS_H_ */
+#endif /* _VIA_UMS_H_ */
commit 627d3c74db928481552fe7cde58740814b202c51
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Apr 10 00:43:50 2017 -0700

    Defined new external digital ports
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_ums.h b/src/via_ums.h
index 13319e4..83c359f 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -113,12 +113,15 @@
 
 /* Digital Port */
 #define     VIA_DI_PORT_NONE        0x0
+#define     VIA_DI_PORT_DIP0        0x1
 #define     VIA_DI_PORT_DVP0        0x1
+#define     VIA_DI_PORT_DIP1        0x2
 #define     VIA_DI_PORT_DVP1        0x2
-#define     VIA_DI_PORT_DFPLOW      0x4
+#define     VIA_DI_PORT_FPDPLOW     0x4
+#define     VIA_DI_PORT_DVP2        0x4
 #define     VIA_DI_PORT_LVDS1       0x4
 #define     VIA_DI_PORT_TMDS        0x4
-#define     VIA_DI_PORT_DFPHIGH     0x8
+#define     VIA_DI_PORT_FPDPHIGH    0x8
 #define     VIA_DI_PORT_LVDS2       0x8
 
 /* External TMDS (DVI) Transmitter Type */
commit cb00e7e8bbf6c23cc40aeae75172356431fb96f3
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Mon Apr 10 00:38:08 2017 -0700

    Added FP (Flat Panel) specific record to via_ums.h
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_ums.h b/src/via_ums.h
index 4d9c8b3..13319e4 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -195,6 +195,13 @@ typedef struct _VIABIOSINFO {
 } VIABIOSInfoRec, *VIABIOSInfoPtr;
 
 
+/*
+ * Record for storing FP (Flat Panel) specific information.
+ */
+typedef struct _viaFPRec {
+    I2CBusPtr pVIAFPI2CBus;
+} viaFPRec, *viaFPRecPtr;
+
 typedef struct _VIATMDSRec {
     I2CBusPtr pVIATMDSI2CBus;
 } VIATMDSRec, *VIATMDSRecPtr;
commit 87123c64a85b132de89fcf6b26503634280218ce
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sun Apr 9 19:44:18 2017 -0700

    Removing unnecessary variable from viaAnalogDisplaySource
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_analog.c b/src/via_analog.c
index c0ca6dc..12ff95a 100644
--- a/src/via_analog.c
+++ b/src/via_analog.c
@@ -65,7 +65,6 @@ viaAnalogOutput(ScrnInfoPtr pScrn, Bool outputState)
 static void
 viaAnalogDisplaySource(ScrnInfoPtr pScrn, int index)
 {
-    vgaHWPtr hwp = VGAHWPTR(pScrn);
     CARD8 displaySource = index;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,


More information about the Openchrome-devel mailing list