[Openchrome-devel] xf86-video-openchrome: 5 commits - configure.ac src/via_analog.c src/via_display.c src/via_ums.h

Kevin Brace kevinbrace at kemper.freedesktop.org
Sun Jun 25 12:02:37 UTC 2017


 configure.ac      |    2 +-
 src/via_analog.c  |    5 ++---
 src/via_display.c |   16 ++++++++++++++++
 src/via_ums.h     |   32 ++++++++++++++++++++++++++++++++
 4 files changed, 51 insertions(+), 4 deletions(-)

New commits:
commit fc1c232cb31d990b3dc7888825f8051f0b0eaece
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sun Jun 25 06:57:52 2017 -0500

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

diff --git a/configure.ac b/configure.ac
index 00a05cf..f909674 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-openchrome],
-        [0.6.138],
+        [0.6.139],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
         [xf86-video-openchrome])
 
commit 048cf5eca9dfbe1e8137c8308bbda572040f37eb
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sun Jun 25 06:56:16 2017 -0500

    Reversing commit 46b0f46
    
    The new code is slightly different from what commit 46b0f46 removed,
    but the original functionality of turning off IGA1 / IGA2 through DPMS
    callback function is now restored.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_display.c b/src/via_display.c
index a3b46ae..04ed559 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -3577,8 +3577,10 @@ iga1_crtc_dpms(xf86CrtcPtr crtc, int mode)
     case DPMSModeOn:
     case DPMSModeStandby:
     case DPMSModeSuspend:
+        viaIGA1SetDisplayOutput(pScrn, TRUE);
         break;
     case DPMSModeOff:
+        viaIGA1SetDisplayOutput(pScrn, FALSE);
         break;
     default:
         break;
@@ -3674,6 +3676,9 @@ iga1_crtc_prepare(xf86CrtcPtr crtc)
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered iga1_crtc_prepare.\n"));
 
+    /* Turn off IGA1. */
+    viaIGA1SetDisplayOutput(pScrn, FALSE);
+
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Exiting iga1_crtc_prepare.\n"));
 }
@@ -3757,6 +3762,9 @@ iga1_crtc_commit(xf86CrtcPtr crtc)
     if (crtc->scrn->pScreen != NULL && pVia->drmmode.hwcursor)
         xf86_reload_cursors(crtc->scrn->pScreen);
 
+    /* Turn on IGA1. */
+    viaIGA1SetDisplayOutput(pScrn, TRUE);
+
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Exiting iga1_crtc_commit.\n"));
 }
@@ -3960,10 +3968,12 @@ iga2_crtc_dpms(xf86CrtcPtr crtc, int mode)
 
     switch (mode) {
     case DPMSModeOn:
+        viaIGA2SetDisplayOutput(pScrn, TRUE);
         break;
     case DPMSModeStandby:
     case DPMSModeSuspend:
     case DPMSModeOff:
+        viaIGA2SetDisplayOutput(pScrn, FALSE);
         break;
     default:
         xf86DrvMsg(pScrn->scrnIndex, X_ERROR, "Invalid DPMS mode: %d\n",
@@ -4074,6 +4084,9 @@ iga2_crtc_prepare(xf86CrtcPtr crtc)
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered iga2_crtc_prepare.\n"));
 
+    /* Turn off IGA2. */
+    viaIGA2SetDisplayOutput(pScrn, FALSE);
+
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Exiting iga2_crtc_prepare.\n"));
 }
@@ -4153,6 +4166,9 @@ iga2_crtc_commit(xf86CrtcPtr crtc)
     if (crtc->scrn->pScreen != NULL && pVia->drmmode.hwcursor)
         xf86_reload_cursors(crtc->scrn->pScreen);
 
+    /* Turn on IGA2. */
+    viaIGA2SetDisplayOutput(pScrn, TRUE);
+
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Exiting iga2_crtc_commit.\n"));
 }
commit f5335d37c099d89d565539d861d41305f234ddb2
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sun Jun 25 06:27:39 2017 -0500

    Added viaIGA2SetDisplayOutput
    
    This commit effectively reverses commit 0fab3ad.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_ums.h b/src/via_ums.h
index 4f2be39..60c2bba 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -306,6 +306,22 @@ viaIGA1SetDisplayOutput(ScrnInfoPtr pScrn, Bool outputState)
 }
 
 /*
+ * Sets IGA2 display output state.
+ */
+static inline void
+viaIGA2SetDisplayOutput(ScrnInfoPtr pScrn, Bool outputState)
+{
+    /* 3X5.6B[2] - IGA2 Screen Off
+     *             0: Screen on
+     *             1: Screen off */
+    ViaCrtcMask(VGAHWPTR(pScrn), 0x6B,
+                outputState ? 0x00 : BIT(2), BIT(2));
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "IGA2 Display Output: %s\n",
+                        outputState ? "On" : "Off"));
+}
+
+/*
  * Sets DVP0 (Digital Video Port 0) I/O pad state.
  */
 static inline void
commit 2816955d4f3a54831d11b86c03e147dd15e548c0
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sun Jun 25 06:04:06 2017 -0500

    Permanently turning off CRT DACOFF bit
    
    Turning on this bit was the likely cause why commit 46b0f46 was
    made. Thanks to this fix, may be able to revert back the code removed
    by this commit. Turning off this bit prevents 3C5.01[5] from turning
    off analog (VGA) DAC. This affects CX700 / VX700, VX800, VX855, and
    VX900 chipsets.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_analog.c b/src/via_analog.c
index ae985dc..af94bba 100644
--- a/src/via_analog.c
+++ b/src/via_analog.c
@@ -143,7 +143,8 @@ viaAnalogInitReg(ScrnInfoPtr pScrn)
     case VIA_VX800:
     case VIA_VX855:
     case VIA_VX900:
-        viaAnalogSetDACOff(pScrn, TRUE);
+        /* Make sure 3C5.01[5] does not turn off analog (VGA) DAC. */
+        viaAnalogSetDACOff(pScrn, FALSE);
         break;
     default:
         break;
commit e66595e1af063f44e3eefe527b65282e227ee1f9
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Sun Jun 25 05:50:17 2017 -0500

    Added viaAnalogSetDACOff
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_analog.c b/src/via_analog.c
index 1ad2146..ae985dc 100644
--- a/src/via_analog.c
+++ b/src/via_analog.c
@@ -143,9 +143,7 @@ viaAnalogInitReg(ScrnInfoPtr pScrn)
     case VIA_VX800:
     case VIA_VX855:
     case VIA_VX900:
-        /* 3C5.5E[0] - CRT DACOFF Setting
-         *             1: CRT DACOFF controlled by 3C5.01[5] */
-        ViaSeqMask(hwp, 0x5E, 0x01, 0x01);
+        viaAnalogSetDACOff(pScrn, TRUE);
         break;
     default:
         break;
diff --git a/src/via_ums.h b/src/via_ums.h
index 81c8e8b..4f2be39 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -521,6 +521,22 @@ viaAnalogSetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource)
 }
 
 /*
+ * Sets analog (VGA) DAC off setting.
+ * Only available in CX700 / VX700, VX800, VX855, and VX900 chipsets.
+ */
+static inline void
+viaAnalogSetDACOff(ScrnInfoPtr pScrn, Bool dacOff)
+{
+    /* 3C5.5E[0] - CRT DACOFF Setting
+     *             0: Disabled
+     *             1: DAC is controlled by 3C5.01[5] */
+    ViaSeqMask(VGAHWPTR(pScrn), 0x5E, dacOff ? BIT(0) : 0x00, BIT(0));
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Analog (VGA) DAC Off Setting: %s\n",
+                        dacOff ? "On" : "Off"));
+}
+
+/*
  * Sets KM400 or later chipset's FP primary power sequence control
  * type.
  */


More information about the Openchrome-devel mailing list