summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/omapdrm/omap_fbdev.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-04-19 09:06:32 +0300
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-06 10:14:27 +0300
commitce481edad41098b535c15661e2e47a0934a24a7a (patch)
tree1bd71d6eb40430fbffe0e1975e354b807ffd9b45 /drivers/gpu/drm/omapdrm/omap_fbdev.c
parent6a5228fdf0a4636fdf5ce616c35264e0c0b26c7c (diff)
downloadlinux-ce481edad41098b535c15661e2e47a0934a24a7a.tar.xz
drm/omap: fix pitch round-up
At the moment we calculate the buffer's pitch with: pitch = width * DIV_ROUND_UP(bpp, 8) For CLUT modes with bpp of 1/2/4/8 this gives wrong result, and the correct pitch is: pitch = DIV_ROUND_UP(width * bpp, 8) In practice this doesn't change anything, as we don't support CLUT modes, but it's better to have the pitch calculation correct. Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com> Acked-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Diffstat (limited to 'drivers/gpu/drm/omapdrm/omap_fbdev.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_fbdev.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_fbdev.c b/drivers/gpu/drm/omapdrm/omap_fbdev.c
index 372673712843..31dfa0893416 100644
--- a/drivers/gpu/drm/omapdrm/omap_fbdev.c
+++ b/drivers/gpu/drm/omapdrm/omap_fbdev.c
@@ -125,8 +125,8 @@ static int omap_fbdev_create(struct drm_fb_helper *helper,
mode_cmd.width = sizes->surface_width;
mode_cmd.height = sizes->surface_height;
- mode_cmd.pitches[0] = mode_cmd.width *
- DIV_ROUND_UP(sizes->surface_bpp, 8);
+ mode_cmd.pitches[0] =
+ DIV_ROUND_UP(mode_cmd.width * sizes->surface_bpp, 8);
fbdev->ywrap_enabled = priv->has_dmm && ywrap_enabled;
if (fbdev->ywrap_enabled) {