Skip to contentSkip to conversation

drm/cirrus: Proper support for depth 15 and 16

PATCH New Benjamin Herrenschmidt 1 participant 1 message Jul 25, 2012

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 4/6 drm/cirrus: Proper support for depth 15 and 16

We were configuring SR7 very strangely for 16bpp and didn't properly differenciate between depth 15 and 16. This fixes it (and both appear to work at least on ppc)

---
 drivers/gpu/drm/cirrus/cirrus_mode.c |    5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
drivers/gpu/drm/cirrus/cirrus_mode.c +3 -2
index e3d2dc0..1566853 100644
@@ -269,13 +269,14 @@ static int cirrus_crtc_mode_set(struct drm_crtc *crtc,
 	sr07 = RREG8(SEQ_DATA);
 	sr07 &= 0xe0;
 	hdr = 0;
+
 	switch (crtc->fb->bits_per_pixel) {
 	case 8:
 		sr07 |= 0x11;
 		break;
 	case 16:
-		sr07 |= 0xc1;
-		hdr = 0xc0;
+		sr07 |= 0x17;
+		hdr = (crtc->fb->depth == 16) ? 0xc1 : 0xc0;
 		break;
 	case 24:
 		sr07 |= 0x15;