From edfa6a13465e9fca4319952e6f3308b8c25511f6 Mon Sep 17 00:00:00 2001 From: Kevin Brace Date: Thu, 3 Dec 2015 23:05:26 -0800 Subject: [PATCH 09/10] Made improvements to ViaLVDSDFPPower function inside via_lvds.c. A very poor assumption was being made regarding the I/O pad state of pins connected to an LVDS-based DFP (Digital Flat Panel) in the previous version of the code. At this point, the best solution is to turn on or off the pins of both LVDS Channel 1 and Channel 2. The previous version of the code was relying on the supposed previous state of pins connected to the LVDS-based DFP, and this was leading to the LVDS-based DFP screen getting turned off completely when the computer resumes from ACPI S3 State. In the future, it will be nice if LVDS Channel 1 or Channel 2 pins can be turned on and off independently based on what is actually connected to the LVDS channel. --- src/via_lvds.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/src/via_lvds.c b/src/via_lvds.c index 073cef6..ed5bd79 100644 --- a/src/via_lvds.c +++ b/src/via_lvds.c @@ -1,4 +1,5 @@ /* + * Copyright 2015 Kevin Brace * Copyright 2007-2015 The Openchrome Project * [http://www.freedesktop.org/wiki/Openchrome] * Copyright 1998-2007 VIA Technologies, Inc. All Rights Reserved. @@ -241,14 +242,24 @@ ViaLVDSHardwarePowerSecondSequence(ScrnInfoPtr pScrn, Bool on) } } -static void -ViaLVDSDFPPower(ScrnInfoPtr pScrn, Bool on) +static void ViaLVDSDFPPower(ScrnInfoPtr pScrn, Bool on) { vgaHWPtr hwp = VGAHWPTR(pScrn); VIAPtr pVia = VIAPTR(pScrn); - /* Switch DFP High/Low pads on or off for channels active at EnterVT(). */ - ViaSeqMask(hwp, 0x2A, on ? pVia->SavedReg.SR2A : 0, 0x0F); + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Entered ViaLVDSDFPPower.\n")); + + if (on) { + +/* Turn on both LVDS channels (LVDS Channel 1 and 2). */ + ViaSeqMask(hwp, 0x2a, 0x0f, 0x0f); + } else { + +/* Turn off both LVDS channels (LVDS Channel 1 and 2). */ + ViaSeqMask(hwp, 0x2a, 0x00, 0x0f); + } + + DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO, "Exiting ViaLVDSDFPPower.\n")); } static void -- 1.7.9.5