[Openchrome-devel] [PATCH 1/2] via: fix line compare

Ondrej Zary linux
Thu Aug 16 03:27:21 PDT 2012


Line compare register writes are obviously wrong:

Register 0x33 is written with value 0x05 using mask 0x06
It causes left side of the screen to be garbled and shifted right
at least on K8M890CE.

Register 0x09 is written using mask 0xff, overwriting bit 5
(which is bit 9 of vblank_start register).
It causes blue horizontal bar on top of screen and blank bar in the middle
at least on K8M890CE.

Fix the writes to match viafb.

Signed-off-by: Ondrej Zary <linux at rainbow-software.org>

--- a/drivers/gpu/drm/via/via_display.c
+++ b/drivers/gpu/drm/via/via_display.c
@@ -678,11 +678,11 @@ via_crtc_mode_set(struct drm_crtc *crtc, struct 
drm_display_mode *mode,
 	/* line compare should set all bits = 1 (extend modes) */
 	svga_wcrt_mask(VGABASE, 0x07, BIT(4), BIT(4));
 	/* line compare should set all bits = 1 (extend modes) */
-	svga_wcrt_mask(VGABASE, 0x09, BIT(6), 0xFF);
+	svga_wcrt_mask(VGABASE, 0x09, BIT(6), BIT(6));
 	/* line compare should set all bits = 1 (extend modes) */
 	svga_wcrt_mask(VGABASE, 0x35, BIT(4), BIT(4));
 	/* line compare should set all bits = 1 (extend modes) */
-	svga_wcrt_mask(VGABASE, 0x33, 0x05, 0x06);
+	svga_wcrt_mask(VGABASE, 0x33, 0x06, 0x07);
 	/* extend mode always set to e3h */
 	vga_wcrt(VGABASE, 0x17, 0xE3);
 	/* extend mode always set to 0h */

-- 
Ondrej Zary




More information about the Openchrome-devel mailing list