From patchwork Wed Jul 25 03:08:07 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Herrenschmidt X-Patchwork-Id: 1234201 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-process-083081@patchwork1.kernel.org Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by patchwork1.kernel.org (Postfix) with ESMTP id 658F33FD4F for ; Wed, 25 Jul 2012 03:22:53 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2C42F9F0F1 for ; Tue, 24 Jul 2012 20:22:53 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 900 seconds by postgrey-1.32 at gabe; Wed, 25 Jul 2012 05:22:39 CEST Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by gabe.freedesktop.org (Postfix) with ESMTP id 274AD9E7C2 for ; Tue, 24 Jul 2012 20:22:39 -0700 (PDT) Received: from [127.0.0.1] (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.13.8) with ESMTP id q6P387II022487 for ; Tue, 24 Jul 2012 22:08:08 -0500 Message-ID: <1343185687.3715.36.camel@pasglop> Subject: [PATCH 4/6] drm/cirrus: Proper support for depth 15 and 16 From: Benjamin Herrenschmidt To: dri-devel@lists.freedesktop.org Date: Wed, 25 Jul 2012 13:08:07 +1000 X-Mailer: Evolution 3.2.3-0ubuntu6 Mime-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.13 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org Errors-To: dri-devel-bounces+patchwork-dri-devel=patchwork.kernel.org@lists.freedesktop.org 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) Signed-off-by: Benjamin Herrenschmidt --- drivers/gpu/drm/cirrus/cirrus_mode.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus_mode.c b/drivers/gpu/drm/cirrus/cirrus_mode.c index e3d2dc0..1566853 100644 --- a/drivers/gpu/drm/cirrus/cirrus_mode.c +++ b/drivers/gpu/drm/cirrus/cirrus_mode.c @@ -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;