From patchwork Mon Sep 23 12:47:39 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: 11156757 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 B63D9912 for ; Mon, 23 Sep 2019 12:48:29 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 9208120820 for ; Mon, 23 Sep 2019 12:48:29 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ktYLGRaU" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 9208120820 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=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=74VMqdyKpJNjIoQF868bwJN4Xz0w8Llf1YviGWyaiuY=; b=ktYLGRaUPPpKIQzsUSpClPnCvr VffRGWvkR2Zv2UJpk0a0+8IuDtbDmocwQAXAA3NZav0O31WxUdfasx/gkJg/yBryBasBurLIfQ9jy u+03P004NjqanbkCh7TqRZzlY/l+Cyt8yqAa9aHpvF5sP1KcLllvFJF4frs+90ArpsaAmuBpL0TbJ 6gXNsjVtDDap43ZonJxNyH23lXjsf890rJDY5MC0iRWoWqBvX0vPwI45C/Z/uxvzsuUsNrAT2Gu2e 0MFQ2gfTzbPHdnxGBGQTUU4vZJATf+OGCOYrJSYUdH/AwOJr7ZrRdq13xoYDHOpb00mNdNhYlrOiF 5yqQDktg==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.2 #3 (Red Hat Linux)) id 1iCNlV-0006cO-54; Mon, 23 Sep 2019 12:48:29 +0000 Received: from lucky1.263xmail.com ([211.157.147.131]) by bombadil.infradead.org with esmtps (Exim 4.92.2 #3 (Red Hat Linux)) id 1iCNlR-0006bY-Sx; Mon, 23 Sep 2019 12:48:27 +0000 Received: from localhost (unknown [192.168.167.227]) by lucky1.263xmail.com (Postfix) with ESMTP id DE03566909; Mon, 23 Sep 2019 20:48:21 +0800 (CST) X-MAIL-GRAY: 0 X-MAIL-DELIVERY: 1 X-ADDR-CHECKED4: 1 X-ANTISPAM-LEVEL: 2 X-ABS-CHECKED: 0 Received: from localhost.localdomain (unknown [58.22.7.114]) by smtp.263.net (postfix) whith ESMTP id P14169T140710336407296S1569242883858959_; Mon, 23 Sep 2019 20:48:21 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <029ba5340883946e18a39005adc9a83e> 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, CK Hu , Philipp Zabel , David Airlie , Daniel Vetter , Matthias Brugger Subject: [PATCH 15/36] drm/mediatek: use bpp instead of cpp for drm_format_info Date: Mon, 23 Sep 2019 20:47:39 +0800 Message-Id: <1569242880-182878-5-git-send-email-hjc@rock-chips.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1569242880-182878-1-git-send-email-hjc@rock-chips.com> References: <1569242880-182878-1-git-send-email-hjc@rock-chips.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20190923_054826_159003_93BC2AA4 X-CRM114-Status: GOOD ( 11.64 ) X-Spam-Score: 1.5 (+) X-Spam-Report: SpamAssassin version 3.4.2 on bombadil.infradead.org summary: Content analysis details: (1.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 1.5 RCVD_IN_SORBS_WEB RBL: SORBS: sender is an abusable web server [58.22.7.114 listed in dnsbl.sorbs.net] -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [211.157.147.131 listed in list.dnswl.org] 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 T_SPF_PERMERROR SPF: test of record failed (permerror) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-mediatek@lists.infradead.org, hjc@rock-chips.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org 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/mediatek/mtk_drm_fb.c | 2 +- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/mediatek/mtk_drm_fb.c b/drivers/gpu/drm/mediatek/mtk_drm_fb.c index 3f230a2..fd80548 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_fb.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_fb.c @@ -69,7 +69,7 @@ struct drm_framebuffer *mtk_drm_mode_fb_create(struct drm_device *dev, if (!gem) return ERR_PTR(-ENOENT); - bpp = info->cpp[0]; + bpp = info->bpp[0] / 8; size = (height - 1) * cmd->pitches[0] + width * bpp; size += cmd->offsets[0]; diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c index 584a9ec..97d38db 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c @@ -121,7 +121,7 @@ static void mtk_plane_atomic_update(struct drm_plane *plane, pitch = fb->pitches[0]; format = fb->format->format; - addr += (plane->state->src.x1 >> 16) * fb->format->cpp[0]; + addr += (plane->state->src.x1 >> 16) * fb->format->bpp[0] / 8; addr += (plane->state->src.y1 >> 16) * pitch; state->pending.enable = true;