Skip to content

Commit bc5b7ba

Browse files
committed
drm/i915/dp: move g4x_dp_set_clock() call to g4x_dp_compute_config()
It does not look like anything in intel_dp_compute_config() after the g4x_dp_set_clock() call depends on the changes it makes, namely setting dpll and clock_set in crtc_state. Move the call one level higher to g4x_dp_compute_config() to reduce the clutter in intel_dp_compute_config(). Cc: Ville Syrjala <[email protected]> Reviewed-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Jani Nikula <[email protected]>
1 parent 0c638e8 commit bc5b7ba

File tree

3 files changed

+10
-12
lines changed

3 files changed

+10
-12
lines changed

drivers/gpu/drm/i915/display/g4x_dp.c

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,8 +55,8 @@ const struct dpll *vlv_get_dpll(struct drm_i915_private *i915)
5555
return IS_CHERRYVIEW(i915) ? &chv_dpll[0] : &vlv_dpll[0];
5656
}
5757

58-
void g4x_dp_set_clock(struct intel_encoder *encoder,
59-
struct intel_crtc_state *pipe_config)
58+
static void g4x_dp_set_clock(struct intel_encoder *encoder,
59+
struct intel_crtc_state *pipe_config)
6060
{
6161
struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
6262
const struct dpll *divisor = NULL;
@@ -1228,11 +1228,18 @@ static int g4x_dp_compute_config(struct intel_encoder *encoder,
12281228
struct drm_connector_state *conn_state)
12291229
{
12301230
struct drm_i915_private *i915 = to_i915(encoder->base.dev);
1231+
int ret;
12311232

12321233
if (HAS_PCH_SPLIT(i915) && encoder->port != PORT_A)
12331234
crtc_state->has_pch_encoder = true;
12341235

1235-
return intel_dp_compute_config(encoder, crtc_state, conn_state);
1236+
ret = intel_dp_compute_config(encoder, crtc_state, conn_state);
1237+
if (ret)
1238+
return ret;
1239+
1240+
g4x_dp_set_clock(encoder, crtc_state);
1241+
1242+
return 0;
12361243
}
12371244

12381245
static void g4x_dp_suspend_complete(struct intel_encoder *encoder)

drivers/gpu/drm/i915/display/g4x_dp.h

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ struct intel_encoder;
1919

2020
#ifdef I915
2121
const struct dpll *vlv_get_dpll(struct drm_i915_private *i915);
22-
void g4x_dp_set_clock(struct intel_encoder *encoder,
23-
struct intel_crtc_state *pipe_config);
2422
bool g4x_dp_port_enabled(struct drm_i915_private *dev_priv,
2523
i915_reg_t dp_reg, enum port port,
2624
enum pipe *pipe);
@@ -31,10 +29,6 @@ static inline const struct dpll *vlv_get_dpll(struct drm_i915_private *i915)
3129
{
3230
return NULL;
3331
}
34-
static inline void g4x_dp_set_clock(struct intel_encoder *encoder,
35-
struct intel_crtc_state *pipe_config)
36-
{
37-
}
3832
static inline bool g4x_dp_port_enabled(struct drm_i915_private *dev_priv,
3933
i915_reg_t dp_reg, int port,
4034
enum pipe *pipe)

drivers/gpu/drm/i915/display/intel_dp.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3172,9 +3172,6 @@ intel_dp_compute_config(struct intel_encoder *encoder,
31723172
if (pipe_config->splitter.enable)
31733173
pipe_config->dp_m_n.data_m *= pipe_config->splitter.link_count;
31743174

3175-
if (!HAS_DDI(dev_priv))
3176-
g4x_dp_set_clock(encoder, pipe_config);
3177-
31783175
intel_vrr_compute_config(pipe_config, conn_state);
31793176
intel_dp_compute_as_sdp(intel_dp, pipe_config);
31803177
intel_psr_compute_config(intel_dp, pipe_config, conn_state);

0 commit comments

Comments
 (0)