[Intel-gfx] [PATCH 4/4] drm/i915: Use intel_gpu_freq() and intel_freq_opcode()

Chris Wilson chris at chris-wilson.co.uk
Sun Jan 25 01:35:33 PST 2015


On Fri, Jan 23, 2015 at 09:04:26PM +0200, ville.syrjala at linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala at linux.intel.com>
> 
> Replace all the vlv_gpu_freq(), vlv_freq_opcode(),
> *GT_FREQUENCY_MULTIPLIER, and /GT_FREQUENCY_MULTIPLIER instances
> with intel_gpu_freq() and intel_freq_opcode() calls.
> 
> Most of the change was performed with the following semantic patch:
> @@
> expression E;
> @@
> (
> - E * GT_FREQUENCY_MULTIPLIER
> + intel_gpu_freq(dev_priv, E)
> |
> - E *= GT_FREQUENCY_MULTIPLIER
> + E = intel_gpu_freq(dev_priv, E)
> |
> - E /= GT_FREQUENCY_MULTIPLIER
> + E = intel_freq_opcode(dev_priv, E)
> |
> - do_div(E, GT_FREQUENCY_MULTIPLIER)
> + E = intel_freq_opcode(dev_priv, E)
> )
> 
> @@
> expression E1, E2;
> @@
> (
> - vlv_gpu_freq(E1, E2)
> + intel_gpu_freq(E1, E2)
> |
> - vlv_freq_opcode(E1, E2)
> + intel_freq_opcode(E1, E2)
> )
> 
> @@
> expression E1, E2, E3, E4;
> @@
> (
> - if (IS_VALLEYVIEW(E1)) {
> -  E2 = intel_gpu_freq(E3, E4);
> - } else {
> -  E2 = intel_gpu_freq(E3, E4);
> - }
> + E2 = intel_gpu_freq(E3, E4);
> |
> - if (IS_VALLEYVIEW(E1)) {
> -  E2 = intel_freq_opcode(E3, E4);
> - } else {
> -  E2 = intel_freq_opcode(E3, E4);
> - }
> + E2 = intel_freq_opcode(E3, E4);
> )
> 
> One hunk was manually undone as intel_gpu_freq() ended up
> calling itself. Supposedly it would be possible to exclude
> certain functions via !=~, but I couldn't get that to work.
> 
> Also the removal of vlv_gpu_freq() and vlv_opcode_freq() compat
> wrappers was done manually.
> 
> Signed-off-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

Spot checked most,
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list