[Openchrome-devel] xf86-video-openchrome: 4 commits - configure.ac src/via_analog.c src/via_ums.h
Kevin Brace
kevinbrace at kemper.freedesktop.org
Thu Apr 6 22:46:54 UTC 2017
configure.ac | 2 -
src/via_analog.c | 67 ++++++++++++++++++++++++++-----------------------------
src/via_ums.h | 22 ++++++++++++++++++
3 files changed, 55 insertions(+), 36 deletions(-)
New commits:
commit 69bc13496bd2125c62693bdbc9b6ba2a9a626dc6
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Apr 6 15:35:41 2017 -0700
Version bumped to 0.6.104
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/configure.ac b/configure.ac
index 0928533..74e0c40 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
# Initialize Autoconf
AC_PREREQ(2.57)
AC_INIT([xf86-video-openchrome],
- [0.6.103],
+ [0.6.104],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg&component=Driver/openchrome],
[xf86-video-openchrome])
commit 200c7cfe41fa98d6034c4fa7aa622cc201e77f84
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Apr 6 15:34:27 2017 -0700
Rewrite of viaAnalogSyncPolarity
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/src/via_analog.c b/src/via_analog.c
index a40d70c..b253c42 100644
--- a/src/via_analog.c
+++ b/src/via_analog.c
@@ -81,6 +81,37 @@ viaAnalogSetDisplaySource(ScrnInfoPtr pScrn, CARD8 displaySource)
}
/*
+ * Set analog (VGA) sync polarity.
+ */
+static void
+viaAnalogSyncPolarity(ScrnInfoPtr pScrn, unsigned int flags)
+{
+ CARD8 syncPolarity = 0x00;
+
+ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Entered viaAnalogSyncPolarity.\n"));
+
+ if (flags & V_NHSYNC) {
+ syncPolarity |= BIT(0);
+ }
+
+ if (flags & V_NHSYNC) {
+ syncPolarity |= BIT(1);
+ }
+
+ viaAnalogSetSyncPolarity(pScrn, syncPolarity);
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Analog (VGA) Horizontal Sync Polarity: %s\n",
+ (syncPolarity & BIT(0)) ? "-" : "+");
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Analog (VGA) Vertical Sync Polarity: %s\n",
+ (syncPolarity & BIT(1)) ? "-" : "+");
+
+ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Exiting viaAnalogSyncPolarity.\n"));
+}
+
+/*
* Intializes analog VGA related registers.
*/
static void
@@ -125,40 +156,6 @@ viaAnalogInit(ScrnInfoPtr pScrn)
"Exiting viaAnalogInit.\n"));
}
-/*
- * Sets the polarity of horizontal synchronization and vertical
- * synchronization.
- */
-static void
-viaAnalogSyncPolarity(ScrnInfoPtr pScrn, DisplayModePtr mode)
-{
- vgaHWPtr hwp = VGAHWPTR(pScrn);
- CARD8 miscRegister;
-
- DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Entered viaAnalogSyncPolarity.\n"));
-
-/* Set certain bits of miscellaneous output register
- * meant for IGA1. */
- miscRegister = hwp->readMiscOut(hwp);
- if (mode->Flags & V_NHSYNC) {
- miscRegister |= 0x40;
- } else {
- miscRegister &= (~0x40);
- }
-
- if (mode->Flags & V_NVSYNC) {
- miscRegister |= 0x80;
- } else {
- miscRegister &= (~0x80);
- }
-
- hwp->writeMiscOut(hwp, miscRegister);
-
- DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Exiting viaAnalogSyncPolarity.\n"));
-}
-
static void
via_analog_create_resources(xf86OutputPtr output)
@@ -241,7 +238,7 @@ via_analog_mode_set(xf86OutputPtr output, DisplayModePtr mode,
if (output->crtc) {
viaAnalogInit(pScrn);
- viaAnalogSyncPolarity(pScrn, adjusted_mode);
+ viaAnalogSyncPolarity(pScrn, mode->Flags);
viaAnalogSetDisplaySource(pScrn, iga->index ? 0x01 : 0x00);
}
commit 8bfd744b25bb8cc562c7a4a958f7ea66a7aa46f1
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Apr 6 15:22:00 2017 -0700
Added viaAnalogSetSyncPolarity
This inline function was added to via_ums.h.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/src/via_ums.h b/src/via_ums.h
index e2bea9b..78a12b6 100644
--- a/src/via_ums.h
+++ b/src/via_ums.h
@@ -226,6 +226,28 @@ viaAnalogSetDACOutput(ScrnInfoPtr pScrn, Bool outputState)
outputState ? "On" : "Off");
}
+static inline void
+viaAnalogSetSyncPolarity(ScrnInfoPtr pScrn, CARD8 syncPolarity)
+{
+ /* Set analog (VGA) sync polarity. */
+ /* 3C2[7] - Analog Vertical Sync Polarity
+ * 0: Positive
+ * 1: Negative
+ * 3C2[6] - Analog Horizontal Sync Polarity
+ * 0: Positive
+ * 1: Negative */
+ VGAHWPTR(pScrn)->writeMiscOut(VGAHWPTR(pScrn),
+ ((VGAHWPTR(pScrn)->readMiscOut(VGAHWPTR(pScrn)))
+ & ~((BIT(1) | BIT(0)) << 6))
+ | ((syncPolarity & (BIT(1) | BIT(0))) << 6));
+ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Analog (VGA) Horizontal Sync Polarity: %s\n",
+ (syncPolarity & BIT(0)) ? "-" : "+"));
+ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Analog (VGA) Vertical Sync Polarity: %s\n",
+ (syncPolarity & BIT(1)) ? "-" : "+"));
+}
+
/*
* Sets CX700 or later single chipset's LVDS1 power sequence type.
*/
commit 9e950885c24cc5ab71518a34b63361eeaece20cc
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Thu Apr 6 15:20:08 2017 -0700
Rename viaAnalogSetSyncPolarity as viaAnalogSyncPolarity
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/src/via_analog.c b/src/via_analog.c
index 7b2ee8f..a40d70c 100644
--- a/src/via_analog.c
+++ b/src/via_analog.c
@@ -130,13 +130,13 @@ viaAnalogInit(ScrnInfoPtr pScrn)
* synchronization.
*/
static void
-viaAnalogSetSyncPolarity(ScrnInfoPtr pScrn, DisplayModePtr mode)
+viaAnalogSyncPolarity(ScrnInfoPtr pScrn, DisplayModePtr mode)
{
vgaHWPtr hwp = VGAHWPTR(pScrn);
CARD8 miscRegister;
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Entered viaAnalogSetSyncPolarity.\n"));
+ "Entered viaAnalogSyncPolarity.\n"));
/* Set certain bits of miscellaneous output register
* meant for IGA1. */
@@ -156,7 +156,7 @@ viaAnalogSetSyncPolarity(ScrnInfoPtr pScrn, DisplayModePtr mode)
hwp->writeMiscOut(hwp, miscRegister);
DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Exiting viaAnalogSetSyncPolarity.\n"));
+ "Exiting viaAnalogSyncPolarity.\n"));
}
@@ -241,7 +241,7 @@ via_analog_mode_set(xf86OutputPtr output, DisplayModePtr mode,
if (output->crtc) {
viaAnalogInit(pScrn);
- viaAnalogSetSyncPolarity(pScrn, adjusted_mode);
+ viaAnalogSyncPolarity(pScrn, adjusted_mode);
viaAnalogSetDisplaySource(pScrn, iga->index ? 0x01 : 0x00);
}
More information about the Openchrome-devel
mailing list