[Openchrome-devel] xf86-video-openchrome: src/via_outputs.c src/via_vt1632.c src/via_vt1632.h

Kevin Brace kevinbrace at kemper.freedesktop.org
Fri Jul 1 06:14:31 UTC 2016


 src/via_outputs.c |    8 ++++----
 src/via_vt1632.c  |   13 +++++--------
 src/via_vt1632.h  |    2 +-
 3 files changed, 10 insertions(+), 13 deletions(-)

New commits:
commit 52568cf3c04679684b7f62f59ae99ee2153ec8b2
Author: Kevin Brace <kevinbrace at gmx.com>
Date:   Fri Jul 1 01:11:56 2016 -0500

    Fix for VT1632A not turning off the screen
    
    Due to the lack of testing when commit a8c2f04 got committed, a monitor
    with DVI input was not turning off when the OS tells it to turn it off.
    This fix solves this bug by calling the correct function that powers up
    or down VT1632A.
    
    Signed-off-by: Eric Kudzin <knoppix1337 at yahoo.com>
    Signed-off-by: Kevin Brace <kevinbrace at gmx.com>

diff --git a/src/via_outputs.c b/src/via_outputs.c
index e7f2ab7..68ebb4e 100644
--- a/src/via_outputs.c
+++ b/src/via_outputs.c
@@ -869,16 +869,16 @@ via_dvi_dpms(xf86OutputPtr output, int mode)
 
     switch (mode) {
     case DPMSModeOn:
-        viaTMDSPower(pScrn, TRUE);
+        via_vt1632_power(output, TRUE);
         break;
-
     case DPMSModeStandby:
     case DPMSModeSuspend:
     case DPMSModeOff:
-        viaTMDSPower(pScrn, FALSE);
+        via_vt1632_power(output, FALSE);
+        break;
+    default:
         break;
     }
-
 }
 
 static void
diff --git a/src/via_vt1632.c b/src/via_vt1632.c
index 0d6b662..ff3e3e0 100644
--- a/src/via_vt1632.c
+++ b/src/via_vt1632.c
@@ -65,7 +65,7 @@ via_vt1632_dump_registers(ScrnInfoPtr pScrn, I2CDevPtr pDev)
 
 
 void
-via_vt1632_power(xf86OutputPtr output, BOOL on)
+via_vt1632_power(xf86OutputPtr output, Bool powerState)
 {
     struct ViaVT1632PrivateData * Private = output->driver_private;
     ScrnInfoPtr pScrn = output->scrn;
@@ -73,14 +73,11 @@ via_vt1632_power(xf86OutputPtr output, BOOL on)
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Entered via_vt1632_power.\n"));
 
-    if (on == TRUE) {
-        xf86I2CMaskByte(Private->VT1632I2CDev, 0x08, 0x01, 0x01);
-    } else {
-        xf86I2CMaskByte(Private->VT1632I2CDev, 0x08, 0x00, 0x01);
-    }
+    xf86I2CMaskByte(Private->VT1632I2CDev, 0x08, powerState ? 0x01 : 0x00, 0x01);
+    xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+                "VT1632A Power: %s\n",
+                powerState ? "On" : "Off");
 
-    xf86DrvMsg(pScrn->scrnIndex, X_INFO, "VT1632A: Power %s.\n",
-                on ? "On" : "Off");
     DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
                         "Exiting via_vt1632_power.\n"));
 }
diff --git a/src/via_vt1632.h b/src/via_vt1632.h
index 535bf17..fa28dce 100644
--- a/src/via_vt1632.h
+++ b/src/via_vt1632.h
@@ -42,7 +42,7 @@ struct ViaVT1632PrivateData {
 	CARD8 Register0C;
 };
 
-void via_vt1632_power(xf86OutputPtr output, BOOL on);
+void via_vt1632_power(xf86OutputPtr output, Bool powerState);
 void via_vt1632_save(xf86OutputPtr output);
 void via_vt1632_restore(xf86OutputPtr output);
 int via_vt1632_mode_valid(xf86OutputPtr output, DisplayModePtr pMode);


More information about the Openchrome-devel mailing list