@@ -69,7 +69,7 @@ struct drm_framebuffer *mtk_drm_mode_fb_create(struct drm_device *dev,
if (!gem)
return ERR_PTR(-ENOENT);
- bpp = info->cpp[0];
+ bpp = info->bpp[0] / 8;
size = (height - 1) * cmd->pitches[0] + width * bpp;
size += cmd->offsets[0];
@@ -121,7 +121,7 @@ static void mtk_plane_atomic_update(struct drm_plane *plane,
pitch = fb->pitches[0];
format = fb->format->format;
- addr += (plane->state->src.x1 >> 16) * fb->format->cpp[0];
+ addr += (plane->state->src.x1 >> 16) * fb->format->bpp[0] / 8;
addr += (plane->state->src.y1 >> 16) * pitch;
state->pending.enable = true;
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/mediatek/mtk_drm_fb.c | 2 +- drivers/gpu/drm/mediatek/mtk_drm_plane.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)