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

Kevin Brace kevinbrace at kemper.freedesktop.org
Sun Jul 2 09:09:28 UTC 2017


 configure.ac     |    2 +-
 src/via_analog.c |   39 +++++++++++++++++++++++++++------------
 src/via_fp.c     |   24 ++++++++++++------------
 src/via_tmds.c   |   10 +++++-----
 src/via_ums.h    |   45 ++++-----------------------------------------
 src/via_vt1632.h |    2 +-
 6 files changed, 50 insertions(+), 72 deletions(-)

New commits:
commit 2d47b33ba11c0f098fd9b0265acb1e63a7002dd2
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sun Jul 2 04:08:11 2017 -0500

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

diff --git a/configure.ac b/configure.ac
index 98947d1..1f004b4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-openchrome],
-        [0.6.143],
+        [0.6.144],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
         [xf86-video-openchrome])
 
commit 55dec23ce8ae60e331dfd6306d1093bbc36a3730
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sun Jul 2 04:06:01 2017 -0500

    Added via_analog_get_modes
    
    Moved some code from via_analog_detect callback function into
    via_analog_get_modes callback function.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_analog.c b/src/via_analog.c
index 150c701..b1cb31d 100644
--- a/src/via_analog.c
+++ b/src/via_analog.c
@@ -348,12 +348,7 @@ static xf86OutputStatus
 via_analog_detect(xf86OutputPtr output)
 {
     ScrnInfoPtr pScrn = output->scrn;
-    xf86MonPtr pMon;
     xf86OutputStatus status = XF86OutputStatusDisconnected;
-    I2CBusPtr pI2CBus;
-    VIAPtr pVia = VIAPTR(pScrn);
-    VIADisplayPtr pVIADisplay = pVia->pVIADisplay;
-    VIAAnalogPtr pVIAAnalog = (VIAAnalogPtr) output->driver_private;
     Bool connectorDetected;
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -372,6 +367,25 @@ via_analog_detect(xf86OutputPtr output)
     status = XF86OutputStatusConnected;
     xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
                 "VGA connector detected.\n");
+exit:
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Exiting via_analog_detect.\n"));
+    return status;
+}
+
+static DisplayModePtr
+via_analog_get_modes(xf86OutputPtr output)
+{
+    ScrnInfoPtr pScrn = output->scrn;
+    xf86MonPtr pMon;
+    DisplayModePtr pDisplay_Mode = NULL;
+    I2CBusPtr pI2CBus;
+    VIAPtr pVia = VIAPTR(pScrn);
+    VIADisplayPtr pVIADisplay = pVia->pVIADisplay;
+    VIAAnalogPtr pVIAAnalog = (VIAAnalogPtr) output->driver_private;
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Entered via_analog_get_modes.\n"));
 
     if (pVIAAnalog->i2cBus & VIA_I2C_BUS1) {
         pI2CBus = pVIADisplay->pI2CBus1;
@@ -383,6 +397,7 @@ via_analog_detect(xf86OutputPtr output)
         pMon = xf86OutputGetEDID(output, pI2CBus);
         if (pMon && (!pMon->features.input_type)) {
             xf86OutputSetEDID(output, pMon);
+            pDisplay_Mode = xf86OutputGetEDIDModes(output);
             xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
                         "Detected a monitor connected to VGA.\n");
             goto exit;
@@ -398,8 +413,8 @@ via_analog_detect(xf86OutputPtr output)
     if (pI2CBus) {
         pMon = xf86OutputGetEDID(output, pI2CBus);
         if (pMon && (!pMon->features.input_type)) {
-            status = XF86OutputStatusConnected;
             xf86OutputSetEDID(output, pMon);
+            pDisplay_Mode = xf86OutputGetEDIDModes(output);
             xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
                         "Detected a monitor connected to VGA.\n");
             goto exit;
@@ -408,8 +423,8 @@ via_analog_detect(xf86OutputPtr output)
 
 exit:
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                        "Exiting via_analog_detect.\n"));
-    return status;
+                        "Exiting via_analog_get_modes.\n"));
+    return pDisplay_Mode;
 }
 
 #ifdef RANDR_12_INTERFACE
@@ -445,7 +460,7 @@ static const xf86OutputFuncsRec via_analog_funcs = {
     .commit             = via_analog_commit,
     .mode_set           = via_analog_mode_set,
     .detect             = via_analog_detect,
-    .get_modes          = xf86OutputGetEDIDModes,
+    .get_modes          = via_analog_get_modes,
 #ifdef RANDR_12_INTERFACE
     .set_property       = via_analog_set_property,
 #endif
commit 2c9edbedc4a0c3f58482f78376674893d6073915
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Jun 30 19:46:20 2017 -0500

    Renamed analogI2CBus inside VIAAnalogRec struct to i2cBus
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_analog.c b/src/via_analog.c
index 0170fd2..150c701 100644
--- a/src/via_analog.c
+++ b/src/via_analog.c
@@ -373,7 +373,7 @@ via_analog_detect(xf86OutputPtr output)
     xf86DrvMsg(pScrn->scrnIndex, X_PROBED,
                 "VGA connector detected.\n");
 
-    if (pVIAAnalog->analogI2CBus & VIA_I2C_BUS1) {
+    if (pVIAAnalog->i2cBus & VIA_I2C_BUS1) {
         pI2CBus = pVIADisplay->pI2CBus1;
     } else {
         pI2CBus = NULL;
@@ -389,7 +389,7 @@ via_analog_detect(xf86OutputPtr output)
         }
     }
 
-    if (pVIAAnalog->analogI2CBus & VIA_I2C_BUS2) {
+    if (pVIAAnalog->i2cBus & VIA_I2C_BUS2) {
         pI2CBus = pVIADisplay->pI2CBus2;
     } else {
         pI2CBus = NULL;
@@ -549,7 +549,7 @@ viaAnalogInit(ScrnInfoPtr pScrn)
     pVIADisplay->numberVGA++;
 
     /* Hint about which I2C bus to access for obtaining EDID. */
-    pVIAAnalog->analogI2CBus = pVIADisplay->analogI2CBus;
+    pVIAAnalog->i2cBus = pVIADisplay->analogI2CBus;
 
     output->driver_private = pVIAAnalog;
 
diff --git a/src/via_ums.h b/src/via_ums.h
index ad999c3..9f623fd 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -232,7 +232,7 @@ typedef struct _VIADISPLAY {
 } VIADisplayRec, *VIADisplayPtr;
 
 typedef struct _VIAANALOG {
-    CARD8       analogI2CBus;
+    CARD8       i2cBus;
 } VIAAnalogRec, *VIAAnalogPtr;
 
 /*
commit f9d03e7dca367e87eca4cfad97795b95a654daa9
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Jun 30 19:38:05 2017 -0500

    Widening diPort variable to 16-bits
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_fp.c b/src/via_fp.c
index 0360007..e9186bf 100644
--- a/src/via_fp.c
+++ b/src/via_fp.c
@@ -106,7 +106,7 @@ static DisplayModeRec OLPCMode = {
 #define TD3 25
 
 static void
-viaFPIOPadState(ScrnInfoPtr pScrn, CARD8 diPort, Bool ioPadOn)
+viaFPIOPadState(ScrnInfoPtr pScrn, CARD16 diPort, Bool ioPadOn)
 {
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered viaFPIOPadState.\n"));
@@ -153,7 +153,7 @@ viaFPIOPadState(ScrnInfoPtr pScrn, CARD8 diPort, Bool ioPadOn)
 }
 
 static void
-viaFPFormat(ScrnInfoPtr pScrn, CARD8 diPort, CARD8 format)
+viaFPFormat(ScrnInfoPtr pScrn, CARD16 diPort, CARD8 format)
 {
     CARD8 temp = format & 0x01;
 
@@ -181,7 +181,7 @@ viaFPFormat(ScrnInfoPtr pScrn, CARD8 diPort, CARD8 format)
 }
 
 static void
-viaFPOutputFormat(ScrnInfoPtr pScrn, CARD8 diPort, CARD8 outputFormat)
+viaFPOutputFormat(ScrnInfoPtr pScrn, CARD16 diPort, CARD8 outputFormat)
 {
     CARD8 temp = outputFormat & 0x01;
 
@@ -209,7 +209,7 @@ viaFPOutputFormat(ScrnInfoPtr pScrn, CARD8 diPort, CARD8 outputFormat)
 }
 
 static void
-viaFPDithering(ScrnInfoPtr pScrn, CARD8 diPort, Bool dithering)
+viaFPDithering(ScrnInfoPtr pScrn, CARD16 diPort, Bool dithering)
 {
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered viaFPDithering.\n"));
@@ -235,7 +235,7 @@ viaFPDithering(ScrnInfoPtr pScrn, CARD8 diPort, Bool dithering)
 }
 
 static void
-viaFPDisplaySource(ScrnInfoPtr pScrn, CARD8 diPort, int index)
+viaFPDisplaySource(ScrnInfoPtr pScrn, CARD16 diPort, int index)
 {
     CARD8 displaySource = index & 0x01;
 
@@ -480,7 +480,7 @@ viaFPSecondaryHardPowerSeq(ScrnInfoPtr pScrn, Bool powerState)
 }
 
 static void
-viaFPPower(ScrnInfoPtr pScrn, int Chipset, CARD8 diPortType, Bool powerState)
+viaFPPower(ScrnInfoPtr pScrn, int Chipset, CARD16 diPort, Bool powerState)
 {
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered viaFPPower.\n"));
@@ -504,12 +504,12 @@ viaFPPower(ScrnInfoPtr pScrn, int Chipset, CARD8 diPortType, Bool powerState)
          * VX800, CX700 have HW issue, so we'd better use SW power sequence.
          * Fix Ticket #308.
          */
-        if (diPortType & VIA_DI_PORT_LVDS1) {
+        if (diPort & VIA_DI_PORT_LVDS1) {
             viaFPPrimarySoftPowerSeq(pScrn, powerState);
             viaLVDS1SetPower(pScrn, powerState);
         }
 
-        if (diPortType & VIA_DI_PORT_LVDS2) {
+        if (diPort & VIA_DI_PORT_LVDS2) {
             ViaLVDSSoftwarePowerSecondSequence(pScrn, powerState);
             viaLVDS2SetPower(pScrn, powerState);
         }
diff --git a/src/via_ums.h b/src/via_ums.h
index 80392be..ad999c3 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -263,12 +263,12 @@ typedef struct _VIAFP {
     Bool        scaleY;
     int         resY;
 
-    CARD8       diPort;
+    CARD16      diPort;
     CARD8       i2cBus;
 } VIAFPRec, *VIAFPPtr;
 
 typedef struct _VIATMDS {
-    CARD8       diPort;
+    CARD16      diPort;
     CARD8       i2cBus;
 } VIATMDSRec, *VIATMDSPtr;
 
diff --git a/src/via_vt1632.h b/src/via_vt1632.h
index fa4b873..6448fb7 100644
--- a/src/via_vt1632.h
+++ b/src/via_vt1632.h
@@ -35,7 +35,7 @@
 typedef struct _VIAVT1632 {
     I2CDevPtr   VT1632I2CDev;
 
-    CARD8       diPort;
+    CARD16      diPort;
     CARD8       i2cBus;
     CARD8       transmitter;
 
commit c552a325f8b44390195eb5099cd93b88ed6b1d9b
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Jun 30 19:26:19 2017 -0500

    Removed viaLVDS1SetSoftDisplayPeriod
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_ums.h b/src/via_ums.h
index 022855e..80392be 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -885,25 +885,6 @@ viaLVDS1SetSoftVdd(ScrnInfoPtr pScrn, Bool softOn)
 }
 
 /*
- * Sets CX700 or later single chipset's LVDS1 software controlled
- * display period.
- */
-static inline void
-viaLVDS1SetSoftDisplayPeriod(ScrnInfoPtr pScrn, Bool softOn)
-{
-    /* Set LVDS1 software controlled display period state. */
-    /* 3X5.91[7] - Software Direct On / Off Display Period
-     *             in the Panel Path
-     *             0: On
-     *             1: Off */
-    ViaCrtcMask(VGAHWPTR(pScrn), 0x91, softOn ? 0 : BIT(7),
-                BIT(7));
-    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                        "LVDS1 Software Controlled Display Period: %s\n",
-                        softOn ? "On" : "Off"));
-}
-
-/*
  * Sets CX700 or later single chipset's LVDS1 I/O pad state.
  */
 static inline void
commit b23f0db020fe9ae18984a019474829f075bceeaa
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Jun 30 19:24:02 2017 -0500

    Removed viaLVDS1SetSoftData
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_ums.h b/src/via_ums.h
index 59e079f..022855e 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -868,24 +868,6 @@ viaLVDS1SetPowerSeq(ScrnInfoPtr pScrn, Bool ctrlType)
 }
 
 /*
- * Sets CX700 or later single chipset's LVDS1 software controlled
- * data path state.
- */
-static inline void
-viaLVDS1SetSoftData(ScrnInfoPtr pScrn, Bool softOn)
-{
-    /* Set LVDS1 software controlled data path state. */
-    /* 3X5.91[3] - Software Data On
-     *             0: Off
-     *             1: On */
-    ViaCrtcMask(VGAHWPTR(pScrn), 0x91, softOn ? BIT(3) : 0,
-                BIT(3));
-    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                        "LVDS1 Software Controlled Data Path: %s\n",
-                        softOn ? "On" : "Off"));
-}
-
-/*
  * Sets CX700 or later single chipset's LVDS1 software controlled Vdd.
  */
 static inline void
commit 354028593acf3536682e57f4f5efb749de893b53
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Jun 30 19:19:58 2017 -0500

    Updating the code inside viaTMDSPower
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_tmds.c b/src/via_tmds.c
index 8908f3f..2dbea8c 100644
--- a/src/via_tmds.c
+++ b/src/via_tmds.c
@@ -163,17 +163,17 @@ viaTMDSPower(ScrnInfoPtr pScrn, Bool powerState)
                         "Entered viaTMDSPower.\n"));
 
     if (powerState) {
-        viaLVDS1SetSoftDisplayPeriod(pScrn, TRUE);
-        viaLVDS1SetSoftData(pScrn, TRUE);
+        viaFPSetPrimaryDirectDisplayPeriod(pScrn, TRUE);
+        viaFPSetPrimarySoftData(pScrn, TRUE);
         viaTMDSSetPower(pScrn, TRUE);
     } else {
         viaTMDSSetPower(pScrn, FALSE);
-        viaLVDS1SetSoftData(pScrn, FALSE);
-        viaLVDS1SetSoftDisplayPeriod(pScrn, FALSE);
+        viaFPSetPrimarySoftData(pScrn, FALSE);
+        viaFPSetPrimaryDirectDisplayPeriod(pScrn, FALSE);
     }
 
     xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                "DVI Monitor Power: %s\n",
+                "DVI Power: %s\n",
                 powerState ? "On" : "Off");
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
commit 4706fbc769dd4fb4e70dd239c53f70613796bec9
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Jun 30 19:18:11 2017 -0500

    Rename viaFPSetPrimaryDirectDisplayPeriodCtrl
    
    The new name is viaFPSetPrimaryDirectDisplayPeriod.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_fp.c b/src/via_fp.c
index a86241d..0360007 100644
--- a/src/via_fp.c
+++ b/src/via_fp.c
@@ -337,7 +337,7 @@ viaFPPrimarySoftPowerSeq(ScrnInfoPtr pScrn, Bool powerState)
     viaFPSetPrimaryPowerSeqType(pScrn, FALSE);
 
     if (powerState) {
-        viaFPSetPrimaryDirectDisplayPeriodCtrl(pScrn, TRUE);
+        viaFPSetPrimaryDirectDisplayPeriod(pScrn, TRUE);
         usleep(TD0);
 
         viaFPSetPrimarySoftVDD(pScrn, TRUE);
@@ -363,7 +363,7 @@ viaFPPrimarySoftPowerSeq(ScrnInfoPtr pScrn, Bool powerState)
         usleep(TD1);
 
         viaFPSetPrimarySoftVDD(pScrn, FALSE);
-        viaFPSetPrimaryDirectDisplayPeriodCtrl(pScrn, FALSE);
+        viaFPSetPrimaryDirectDisplayPeriod(pScrn, FALSE);
     }
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
@@ -435,10 +435,10 @@ viaFPPrimaryHardPowerSeq(ScrnInfoPtr pScrn, Bool powerState)
         viaFPSetPrimaryDirectBackLightCtrl(pScrn, TRUE);
 
         /* Make sure display period is turned on. */
-        viaFPSetPrimaryDirectDisplayPeriodCtrl(pScrn, TRUE);
+        viaFPSetPrimaryDirectDisplayPeriod(pScrn, TRUE);
     } else {
         /* Make sure display period is turned off. */
-        viaFPSetPrimaryDirectDisplayPeriodCtrl(pScrn, FALSE);
+        viaFPSetPrimaryDirectDisplayPeriod(pScrn, FALSE);
 
         /* Make sure back light is turned off. */
         viaFPSetPrimaryDirectBackLightCtrl(pScrn, FALSE);
diff --git a/src/via_ums.h b/src/via_ums.h
index 791836f..59e079f 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -684,7 +684,7 @@ viaFPSetPrimaryDirectBackLightCtrl(ScrnInfoPtr pScrn, Bool directOn)
  * control bit.
  */
 static inline void
-viaFPSetPrimaryDirectDisplayPeriodCtrl(ScrnInfoPtr pScrn, Bool directOn)
+viaFPSetPrimaryDirectDisplayPeriod(ScrnInfoPtr pScrn, Bool directOn)
 {
     /* Set FP primary direct display period bit. */
     /* 3X5.91[7] - FP Primary Direct Display Period Control


More information about the Openchrome-devel mailing list