[Openchrome-devel] xf86-video-openchrome: 3 commits - src/via_display.c
Kevin Brace
kevinbrace at kemper.freedesktop.org
Sun May 22 13:59:54 UTC 2016
src/via_display.c | 44 +++++++++++++++++++++++++++++++++++---------
1 file changed, 35 insertions(+), 9 deletions(-)
New commits:
commit c68602c24290361a0e170d15eb4c68b8a2d2c50b
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sun May 22 06:58:32 2016 -0700
Cleanup of the code that sets IGA1 horizontal blank end
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 56ff2e9..9a0e65e 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -480,14 +480,24 @@ viaIGA1SetDisplayRegister(ScrnInfoPtr pScrn, DisplayModePtr mode)
hwp->writeCrtc(hwp, 0x02, temp & 0xFF);
- /* horizontal blanking end : start + 1025 */
- /* temp = (mode->CrtcHTotal >> 3) - 1; */
+ /* Set IGA1 horizontal blank end. */
+ /* After shifting horizontal blank end by 3 bit positions to the
+ * right, the 7 least significant bits are actually used.
+ * In addition to that, this particular register requires the
+ * value to be 1 less than the actual value being written. */
+ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "IGA1 CrtcHBlankEnd: %d\n", mode->CrtcHBlankEnd));
temp = (mode->CrtcHBlankEnd >> 3) - 1;
+
+ /* 3X5.03[4:0] - Horizontal Blanking End Bits [4:0] */
ViaCrtcMask(hwp, 0x03, temp, 0x1F);
+
+ /* 3X5.05[7] - Horizontal Blanking End Bit [5] */
ViaCrtcMask(hwp, 0x05, temp << 2, 0x80);
+
+ /* 3X5.33[5] - Horizontal Blanking End Bit [6] */
ViaCrtcMask(hwp, 0x33, temp >> 1, 0x20);
- /* CrtcHSkew ??? */
/* horizontal sync start : 4095 */
temp = mode->CrtcHSyncStart >> 3;
commit d48ca55219d935d7d3cd21d342a9d4316a27dd3c
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sun May 22 04:32:38 2016 -0700
Cleanup of the code that sets IGA1 horizontal blank start
There is no need for subtracting one from this value, so this
practice was discontinued. 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 91dfc50..56ff2e9 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -468,11 +468,17 @@ viaIGA1SetDisplayRegister(ScrnInfoPtr pScrn, DisplayModePtr mode)
hwp->writeCrtc(hwp, 0x01, temp & 0xFF);
- /* horizontal blanking start : 2048 */
- /* temp = (mode->CrtcHDisplay >> 3) - 1; */
- temp = (mode->CrtcHBlankStart >> 3) - 1;
- hwp->writeCrtc(hwp, 0x02, temp & 0xFF);
- /* If HblankStart has more bits anywhere, add them here */
+ /* Set IGA1 horizontal blank start. */
+ /* Due to IGA1 horizontal blank start being only 8 bits wide,
+ * the adjusted horizontal blank start needs to be shifted by
+ * 3 bit positions to the right. */
+ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "IGA1 CrtcHBlankStart: %d\n", mode->CrtcHBlankStart));
+ temp = mode->CrtcHBlankStart >> 3;
+
+ /* 3X5.02[7:0] - Horizontal Blanking Start Bits [7:0] */
+ hwp->writeCrtc(hwp, 0x02, temp & 0xFF);
+
/* horizontal blanking end : start + 1025 */
/* temp = (mode->CrtcHTotal >> 3) - 1; */
commit 40f4603c447670c4e4054c50a49abce887eebe8e
Author: Kevin Brace <kevinbrace at gmx.com>
Date: Sun May 22 04:02:27 2016 -0700
Cleanup of the code that sets IGA1 horizontal display end
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 b2d8b60..91dfc50 100644
--- a/src/via_display.c
+++ b/src/via_display.c
@@ -454,10 +454,20 @@ viaIGA1SetDisplayRegister(ScrnInfoPtr pScrn, DisplayModePtr mode)
ViaCrtcMask(hwp, 0x36, temp >> 5, 0x08);
- /* horizontal address : 2048 */
+ /* Set IGA1 horizontal display end. */
+ /* Due to IGA1 horizontal display end being only 8 bits wide,
+ * the adjusted horizontal display end needs to be shifted by
+ * 3 bit positions to the right.
+ * In addition to that, this particular register requires the
+ * value to be 1 less than the actual value being written. */
+ DEBUG(xf86DrvMsg(pScrn->scrnIndex, X_INFO,
+ "IGA1 CrtcHDisplay: %d\n", mode->CrtcHDisplay));
temp = (mode->CrtcHDisplay >> 3) - 1;
+
+ /* 3X5.01[7:0] - Horizontal Display End Bits [7:0] */
hwp->writeCrtc(hwp, 0x01, temp & 0xFF);
+
/* horizontal blanking start : 2048 */
/* temp = (mode->CrtcHDisplay >> 3) - 1; */
temp = (mode->CrtcHBlankStart >> 3) - 1;
More information about the Openchrome-devel
mailing list