• Ville Syrjälä's avatar
    drm/i915: Use intel_gpu_freq() and intel_freq_opcode() · 7c59a9c1
    Ville Syrjälä authored
    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: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
    Reviewed-by: default avatarChris Wilson <chris@chris-wilson.co.uk>
    Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
    7c59a9c1
i915_drv.h 99.6 KB