[PATCH 05/36] drm/sun4i: use bpp instead of cpp for drm_format_info

From: Sandy Huang
Date: Mon Sep 23 2019 - 08:46:21 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/sun4i/sun8i_ui_layer.c | 2 +-
drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
index c87fd84..147e251 100644
--- a/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_ui_layer.c
@@ -211,7 +211,7 @@ static int sun8i_ui_layer_update_buffer(struct sun8i_mixer *mixer, int channel,
DRM_DEBUG_DRIVER("Using GEM @ %pad\n", &gem->paddr);

/* Compute the start of the displayed memory */
- bpp = fb->format->cpp[0];
+ bpp = fb->format->bpp[0] / 8;
paddr = gem->paddr + fb->offsets[0];

/* Fixup framebuffer address for src coordinates */
diff --git a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
index 42d445d..dd777aa 100644
--- a/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
+++ b/drivers/gpu/drm/sun4i/sun8i_vi_layer.c
@@ -295,7 +295,7 @@ static int sun8i_vi_layer_update_buffer(struct sun8i_mixer *mixer, int channel,
}

/* Fixup framebuffer address for src coordinates */
- paddr += dx * format->cpp[i];
+ paddr += dx * format->bpp[i] / 8;
paddr += dy * fb->pitches[i];

/* Set the line width */
--
2.7.4