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

Kevin Brace kevinbrace at kemper.freedesktop.org
Thu Oct 13 03:22:12 UTC 2016


 configure.ac      |    2 
 src/via_display.c |  128 +++++++++++++++++++++++++++++++++++++++---------------
 src/via_ums.h     |    2 
 3 files changed, 94 insertions(+), 38 deletions(-)

New commits:
commit 64d6672c02e0bae65c52418e8e9fe689c4149ae3
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Oct 12 20:13:15 2016 -0700

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

diff --git a/configure.ac b/configure.ac
index 6c3a832..c404060 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 # Initialize Autoconf
 AC_PREREQ(2.57)
 AC_INIT([xf86-video-openchrome],
-        [0.5.163],
+        [0.5.164],
         [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
         [xf86-video-openchrome])
 
commit 166c3eea5688d7e97edf392ec8ad778bfe0bbbc8
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Wed Oct 12 20:05:53 2016 -0700

    Controlling IGA1 and IGA2 output state from *_commit and *_prepare
    
    The code was updated so that IGA1 and IGA2 output state is controlled
    from *_commit and *_prepare callback functions. Previously, display
    controller output state was set from the a mode setting callback
    function.
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_display.c b/src/via_display.c
index ccb1d40..d60c4a7 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -92,7 +92,7 @@ viaIGA1HWReset(ScrnInfoPtr pScrn, CARD8 resetState)
 /*
  * Controls IGA1 DPMS State.
  */
-void
+static void
 viaIGA1DPMSControl(ScrnInfoPtr pScrn, CARD8 dpmsControl)
 {
     vgaHWPtr hwp = VGAHWPTR(pScrn);
@@ -249,7 +249,7 @@ viaIGA1SetHIDisplayLocation(ScrnInfoPtr pScrn,
 /*
  * Controls IGA2 display output on or off state.
  */
-void
+static void
 viaIGA2DisplayOutput(ScrnInfoPtr pScrn, Bool outputState)
 {
     vgaHWPtr hwp = VGAHWPTR(pScrn);
@@ -3163,8 +3163,18 @@ iga1_crtc_mode_fixup(xf86CrtcPtr crtc, DisplayModePtr mode,
 }
 
 static void
-iga1_crtc_prepare (xf86CrtcPtr crtc)
+iga1_crtc_prepare(xf86CrtcPtr crtc)
 {
+    ScrnInfoPtr pScrn = crtc->scrn;
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Entered iga1_crtc_prepare.\n"));
+
+    /* Turn off IGA1. */
+    viaIGA1DPMSControl(pScrn, 0x03);
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Exiting iga1_crtc_prepare.\n"));
 }
 
 static void
@@ -3204,9 +3214,6 @@ iga1_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
         goto exit;
     }
 
-    /* Turn off IGA1 during mode setting. */
-    viaIGA1DPMSControl(pScrn, 0x03);
-
     viaIGAInitCommon(pScrn);
     viaIGA1Init(pScrn);
 
@@ -3231,9 +3238,6 @@ iga1_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
     viaIGA1SetFBStartingAddress(crtc, x, y);
     VIAVidAdjustFrame(pScrn, x, y);
 
-    /* Turn on IGA1 now that mode setting is done. */
-    viaIGA1DPMSControl(pScrn, 0x00);
-
 exit:
     /* Put IGA1 back into a normal operating state. */
     viaIGA1HWReset(pScrn, 0x01);
@@ -3243,6 +3247,25 @@ exit:
 }
 
 static void
+iga1_crtc_commit(xf86CrtcPtr crtc)
+{
+    ScrnInfoPtr pScrn = crtc->scrn;
+    VIAPtr pVia = VIAPTR(pScrn);
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Entering iga1_crtc_commit.\n"));
+
+    if (crtc->scrn->pScreen != NULL && pVia->drmmode.hwcursor)
+        xf86_reload_cursors(crtc->scrn->pScreen);
+
+    /* Turn on IGA1. */
+    viaIGA1DPMSControl(pScrn, 0x00);
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Exiting iga1_crtc_commit.\n"));
+}
+
+static void
 iga1_crtc_gamma_set(xf86CrtcPtr crtc, CARD16 *red, CARD16 *green, CARD16 *blue,
 					int size)
 {
@@ -3398,16 +3421,6 @@ iga1_crtc_load_cursor_argb(xf86CrtcPtr crtc, CARD32 *image)
 }
 
 static void
-iga_crtc_commit(xf86CrtcPtr crtc)
-{
-    ScrnInfoPtr pScrn = crtc->scrn;
-    VIAPtr pVia = VIAPTR(pScrn);
-
-    if (crtc->scrn->pScreen != NULL && pVia->drmmode.hwcursor)
-        xf86_reload_cursors(crtc->scrn->pScreen);
-}
-
-static void
 iga_crtc_destroy(xf86CrtcPtr crtc)
 {
     if (crtc->driver_private)
@@ -3423,7 +3436,7 @@ const xf86CrtcFuncsRec iga1_crtc_funcs = {
     .mode_fixup             = iga1_crtc_mode_fixup,
     .prepare                = iga1_crtc_prepare,
     .mode_set               = iga1_crtc_mode_set,
-    .commit                 = iga_crtc_commit,
+    .commit                 = iga1_crtc_commit,
     .gamma_set              = iga1_crtc_gamma_set,
     .shadow_create          = iga1_crtc_shadow_create,
     .shadow_allocate        = iga1_crtc_shadow_allocate,
@@ -3545,8 +3558,18 @@ iga2_crtc_mode_fixup(xf86CrtcPtr crtc, DisplayModePtr mode,
 }
 
 static void
-iga2_crtc_prepare (xf86CrtcPtr crtc)
+iga2_crtc_prepare(xf86CrtcPtr crtc)
 {
+    ScrnInfoPtr pScrn = crtc->scrn;
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Entered iga2_crtc_prepare.\n"));
+
+    /* Turn off IGA2. */
+    viaIGA2DisplayOutput(pScrn, FALSE);
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Exiting iga2_crtc_prepare.\n"));
 }
 
 static void
@@ -3584,9 +3607,6 @@ iga2_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
         return;
     }
 
-    /* Turn off IGA2 during mode setting. */
-    viaIGA2DisplayOutput(pScrn, FALSE);
-
     viaIGAInitCommon(pScrn);
     viaIGA2Init(pScrn);
 
@@ -3605,11 +3625,27 @@ iga2_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
     viaIGA2SetFBStartingAddress(crtc, x, y);
     VIAVidAdjustFrame(pScrn, x, y);
 
-    /* Turn on IGA2 now that mode setting is done. */
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Exiting iga2_crtc_mode_set.\n"));
+}
+
+static void
+iga2_crtc_commit(xf86CrtcPtr crtc)
+{
+    ScrnInfoPtr pScrn = crtc->scrn;
+    VIAPtr pVia = VIAPTR(pScrn);
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Entering iga2_crtc_commit.\n"));
+
+    if (crtc->scrn->pScreen != NULL && pVia->drmmode.hwcursor)
+        xf86_reload_cursors(crtc->scrn->pScreen);
+
+    /* Turn on IGA2. */
     viaIGA2DisplayOutput(pScrn, TRUE);
 
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                        "Exiting iga2_crtc_mode_set.\n"));
+                        "Exiting iga2_crtc_commit.\n"));
 }
 
 static void
@@ -3819,7 +3855,7 @@ const xf86CrtcFuncsRec iga2_crtc_funcs = {
     .mode_fixup             = iga2_crtc_mode_fixup,
     .prepare                = iga2_crtc_prepare,
     .mode_set               = iga2_crtc_mode_set,
-    .commit                 = iga_crtc_commit,
+    .commit                 = iga2_crtc_commit,
     .gamma_set              = iga2_crtc_gamma_set,
     .shadow_create          = iga2_crtc_shadow_create,
     .shadow_allocate        = iga2_crtc_shadow_allocate,
diff --git a/src/via_ums.h b/src/via_ums.h
index 83c6d63..d4139fc 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -238,8 +238,6 @@ void ViaSetSecondaryDotclock(ScrnInfoPtr pScrn, CARD32 clock);
 void ViaSetUseExternalClock(vgaHWPtr hwp);
 
 /* via_display.c */
-void viaIGA1DPMSControl(ScrnInfoPtr pScrn, CARD8 dpmsControl);
-void viaIGA2DisplayOutput(ScrnInfoPtr pScrn, Bool outputState);
 void viaIGA2DisplayChannel(ScrnInfoPtr pScrn, Bool channelState);
 void viaDisplayInit(ScrnInfoPtr pScrn);
 void ViaGammaDisable(ScrnInfoPtr pScrn);
commit 2fd9ff49e2144f3850269e2e03a6075927774707
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Oct 7 00:10:54 2016 -0700

    Altered the IGA1 HW reset sequence during mode setting
    
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_display.c b/src/via_display.c
index 0bab9a4..ccb1d40 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -67,6 +67,29 @@ ViaPrintMode(ScrnInfoPtr pScrn, DisplayModePtr mode)
 }
 
 /*
+ * Resets IGA1 hardware.
+ */
+static void
+viaIGA1HWReset(ScrnInfoPtr pScrn, CARD8 resetState)
+{
+    vgaHWPtr hwp = VGAHWPTR(pScrn);
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Entered viaIGA1HWReset.\n"));
+
+    /* 3X5.17[7] - IGA1 HW Reset
+     *             0: Reset
+     *             1: Normal Operation */
+    ViaCrtcMask(hwp, 0x17, resetState << 7, 0x80);
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                "IGA1 HW Reset: %s\n",
+                (resetState & 0x01) ? "Off" : "On");
+
+    DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                        "Exiting viaIGA1HWReset.\n"));
+}
+
+/*
  * Controls IGA1 DPMS State.
  */
 void
@@ -3172,12 +3195,13 @@ iga1_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered iga1_crtc_mode_set.\n"));
 
+    /* Put IGA1 into a reset state. */
+    viaIGA1HWReset(pScrn, 0x00);
+
     if (!vgaHWInit(pScrn, adjusted_mode)) {
         DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                             "vgaHWInit failed.\n"));
-        DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
-                            "Exiting iga1_crtc_mode_set.\n"));
-        return;
+        goto exit;
     }
 
     /* Turn off IGA1 during mode setting. */
@@ -3186,9 +3210,6 @@ iga1_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
     viaIGAInitCommon(pScrn);
     viaIGA1Init(pScrn);
 
-    /* Turn off Screen */
-    ViaCrtcMask(hwp, 0x17, 0x00, 0x80);
-
     /* Disable IGA1 */
     ViaSeqMask(hwp, 0x59, 0x00, 0x80);
 
@@ -3207,15 +3228,16 @@ iga1_crtc_mode_set(xf86CrtcPtr crtc, DisplayModePtr mode,
     /* Enable IGA1 */
     ViaSeqMask(hwp, 0x59, 0x80, 0x80);
 
-    /* Turn on Screen */
-    ViaCrtcMask(hwp, 0x17, 0x80, 0x80);
-
     viaIGA1SetFBStartingAddress(crtc, x, y);
     VIAVidAdjustFrame(pScrn, x, y);
 
     /* Turn on IGA1 now that mode setting is done. */
     viaIGA1DPMSControl(pScrn, 0x00);
 
+exit:
+    /* Put IGA1 back into a normal operating state. */
+    viaIGA1HWReset(pScrn, 0x01);
+
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Exiting iga1_crtc_mode_set.\n"));
 }


More information about the Openchrome-devel mailing list