@@ -81,7 +81,7 @@ rockchip_user_fb_create(struct drm_device *dev, struct drm_file *file_priv,
min_size = (height - 1) * mode_cmd->pitches[i] +
mode_cmd->offsets[i] +
- width * info->cpp[i];
+ width * info->bpp[i] / 8;
if (obj->size < min_size) {
drm_gem_object_put_unlocked(obj);
@@ -832,7 +832,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
dsp_sty = dest->y1 + crtc->mode.vtotal - crtc->mode.vsync_start;
dsp_st = dsp_sty << 16 | (dsp_stx & 0xffff);
- offset = (src->x1 >> 16) * fb->format->cpp[0];
+ offset = (src->x1 >> 16) * fb->format->bpp[0] / 8;
offset += (src->y1 >> 16) * fb->pitches[0];
dma_addr = rk_obj->dma_addr + offset + fb->offsets[0];
@@ -859,7 +859,7 @@ static void vop_plane_atomic_update(struct drm_plane *plane,
if (is_yuv) {
int hsub = fb->format->hsub;
int vsub = fb->format->vsub;
- int bpp = fb->format->cpp[1];
+ int bpp = fb->format->bpp[1] / 8;
uv_obj = fb->obj[1];
rk_uv_obj = to_rockchip_obj(uv_obj);
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/rockchip/rockchip_drm_fb.c | 2 +- drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-)