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

Commit bc2b067a authored by Lucas Stach's avatar Lucas Stach Committed by Greg Kroah-Hartman
Browse files

staging: drm/imx: handle framebuffer offsets correctly



We didn't take the pixel format into account, so x-direction
offsets were off by a factor of 2 or 4 for 16bpp and 32bpp
framebuffers.

Signed-off-by: default avatarPhilipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: default avatarLucas Stach <l.stach@pengutronix.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent ee2e072e
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -78,7 +78,8 @@ int ipu_plane_set_base(struct ipu_plane *ipu_plane, struct drm_framebuffer *fb,
	cpmem = ipu_get_cpmem(ipu_plane->ipu_ch);
	ipu_cpmem_set_stride(cpmem, fb->pitches[0]);

	eba = cma_obj->paddr + fb->offsets[0] + fb->pitches[0] * y + x;
	eba = cma_obj->paddr + fb->offsets[0] +
	      fb->pitches[0] * y + (fb->bits_per_pixel >> 3) * x;
	ipu_cpmem_set_buffer(cpmem, 0, eba);
	ipu_cpmem_set_buffer(cpmem, 1, eba);