Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 9c350d83 authored by Daniel Kurtz's avatar Daniel Kurtz Committed by Sean Paul
Browse files

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: default avatarBibby Hsieh <bibby.hsieh@mediatek.com>
Signed-off-by: default avatarSean Paul <seanpaul@chromium.org>
Link: http://patchwork.freedesktop.org/patch/msgid/1470279597-60453-7-git-send-email-bibby.hsieh@mediatek.com
parent f176cbf6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;