Commit de45eaf7 authored by Paulo Zanoni's avatar Paulo Zanoni Committed by Daniel Vetter

drm/i915: fix open-coded DIV_ROUND_UP

Use the nice Kernel macro, it makes the code much more readable.
Signed-off-by: default avatarPaulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent dc39fff7
...@@ -261,7 +261,7 @@ i915_gem_dumb_create(struct drm_file *file, ...@@ -261,7 +261,7 @@ i915_gem_dumb_create(struct drm_file *file,
struct drm_mode_create_dumb *args) struct drm_mode_create_dumb *args)
{ {
/* have to work out size/pitch and return them */ /* have to work out size/pitch and return them */
args->pitch = ALIGN(args->width * ((args->bpp + 7) / 8), 64); args->pitch = ALIGN(args->width * DIV_ROUND_UP(args->bpp, 8), 64);
args->size = args->pitch * args->height; args->size = args->pitch * args->height;
return i915_gem_create(file, dev, return i915_gem_create(file, dev,
args->size, &args->handle); args->size, &args->handle);
......
...@@ -78,8 +78,8 @@ static int intelfb_create(struct drm_fb_helper *helper, ...@@ -78,8 +78,8 @@ static int intelfb_create(struct drm_fb_helper *helper,
mode_cmd.width = sizes->surface_width; mode_cmd.width = sizes->surface_width;
mode_cmd.height = sizes->surface_height; mode_cmd.height = sizes->surface_height;
mode_cmd.pitches[0] = ALIGN(mode_cmd.width * ((sizes->surface_bpp + 7) / mode_cmd.pitches[0] = ALIGN(mode_cmd.width *
8), 64); DIV_ROUND_UP(sizes->surface_bpp, 8), 64);
mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp, mode_cmd.pixel_format = drm_mode_legacy_fb_format(sizes->surface_bpp,
sizes->surface_depth); sizes->surface_depth);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment