diff mbox series

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

Message ID 1569242968-183093-2-git-send-email-hjc@rock-chips.com (mailing list archive)
State New, archived
Headers show
Series [01/36] drm/fourcc: Add 2 plane YCbCr 10bit format support | expand

Commit Message

黄家钗 Sept. 23, 2019, 12:49 p.m. UTC
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/zte/zx_plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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];