diff options
author | Lucas Stach <l.stach@pengutronix.de> | 2014-01-10 19:17:29 +0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-01-14 03:11:51 +0400 |
commit | bc2b067aab5ae046cb7fdb49e8b90ada44a3d5b1 (patch) | |
tree | 1b2ac7df1daea616afd3a644cc6817003c548cc5 /drivers | |
parent | ee2e072e8443e48bf8e9059e47fe8890928028bb (diff) | |
download | linux-bc2b067aab5ae046cb7fdb49e8b90ada44a3d5b1.tar.xz |
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: Philipp Zabel <p.zabel@pengutronix.de>
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/staging/imx-drm/ipuv3-plane.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/staging/imx-drm/ipuv3-plane.c b/drivers/staging/imx-drm/ipuv3-plane.c index 685411ce6e39..2ef95162b3e9 100644 --- a/drivers/staging/imx-drm/ipuv3-plane.c +++ b/drivers/staging/imx-drm/ipuv3-plane.c @@ -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); |