Skip to content

Commit

Permalink
drm/armada: fix YUV planar format framebuffer offsets
Browse files Browse the repository at this point in the history
We weren't correctly calculating the YUV planar offsets for subsampled
chroma planes correctly - fix up the coordinates for planes 1 and 2.

Signed-off-by: Russell King <rmk+kernel@armlinux.org.uk>
  • Loading branch information
Russell King committed Dec 8, 2017
1 parent d6a4896 commit de0ea9a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/gpu/drm/armada/armada_crtc.c
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,13 @@ void armada_drm_plane_calc_addrs(u32 *addrs, struct drm_framebuffer *fb,
if (num_planes > 3)
num_planes = 3;

for (i = 0; i < num_planes; i++)
addrs[0] = addr + fb->offsets[0] + y * fb->pitches[0] +
x * format->cpp[0];

y /= format->vsub;
x /= format->hsub;

for (i = 1; i < num_planes; i++)
addrs[i] = addr + fb->offsets[i] + y * fb->pitches[i] +
x * format->cpp[i];
for (; i < 3; i++)
Expand Down

0 comments on commit de0ea9a

Please sign in to comment.