Skip to content

Commit 2b932d8

Browse files
author
David Herrmann
committed
drm/udl: fix Bpp calculation in dumb_create()
Probably a typo.. we obviously need "(bpp + 7) / 8" instead of "(bpp + 1) / 8". Unlikely to be hit in any sane code, but lets be safe. Use DIV_ROUND_UP() to avoid the problem entirely and make the core more readable. Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: David Herrmann <dh.herrmann@gmail.com>
1 parent 06c9916 commit 2b932d8

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎drivers/gpu/drm/udl/udl_gem.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ int udl_dumb_create(struct drm_file *file,
6060
struct drm_device *dev,
6161
struct drm_mode_create_dumb *args)
6262
{
63-
args->pitch = args->width * ((args->bpp + 1) / 8);
63+
args->pitch = args->width * DIV_ROUND_UP(args->bpp, 8);
6464
args->size = args->pitch * args->height;
6565
return udl_gem_create(file, dev,
6666
args->size, &args->handle);

0 commit comments

Comments
 (0)