From: Daniel Kurtz Date: Thu, 4 Aug 2016 02:59:56 +0000 (+0800) Subject: drm/mediatek: plane: Use FB's format's cpp to compute x offset X-Git-Tag: MMI-PSA29.97-13-9~6932^2~43^2~18 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9c350d834f08407d8470b3c09bbc34e42d261362;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git drm/mediatek: plane: Use FB's format's cpp to compute x offset Use the framebuffer's format to compute its cpp, and use it when calculating the address shift value. Signed-off-by: Bibby Hsieh Signed-off-by: Sean Paul Link: http://patchwork.freedesktop.org/patch/msgid/1470279597-60453-7-git-send-email-bibby.hsieh@mediatek.com --- diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c index b3ddb20b2e58..c461a232cbf5 100644 --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c @@ -135,7 +135,7 @@ static void mtk_plane_atomic_update(struct drm_plane *plane, pitch = fb->pitches[0]; format = fb->pixel_format; - addr += (plane->state->src.x1 >> 16) * 4; + addr += (plane->state->src.x1 >> 16) * drm_format_plane_cpp(format, 0); addr += (plane->state->src.y1 >> 16) * pitch; state->pending.enable = true;