From patchwork Mon Sep 23 12:51:46 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?b?6buE5a626ZKX?= X-Patchwork-Id: 11156789 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6251517D4 for ; Mon, 23 Sep 2019 12:52:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4AA6920835 for ; Mon, 23 Sep 2019 12:52:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4AA6920835 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=rock-chips.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ADC236E8BA; Mon, 23 Sep 2019 12:52:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from regular1.263xmail.com (regular1.263xmail.com [211.150.70.204]) by gabe.freedesktop.org (Postfix) with ESMTPS id CBFFD6E8BA for ; Mon, 23 Sep 2019 12:52:24 +0000 (UTC) Received: from hjc?rock-chips.com (unknown [192.168.167.128]) by regular1.263xmail.com (Postfix) with ESMTP id 773B922F; Mon, 23 Sep 2019 20:52:22 +0800 (CST) X-263anti-spam: KSV:0;BIG:0; X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-KSVirus-check: 0 X-ADDR-CHECKED4: 1 X-ABS-CHECKED: 1 X-SKE-CHECKED: 1 X-ANTISPAM-LEVEL: 2 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P15436T140160991741696S1569243121384240_; Mon, 23 Sep 2019 20:52:21 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <100cee606d44a935076a63a8b3b5c1cb> X-RL-SENDER: hjc@rock-chips.com X-SENDER: hjc@rock-chips.com X-LOGIN-NAME: hjc@rock-chips.com X-FST-TO: dri-devel@lists.freedesktop.org X-SENDER-IP: 58.22.7.114 X-ATTACHMENT-NUM: 0 X-DNS-TYPE: 0 From: Sandy Huang To: dri-devel@lists.freedesktop.org, Dave Airlie , Gerd Hoffmann , David Airlie , Daniel Vetter , =?utf-8?q?Noralf_Tr=C3=B8nnes?= , Sam Ravnborg , Sandy Huang Subject: [PATCH 23/36] drm/cirrus: use bpp instead of cpp for drm_format_info Date: Mon, 23 Sep 2019 20:51:46 +0800 Message-Id: <1569243119-183293-3-git-send-email-hjc@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1569243119-183293-1-git-send-email-hjc@rock-chips.com> References: <1569243119-183293-1-git-send-email-hjc@rock-chips.com> X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Daniel Vetter , virtualization@lists.linux-foundation.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" cpp[BytePerPlane] can't describe the 10bit data format correctly, So we use bpp[BitPerPlane] to instead cpp. Signed-off-by: Sandy Huang --- drivers/gpu/drm/cirrus/cirrus.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/cirrus/cirrus.c b/drivers/gpu/drm/cirrus/cirrus.c index 89d9e6f..ba47fdf 100644 --- a/drivers/gpu/drm/cirrus/cirrus.c +++ b/drivers/gpu/drm/cirrus/cirrus.c @@ -121,7 +121,7 @@ static void wreg_hdr(struct cirrus_device *cirrus, u8 val) static int cirrus_convert_to(struct drm_framebuffer *fb) { - if (fb->format->cpp[0] == 4 && fb->pitches[0] > CIRRUS_MAX_PITCH) { + if (fb->format->bpp[0] == 32 && fb->pitches[0] > CIRRUS_MAX_PITCH) { if (fb->width * 3 <= CIRRUS_MAX_PITCH) /* convert from XR24 to RG24 */ return 3; @@ -138,7 +138,7 @@ static int cirrus_cpp(struct drm_framebuffer *fb) if (convert_cpp) return convert_cpp; - return fb->format->cpp[0]; + return fb->format->bpp[0] / 8; } static int cirrus_pitch(struct drm_framebuffer *fb) @@ -306,16 +306,16 @@ static int cirrus_fb_blit_rect(struct drm_framebuffer *fb, if (!vmap) return -ENOMEM; - if (cirrus->cpp == fb->format->cpp[0]) + if (cirrus->cpp == fb->format->bpp[0] / 8) drm_fb_memcpy_dstclip(cirrus->vram, vmap, fb, rect); - else if (fb->format->cpp[0] == 4 && cirrus->cpp == 2) + else if (fb->format->bpp[0] == 32 && cirrus->cpp == 2) drm_fb_xrgb8888_to_rgb565_dstclip(cirrus->vram, cirrus->pitch, vmap, fb, rect, false); - else if (fb->format->cpp[0] == 4 && cirrus->cpp == 3) + else if (fb->format->bpp[0] == 32 && cirrus->cpp == 3) drm_fb_xrgb8888_to_rgb888_dstclip(cirrus->vram, cirrus->pitch, vmap, fb, rect);