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

Commit d642d3ac authored by Tomi Valkeinen's avatar Tomi Valkeinen
Browse files

drm/omap: fix align_pitch() for 24 bits per pixel



align_pitch() uses ALIGN() to ensure the pitch is aligned to SGX's
requirement of 8 pixels. However, ALIGN() expects the alignment value to
be a power of two, which is not the case for 24 bits per pixels.

Use roundup() instead, which works for all alignments.

This fixes the error seen with 24 bits per pixel modes:

"buffer pitch (2176 bytes) is not a multiple of pixel size (3 bytes)"

Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ti.com>
parent 393a949f
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -236,7 +236,7 @@ static inline int align_pitch(int pitch, int width, int bpp)
	/* PVR needs alignment to 8 pixels.. right now that is the most
	 * restrictive stride requirement..
	 */
	return ALIGN(pitch, 8 * bytespp);
	return roundup(pitch, 8 * bytespp);
}

/* map crtc to vblank mask */