Commit f18020a5 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Stop using a 'reg' variable

'reg' is a very non-descriptive name. Just get rid of the silly
local variable and spell out the full register name always.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231101114212.9345-3-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent a379bf3d
...@@ -398,7 +398,6 @@ void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state) ...@@ -398,7 +398,6 @@ void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state)
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
enum transcoder cpu_transcoder = new_crtc_state->cpu_transcoder; enum transcoder cpu_transcoder = new_crtc_state->cpu_transcoder;
enum pipe pipe = crtc->pipe; enum pipe pipe = crtc->pipe;
i915_reg_t reg;
u32 val; u32 val;
drm_dbg_kms(&dev_priv->drm, "enabling pipe %c\n", pipe_name(pipe)); drm_dbg_kms(&dev_priv->drm, "enabling pipe %c\n", pipe_name(pipe));
...@@ -431,16 +430,16 @@ void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state) ...@@ -431,16 +430,16 @@ void intel_enable_transcoder(const struct intel_crtc_state *new_crtc_state)
intel_de_rmw(dev_priv, PIPE_ARB_CTL(pipe), intel_de_rmw(dev_priv, PIPE_ARB_CTL(pipe),
0, PIPE_ARB_USE_PROG_SLOTS); 0, PIPE_ARB_USE_PROG_SLOTS);
reg = TRANSCONF(cpu_transcoder); val = intel_de_read(dev_priv, TRANSCONF(cpu_transcoder));
val = intel_de_read(dev_priv, reg);
if (val & TRANSCONF_ENABLE) { if (val & TRANSCONF_ENABLE) {
/* we keep both pipes enabled on 830 */ /* we keep both pipes enabled on 830 */
drm_WARN_ON(&dev_priv->drm, !IS_I830(dev_priv)); drm_WARN_ON(&dev_priv->drm, !IS_I830(dev_priv));
return; return;
} }
intel_de_write(dev_priv, reg, val | TRANSCONF_ENABLE); intel_de_write(dev_priv, TRANSCONF(cpu_transcoder),
intel_de_posting_read(dev_priv, reg); val | TRANSCONF_ENABLE);
intel_de_posting_read(dev_priv, TRANSCONF(cpu_transcoder));
/* /*
* Until the pipe starts PIPEDSL reads will return a stale value, * Until the pipe starts PIPEDSL reads will return a stale value,
...@@ -459,7 +458,6 @@ void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state) ...@@ -459,7 +458,6 @@ void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state)
struct drm_i915_private *dev_priv = to_i915(crtc->base.dev); struct drm_i915_private *dev_priv = to_i915(crtc->base.dev);
enum transcoder cpu_transcoder = old_crtc_state->cpu_transcoder; enum transcoder cpu_transcoder = old_crtc_state->cpu_transcoder;
enum pipe pipe = crtc->pipe; enum pipe pipe = crtc->pipe;
i915_reg_t reg;
u32 val; u32 val;
drm_dbg_kms(&dev_priv->drm, "disabling pipe %c\n", pipe_name(pipe)); drm_dbg_kms(&dev_priv->drm, "disabling pipe %c\n", pipe_name(pipe));
...@@ -470,8 +468,7 @@ void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state) ...@@ -470,8 +468,7 @@ void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state)
*/ */
assert_planes_disabled(crtc); assert_planes_disabled(crtc);
reg = TRANSCONF(cpu_transcoder); val = intel_de_read(dev_priv, TRANSCONF(cpu_transcoder));
val = intel_de_read(dev_priv, reg);
if ((val & TRANSCONF_ENABLE) == 0) if ((val & TRANSCONF_ENABLE) == 0)
return; return;
...@@ -486,7 +483,7 @@ void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state) ...@@ -486,7 +483,7 @@ void intel_disable_transcoder(const struct intel_crtc_state *old_crtc_state)
if (!IS_I830(dev_priv)) if (!IS_I830(dev_priv))
val &= ~TRANSCONF_ENABLE; val &= ~TRANSCONF_ENABLE;
intel_de_write(dev_priv, reg, val); intel_de_write(dev_priv, TRANSCONF(cpu_transcoder), val);
if (DISPLAY_VER(dev_priv) >= 12) if (DISPLAY_VER(dev_priv) >= 12)
intel_de_rmw(dev_priv, hsw_chicken_trans_reg(dev_priv, cpu_transcoder), intel_de_rmw(dev_priv, hsw_chicken_trans_reg(dev_priv, cpu_transcoder),
......
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