Skip to content

Commit

Permalink
drm/i915: Optimize DIV_ROUND_CLOSEST call
Browse files Browse the repository at this point in the history
DIV_ROUND_CLOSEST is faster if the compiler knows it will only be
dealing with unsigned dividends. This optimization rips 32 bytes of
binary code on x86_64.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Guenter Roeck <linux@roeck-us.net>
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: David Airlie <airlied@linux.ie>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
  • Loading branch information
Jean Delvare authored and Daniel Vetter committed Nov 21, 2012
1 parent bf6f036 commit e3fef09
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/i915/intel_pm.c
Original file line number Diff line number Diff line change
Expand Up @@ -2552,7 +2552,8 @@ static void gen6_update_ring_freq(struct drm_device *dev)
{
struct drm_i915_private *dev_priv = dev->dev_private;
int min_freq = 15;
int gpu_freq, ia_freq, max_ia_freq;
int gpu_freq;
unsigned int ia_freq, max_ia_freq;
int scaling_factor = 180;

WARN_ON(!mutex_is_locked(&dev_priv->rps.hw_lock));
Expand Down

0 comments on commit e3fef09

Please sign in to comment.