Commit 48630a31 authored by Ville Syrjälä's avatar Ville Syrjälä

drm/i915: Flatten intel_ddi_{enable,disable}_transcoder_clock()

Use an early return to get rid of the extra indentation level
in intel_ddi_{enable,disable}_transcoder_clock().

Also unify the platform handling in between the two while at
it.
Signed-off-by: default avatarVille Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230213225258.2127-3-ville.syrjala@linux.intel.comReviewed-by: default avatarJani Nikula <jani.nikula@intel.com>
parent 55a4679e
...@@ -953,33 +953,34 @@ void intel_ddi_enable_transcoder_clock(struct intel_encoder *encoder, ...@@ -953,33 +953,34 @@ void intel_ddi_enable_transcoder_clock(struct intel_encoder *encoder,
enum phy phy = intel_port_to_phy(dev_priv, encoder->port); enum phy phy = intel_port_to_phy(dev_priv, encoder->port);
u32 val; u32 val;
if (cpu_transcoder != TRANSCODER_EDP) { if (cpu_transcoder == TRANSCODER_EDP)
if (DISPLAY_VER(dev_priv) >= 13) return;
val = TGL_TRANS_CLK_SEL_PORT(phy);
else if (DISPLAY_VER(dev_priv) >= 12)
val = TGL_TRANS_CLK_SEL_PORT(encoder->port);
else
val = TRANS_CLK_SEL_PORT(encoder->port);
intel_de_write(dev_priv, TRANS_CLK_SEL(cpu_transcoder), val); if (DISPLAY_VER(dev_priv) >= 13)
} val = TGL_TRANS_CLK_SEL_PORT(phy);
else if (DISPLAY_VER(dev_priv) >= 12)
val = TGL_TRANS_CLK_SEL_PORT(encoder->port);
else
val = TRANS_CLK_SEL_PORT(encoder->port);
intel_de_write(dev_priv, TRANS_CLK_SEL(cpu_transcoder), val);
} }
void intel_ddi_disable_transcoder_clock(const struct intel_crtc_state *crtc_state) void intel_ddi_disable_transcoder_clock(const struct intel_crtc_state *crtc_state)
{ {
struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev); struct drm_i915_private *dev_priv = to_i915(crtc_state->uapi.crtc->dev);
enum transcoder cpu_transcoder = crtc_state->cpu_transcoder; enum transcoder cpu_transcoder = crtc_state->cpu_transcoder;
u32 val;
if (cpu_transcoder != TRANSCODER_EDP) { if (cpu_transcoder == TRANSCODER_EDP)
if (DISPLAY_VER(dev_priv) >= 12) return;
intel_de_write(dev_priv,
TRANS_CLK_SEL(cpu_transcoder), if (DISPLAY_VER(dev_priv) >= 12)
TGL_TRANS_CLK_SEL_DISABLED); val = TGL_TRANS_CLK_SEL_DISABLED;
else else
intel_de_write(dev_priv, val = TRANS_CLK_SEL_DISABLED;
TRANS_CLK_SEL(cpu_transcoder),
TRANS_CLK_SEL_DISABLED); intel_de_write(dev_priv, TRANS_CLK_SEL(cpu_transcoder), val);
}
} }
static void _skl_ddi_set_iboost(struct drm_i915_private *dev_priv, static void _skl_ddi_set_iboost(struct drm_i915_private *dev_priv,
......
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