From patchwork Mon Sep 23 12:51:44 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: 11156787 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 3B4CF17D4 for ; Mon, 23 Sep 2019 12:52:13 +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 2226420835 for ; Mon, 23 Sep 2019 12:52:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2226420835 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 688C06E8B7; Mon, 23 Sep 2019 12:52:12 +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.203]) by gabe.freedesktop.org (Postfix) with ESMTPS id EAF516E8BA for ; Mon, 23 Sep 2019 12:52:08 +0000 (UTC) Received: from hjc?rock-chips.com (unknown [192.168.167.128]) by regular1.263xmail.com (Postfix) with ESMTP id F0E4C3D0; Mon, 23 Sep 2019 20:52:06 +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:02 +0800 (CST) X-IP-DOMAINF: 1 X-UNIQUE-TAG: <72d6911f116111fd1e7e8d64ada32099> 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, Eric Anholt , David Airlie , Daniel Vetter Subject: [PATCH 21/36] drm/vc4: use bpp instead of cpp for drm_format_info Date: Mon, 23 Sep 2019 20:51:44 +0800 Message-Id: <1569243119-183293-1-git-send-email-hjc@rock-chips.com> X-Mailer: git-send-email 2.7.4 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: 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/vc4/vc4_plane.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c index 5e5f908..ad2b0ec 100644 --- a/drivers/gpu/drm/vc4/vc4_plane.c +++ b/drivers/gpu/drm/vc4/vc4_plane.c @@ -531,7 +531,7 @@ static void vc4_plane_calc_load(struct drm_plane_state *state) vc4_state->crtc_h); vc4_state->membus_load += vc4_state->src_w[i] * vc4_state->src_h[i] * vscale_factor * - fb->format->cpp[i]; + fb->format->bpp[i] / 8; vc4_state->hvs_load += vc4_state->crtc_h * vc4_state->crtc_w; } @@ -646,7 +646,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane, vc4_state->offsets[i] += vc4_state->src_x / (i ? h_subsample : 1) * - fb->format->cpp[i]; + fb->format->bpp[i] / 8; } break; @@ -654,7 +654,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane, case DRM_FORMAT_MOD_BROADCOM_VC4_T_TILED: { u32 tile_size_shift = 12; /* T tiles are 4kb */ /* Whole-tile offsets, mostly for setting the pitch. */ - u32 tile_w_shift = fb->format->cpp[0] == 2 ? 6 : 5; + u32 tile_w_shift = fb->format->bpp[0] == 16 ? 6 : 5; u32 tile_h_shift = 5; /* 16 and 32bpp are 32 pixels high */ u32 tile_w_mask = (1 << tile_w_shift) - 1; /* The height mask on 32-bit-per-pixel tiles is 63, i.e. twice @@ -749,7 +749,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane, return -EINVAL; } - pix_per_tile = tile_w / fb->format->cpp[0]; + pix_per_tile = tile_w / (fb->format->bpp[0] / 8); tile = vc4_state->src_x / pix_per_tile; x_off = vc4_state->src_x % pix_per_tile; @@ -763,7 +763,7 @@ static int vc4_plane_mode_set(struct drm_plane *plane, tile_w; vc4_state->offsets[i] += x_off / (i ? h_subsample : 1) * - fb->format->cpp[i]; + fb->format->bpp[i] / 8; } pitch0 = VC4_SET_FIELD(param, SCALER_TILE_HEIGHT);