diff mbox series

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

Message ID 1569242769-182724-1-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:46 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/sun4i/sun8i_ui_layer.c | 2 +-
 drivers/gpu/drm/sun4i/sun8i_vi_layer.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

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 */