Commit 3a6176e7 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/radeon: Use DIV_ROUND_UP()

Use DIV_ROUND_UP() instead of hand rolling it. Just a drive-by change.

Cc: Alex Deucher <alexander.deucher@amd.com>
Cc: "Christian König" <christian.koenig@amd.com>
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: default avatarAlex Deucher <alexander.deucher@amd.com>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Link: http://patchwork.freedesktop.org/patch/msgid/1479498793-31021-4-git-send-email-ville.syrjala@linux.intel.com
parent 489f3267
...@@ -477,9 +477,8 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc, ...@@ -477,9 +477,8 @@ int radeon_crtc_do_set_base(struct drm_crtc *crtc,
crtc_offset_cntl = 0; crtc_offset_cntl = 0;
pitch_pixels = target_fb->pitches[0] / (target_fb->bits_per_pixel / 8); pitch_pixels = target_fb->pitches[0] / (target_fb->bits_per_pixel / 8);
crtc_pitch = (((pitch_pixels * target_fb->bits_per_pixel) + crtc_pitch = DIV_ROUND_UP(pitch_pixels * target_fb->bits_per_pixel,
((target_fb->bits_per_pixel * 8) - 1)) / target_fb->bits_per_pixel * 8);
(target_fb->bits_per_pixel * 8));
crtc_pitch |= crtc_pitch << 16; crtc_pitch |= crtc_pitch << 16;
crtc_offset_cntl |= RADEON_CRTC_GUI_TRIG_OFFSET_LEFT_EN; crtc_offset_cntl |= RADEON_CRTC_GUI_TRIG_OFFSET_LEFT_EN;
......
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