summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/omapdrm/omap_gem.c
diff options
context:
space:
mode:
authorTomi Valkeinen <tomi.valkeinen@ti.com>2016-04-19 08:06:32 +0200
committerTomi Valkeinen <tomi.valkeinen@ti.com>2016-06-06 09:14:27 +0200
commitce481edad41098b535c15661e2e47a0934a24a7a (patch)
tree1bd71d6eb40430fbffe0e1975e354b807ffd9b45 /drivers/gpu/drm/omapdrm/omap_gem.c
parentdrm/omap: remove align_pitch() (diff)
downloadlinux-ce481edad41098b535c15661e2e47a0934a24a7a.tar.xz
linux-ce481edad41098b535c15661e2e47a0934a24a7a.zip
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_gem.c')
-rw-r--r--drivers/gpu/drm/omapdrm/omap_gem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/omapdrm/omap_gem.c b/drivers/gpu/drm/omapdrm/omap_gem.c
index ea94aadb279d..ec996c752160 100644
--- a/drivers/gpu/drm/omapdrm/omap_gem.c
+++ b/drivers/gpu/drm/omapdrm/omap_gem.c
@@ -661,7 +661,7 @@ int omap_gem_dumb_create(struct drm_file *file, struct drm_device *dev,
{
union omap_gem_size gsize;
- args->pitch = args->width * DIV_ROUND_UP(args->bpp, 8);
+ args->pitch = DIV_ROUND_UP(args->width * args->bpp, 8);
args->size = PAGE_ALIGN(args->pitch * args->height);