[PATCH 17/36] drm/zte: use bpp instead of cpp for drm_format_info

From: Sandy Huang
Date: Mon Sep 23 2019 - 08:49:39 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/zte/zx_plane.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/zte/zx_plane.c b/drivers/gpu/drm/zte/zx_plane.c
index 086c50f..c265dd3 100644
--- a/drivers/gpu/drm/zte/zx_plane.c
+++ b/drivers/gpu/drm/zte/zx_plane.c
@@ -218,7 +218,7 @@ static void zx_vl_plane_atomic_update(struct drm_plane *plane,
cma_obj = drm_fb_cma_get_gem_obj(fb, i);
paddr = cma_obj->paddr + fb->offsets[i];
paddr += src_y * fb->pitches[i];
- paddr += src_x * fb->format->cpp[i];
+ paddr += src_x * fb->format->bpp[i] / 8;
zx_writel(paddr_reg, paddr);
paddr_reg += 4;
}
@@ -379,7 +379,7 @@ static void zx_gl_plane_atomic_update(struct drm_plane *plane,
dst_w = plane->state->crtc_w;
dst_h = plane->state->crtc_h;

- bpp = fb->format->cpp[0];
+ bpp = fb->format->bpp[0] / 8;

cma_obj = drm_fb_cma_get_gem_obj(fb, 0);
paddr = cma_obj->paddr + fb->offsets[0];
--
2.7.4