[Openchrome-devel] drm-openchrome: drivers/gpu/drm
James Simmons
jsimmons at kemper.freedesktop.org
Wed May 22 08:00:49 PDT 2013
drivers/gpu/drm/via/via_crtc.c | 19 ++++++++++++++++++-
1 file changed, 18 insertions(+), 1 deletion(-)
New commits:
commit 1918344f9c8e5355a5642c86d3bf33405860d11c
Author: James Simmons <jsimmons at infradead.org>
Date: Wed May 22 11:00:37 2013 -0400
For newer platforms we need to explicatly set the LUT to 8 bits in size
diff --git a/drivers/gpu/drm/via/via_crtc.c b/drivers/gpu/drm/via/via_crtc.c
index c923936..10a5017 100644
--- a/drivers/gpu/drm/via/via_crtc.c
+++ b/drivers/gpu/drm/via/via_crtc.c
@@ -254,10 +254,27 @@ via_iga2_gamma_set(struct drm_crtc *crtc, u16 *red, u16 *green, u16 *blue,
/* access Primary Display's LUT */
vga_wseq(VGABASE, 0x1A, sr1a & 0xFE);
} else {
+ u8 reg_bits = BIT(1);
+
svga_wseq_mask(VGABASE, 0x1A, BIT(0), BIT(0));
- /* Enable Gamma */
+ /* Bit 1 enables gamma */
svga_wcrt_mask(VGABASE, 0x6A, BIT(1), BIT(1));
+ /* Old platforms LUT are 6 bits in size.
+ * Newer it is 8 bits. */
+ switch (crtc->dev->pdev->device) {
+ case PCI_DEVICE_ID_VIA_CLE266:
+ case PCI_DEVICE_ID_VIA_KM400:
+ case PCI_DEVICE_ID_VIA_K8M800:
+ case PCI_DEVICE_ID_VIA_PM800:
+ break;
+
+ default:
+ reg_bits |= BIT(5);
+ break;
+ }
+ svga_wcrt_mask(VGABASE, 0x6A, reg_bits, reg_bits);
+
/* Before we fill the second LUT, we have to enable
* second display channel. If it's enabled before,
* we don't need to do that, or else the secondary
More information about the Openchrome-devel
mailing list