linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sandy Huang <hjc@rock-chips.com>
To: dri-devel@lists.freedesktop.org, Eric Anholt <eric@anholt.net>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>
Cc: hjc@rock-chips.com, linux-kernel@vger.kernel.org
Subject: [PATCH 21/36] drm/vc4: use bpp instead of cpp for drm_format_info
Date: Mon, 23 Sep 2019 20:51:44 +0800	[thread overview]
Message-ID: <1569243119-183293-1-git-send-email-hjc@rock-chips.com> (raw)

cpp[BytePerPlane] can't describe the 10bit data format correctly,
So we use bpp[BitPerPlane] to instead cpp.

Signed-off-by: Sandy Huang <hjc@rock-chips.com>
---
 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);
-- 
2.7.4




             reply	other threads:[~2019-09-23 12:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-09-23 12:51 Sandy Huang [this message]
2019-09-23 12:51 ` [PATCH 22/36] drm/atmel-hlcdc: use bpp instead of cpp for drm_format_info Sandy Huang
2019-09-23 17:31   ` Sam Ravnborg
2019-09-23 12:51 ` [PATCH 23/36] drm/cirrus: " Sandy Huang
2019-09-23 12:51 ` [PATCH 24/36] drm/hisilicon: " Sandy Huang
2019-09-23 12:51 ` [PATCH 25/36] drm/imx: " Sandy Huang

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1569243119-183293-1-git-send-email-hjc@rock-chips.com \
    --to=hjc@rock-chips.com \
    --cc=airlied@linux.ie \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=eric@anholt.net \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).