[Openchrome-devel] xf86-video-openchrome: 2 commits - src/via_display.c src/via_outputs.c
Kevin Brace
kevinbrace at kemper.freedesktop.org
Wed Jun 1 02:51:36 UTC 2016
src/via_display.c | 28 ++++++++++++++-----
src/via_outputs.c | 77 +++++++++++++++++++++++++++++++++---------------------
2 files changed, 68 insertions(+), 37 deletions(-)
New commits:
commit 906afd7c9e0ae213c34d7201158393e7c6904b63
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Tue May 31 19:50:42 2016 -0700
Cleanup of the code that sets IGA1 vertical blank start
viaIGA1SetDisplayRegister function contains the code in question.
This function is located inside via_display.c.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/src/via_display.c b/src/via_display.c
index 325698e..1975dfe 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -811,6 +811,26 @@ viaIGA1SetDisplayRegister(ScrnInfoPtr pScrn, DisplayModePtr mode)
ViaCrtcMask(hwp, 0x35, temp >> 8, 0x04);
+ /* Set IGA1 vertical blank start. */
+ /* Vertical blank start requires the value to be 1 less
+ * than the actual value being written. */
+ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "IGA1 CrtcVBlankStart: %d\n", mode->CrtcVBlankStart));
+ temp = mode->CrtcVBlankStart - 1;
+
+ /* 3X5.15[7:0] - Vertical Blanking Start Bits [7:0] */
+ hwp->writeCrtc(hwp, 0x15, temp & 0xFF);
+
+ /* 3X5.07[3] - Vertical Blanking Start Bit [8] */
+ ViaCrtcMask(hwp, 0x07, temp >> 5, 0x08);
+
+ /* 3X5.09[5] - Vertical Blanking Start Bit [9] */
+ ViaCrtcMask(hwp, 0x09, temp >> 4, 0x20);
+
+ /* 3X5.35[3] - Vertical Blanking Start Bit [10] */
+ ViaCrtcMask(hwp, 0x35, temp >> 7, 0x08);
+
+
/* vertical sync start : 2047 */
temp = mode->CrtcVSyncStart;
hwp->writeCrtc(hwp, 0x10, temp & 0xFF);
@@ -832,14 +852,6 @@ viaIGA1SetDisplayRegister(ScrnInfoPtr pScrn, DisplayModePtr mode)
ViaCrtcMask(hwp, 0x09, 0x00, 0x1F);
hwp->writeCrtc(hwp, 0x14, 0x00);
- /* vertical blanking start : 2048 */
- /* temp = mode->CrtcVDisplay - 1; */
- temp = mode->CrtcVBlankStart - 1;
- hwp->writeCrtc(hwp, 0x15, temp & 0xFF);
- ViaCrtcMask(hwp, 0x07, temp >> 5, 0x08);
- ViaCrtcMask(hwp, 0x09, temp >> 4, 0x20);
- ViaCrtcMask(hwp, 0x35, temp >> 7, 0x08);
-
/* vertical blanking end : start + 257 */
/* temp = mode->CrtcVTotal - 1; */
temp = mode->CrtcVBlankEnd - 1;
commit 81af8431ea9fcb6099513974a23bda7bbf493e9f
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Mon May 30 23:13:50 2016 -0700
Made code improvement to viaProbePinStrapping
The function is located inside via_outputs.c.
Signed-off-by: Kevin Brace <kevinbrace at gmx.com>
diff --git a/src/via_outputs.c b/src/via_outputs.c
index 133ee4a..2e3840f 100644
--- a/src/via_outputs.c
+++ b/src/via_outputs.c
@@ -995,7 +995,7 @@ via_dvi_init(ScrnInfoPtr pScrn)
}
/*
- * Read off the VIA Technologies IGP pin strapping for
+ * Reads off the VIA Technologies IGP pin strapping for
* display detection purposes.
*/
void
@@ -1009,7 +1009,7 @@ viaProbePinStrapping(ScrnInfoPtr pScrn)
"Entered viaProbePinStrapping.\n"));
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Probing VIA Technologies IGP pin strapping.\n");
+ "Probing VIA Technologies IGP pin strapping . . .\n");
if ((pVia->Chipset == VIA_CX700)
|| (pVia->Chipset == VIA_VX800)
@@ -1047,10 +1047,11 @@ viaProbePinStrapping(ScrnInfoPtr pScrn)
* 0 ~ 15: Flat panel code defined
* by VIA Technologies */
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Detected Flat Panel Type from Strapping Pins: %d\n", sr12 & 0x0F);
+ "Detected Flat Panel Type from "
+ "Strapping Pins: %d\n", sr12 & 0x0F);
} else {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "TMDS transmitter (DVI) / capture device is "
+ "A TMDS transmitter (DVI) / capture device is "
"connected to flat panel interface.\n");
}
@@ -1099,11 +1100,32 @@ viaProbePinStrapping(ScrnInfoPtr pScrn)
case VIA_PM800:
case VIA_P4M800PRO:
+ /* 3C5.12[6] - DVP0D6 pin strapping
+ * 0: Disable DVP0 (Digital Video Port 0) for
+ * DVI or TV out use
+ * 1: Enable DVP0 (Digital Video Port 0) for
+ * DVI or TV out use */
+ if (sr12 && 0x40) {
+
+ /* 3C5.12[5] - DVP0D5 pin strapping
+ * 0: TMDS transmitter (DVI)
+ * 1: TV encoder */
+ if (sr12 && 0x20) {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "A TV encoder is detected on "
+ "DVP0 (Digital Video Port 0).\n");
+ } else {
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "A TMDS transmitter (DVI) is detected on "
+ "DVP0 (Digital Video Port 0).\n");
+ }
+ }
+
+
/* 3C5.13[3] - DVP0D8 pin strapping
- * 0: AGP / PCI Express pins are used for
- * AGP / PCI Express
- * 1: AGP / PCI Express pins are used by
- * FPDP (Flat Panel Display Port) */
+ * 0: AGP pins are used for AGP
+ * 1: AGP pins are used by FPDP
+ * (Flat Panel Display Port) */
if (sr13 && 0x08) {
/* 3C5.12[4] - DVP0D4 pin strapping
@@ -1121,37 +1143,34 @@ viaProbePinStrapping(ScrnInfoPtr pScrn)
"Detected Flat Panel Type from "
"Strapping Pins: %d\n", sr12 & 0x0F);
} else {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "Dual 12-bit FPDP (Flat Panel Display Port) "
- "detected.\n");
- /* 3C5.12[5] - DVP0D5 pin strapping
- * 0: LVDS transmitter or TMDS transmitter (DVI)
+ /* 3C5.12[6] - DVP0D6 pin strapping
+ * 0: Disable DVP0 (Digital Video Port 0) for
+ * DVI or TV out use
+ * 1: Enable DVP0 (Digital Video Port 0) for
+ * DVI or TV out use
+ * 3C5.12[5] - DVP0D5 pin strapping
+ * 0: TMDS transmitter (DVI)
* 1: TV encoder */
- if (sr12 && 0x20) {
+ if ((!(sr12 && 0x40)) && (!(sr12 && 0x20))) {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "LVDS transmitter or TMDS transmitter "
- "(DVI) is connected to "
+ "A TV encoder is connected to "
"FPDP (Flat Panel Display Port).\n");
} else {
xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "TV encoder is connected to "
- "FPDP (Flat Panel Display Port).\n");
+ "Dual 12-bit FPDP (Flat Panel Display Port) "
+ "detected.\n");
+
+ /* 3C5.12[3:0] - DVP0D3-0 pin strapping
+ * 0 ~ 15: Flat panel code defined
+ * by VIA Technologies */
+ xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "Detected Flat Panel Type from "
+ "Strapping Pins: %d\n", sr12 & 0x0F);
}
}
}
- /* 3C5.12[6] - DVP0D6 pin strapping
- * 0: Disable a TV encoder support for DVP0
- * (Digital Video Port 0)
- * 1: Enable a TV encoder support for DVP0
- * (Digital Video Port 0) */
- if (sr12 && 0x40) {
- xf86DrvMsg(pScrn->scrnIndex, X_INFO,
- "TV encoder is connected to "
- "DVP0 (Digital Video Port 0).\n");
- }
-
break;
default:
More information about the Openchrome-devel
mailing list