aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/mediatek/mtk_drm_plane.c
diff options
context:
space:
mode:
authorDaniel Kurtz <djkurtz@chromium.org>2016-08-04 10:59:56 +0800
committerSean Paul <seanpaul@chromium.org>2016-08-08 14:20:02 -0400
commit9c350d834f08407d8470b3c09bbc34e42d261362 (patch)
tree3183901d1ecb03fea43b755761893ea5dc8d4af2 /drivers/gpu/drm/mediatek/mtk_drm_plane.c
parentdrm/mediatek: plane: Merge mtk_plane_enable into mtk_plane_atomic_update (diff)
downloadlinux-dev-9c350d834f08407d8470b3c09bbc34e42d261362.tar.xz
linux-dev-9c350d834f08407d8470b3c09bbc34e42d261362.zip
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 <bibby.hsieh@mediatek.com> Signed-off-by: Sean Paul <seanpaul@chromium.org> Link: http://patchwork.freedesktop.org/patch/msgid/1470279597-60453-7-git-send-email-bibby.hsieh@mediatek.com
Diffstat (limited to 'drivers/gpu/drm/mediatek/mtk_drm_plane.c')
-rw-r--r--drivers/gpu/drm/mediatek/mtk_drm_plane.c2
1 files changed, 1 insertions, 1 deletions
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;