[PATCH 11/36] drm/armada: use bpp instead of cpp for drm_format_info

From: Sandy Huang
Date: Mon Sep 23 2019 - 08:56:07 EST


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

Signed-off-by: Sandy Huang <hjc@xxxxxxxxxxxxxx>
---
drivers/gpu/drm/armada/armada_fbdev.c | 2 +-
drivers/gpu/drm/armada/armada_plane.c | 6 +++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/armada/armada_fbdev.c b/drivers/gpu/drm/armada/armada_fbdev.c
index 090cc0d..a2e4344 100644
--- a/drivers/gpu/drm/armada/armada_fbdev.c
+++ b/drivers/gpu/drm/armada/armada_fbdev.c
@@ -88,7 +88,7 @@ static int armada_fbdev_create(struct drm_fb_helper *fbh,
drm_fb_helper_fill_info(info, fbh, sizes);

DRM_DEBUG_KMS("allocated %dx%d %dbpp fb: 0x%08llx\n",
- dfb->fb.width, dfb->fb.height, dfb->fb.format->cpp[0] * 8,
+ dfb->fb.width, dfb->fb.height, dfb->fb.format->bpp[0],
(unsigned long long)obj->phys_addr);

return 0;
diff --git a/drivers/gpu/drm/armada/armada_plane.c b/drivers/gpu/drm/armada/armada_plane.c
index e7cc2b3..fa400ac 100644
--- a/drivers/gpu/drm/armada/armada_plane.c
+++ b/drivers/gpu/drm/armada/armada_plane.c
@@ -46,13 +46,13 @@ void armada_drm_plane_calc(struct drm_plane_state *state, u32 addrs[2][3],
int i;

DRM_DEBUG_KMS("pitch %u x %d y %d bpp %d\n",
- fb->pitches[0], x, y, format->cpp[0] * 8);
+ fb->pitches[0], x, y, format->bpp[0]);

if (num_planes > 3)
num_planes = 3;

addrs[0][0] = addr + fb->offsets[0] + y * fb->pitches[0] +
- x * format->cpp[0];
+ x * format->bpp[0] / 8;
pitches[0] = fb->pitches[0];

y /= format->vsub;
@@ -60,7 +60,7 @@ void armada_drm_plane_calc(struct drm_plane_state *state, u32 addrs[2][3],

for (i = 1; i < num_planes; i++) {
addrs[0][i] = addr + fb->offsets[i] + y * fb->pitches[i] +
- x * format->cpp[i];
+ x * format->bpp[i] / 8;
pitches[i] = fb->pitches[i];
}
for (; i < 3; i++) {
--
2.7.4