Skip to content

Commit 335aa75

Browse files
committed
drm/i915: Simplify snps/c10x DPLL state checker calling convetion
Passing in the atomic state + crtc state is a bit weird. The latter can be just the crtc (which is the normal calling convention used in a lot of other places). Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-9-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula <jani.nikula@intel.com>
1 parent c788479 commit 335aa75

5 files changed

Lines changed: 12 additions & 8 deletions

File tree

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3005,12 +3005,13 @@ intel_mtl_port_pll_type(struct intel_encoder *encoder,
30053005
}
30063006

30073007
void intel_c10pll_state_verify(struct intel_atomic_state *state,
3008-
const struct intel_crtc_state *new_crtc_state)
3008+
struct intel_crtc *crtc)
30093009
{
30103010
struct drm_i915_private *i915 = to_i915(state->base.dev);
3011+
const struct intel_crtc_state *new_crtc_state =
3012+
intel_atomic_get_new_crtc_state(state, crtc);
30113013
struct intel_c10pll_state mpllb_hw_state = { 0 };
30123014
const struct intel_c10pll_state *mpllb_sw_state = &new_crtc_state->cx0pll_state.c10;
3013-
struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
30143015
struct intel_encoder *encoder;
30153016
enum phy phy;
30163017
int i;

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ struct drm_i915_private;
1616
struct intel_atomic_state;
1717
struct intel_c10pll_state;
1818
struct intel_c20pll_state;
19+
struct intel_crtc;
1920
struct intel_crtc_state;
2021
struct intel_encoder;
2122
struct intel_hdmi;
@@ -34,7 +35,7 @@ void intel_c10pll_dump_hw_state(struct drm_i915_private *dev_priv,
3435
int intel_c10pll_calc_port_clock(struct intel_encoder *encoder,
3536
const struct intel_c10pll_state *pll_state);
3637
void intel_c10pll_state_verify(struct intel_atomic_state *state,
37-
const struct intel_crtc_state *new_crtc_state);
38+
struct intel_crtc *crtc);
3839
void intel_c20pll_readout_hw_state(struct intel_encoder *encoder,
3940
struct intel_c20pll_state *pll_state);
4041
void intel_c20pll_dump_hw_state(struct drm_i915_private *i915,

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,8 +237,8 @@ void intel_modeset_verify_crtc(struct intel_crtc *crtc,
237237
verify_connector_state(state, crtc);
238238
verify_crtc_state(state, crtc);
239239
intel_shared_dpll_state_verify(state, crtc);
240-
intel_mpllb_state_verify(state, new_crtc_state);
241-
intel_c10pll_state_verify(state, new_crtc_state);
240+
intel_mpllb_state_verify(state, crtc);
241+
intel_c10pll_state_verify(state, crtc);
242242
}
243243

244244
void intel_modeset_verify_disabled(struct drm_i915_private *dev_priv,

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1993,12 +1993,13 @@ int intel_snps_phy_check_hdmi_link_rate(int clock)
19931993
}
19941994

19951995
void intel_mpllb_state_verify(struct intel_atomic_state *state,
1996-
const struct intel_crtc_state *new_crtc_state)
1996+
struct intel_crtc *crtc)
19971997
{
19981998
struct drm_i915_private *i915 = to_i915(state->base.dev);
1999+
const struct intel_crtc_state *new_crtc_state =
2000+
intel_atomic_get_new_crtc_state(state, crtc);
19992001
struct intel_mpllb_state mpllb_hw_state = { 0 };
20002002
const struct intel_mpllb_state *mpllb_sw_state = &new_crtc_state->mpllb_state;
2001-
struct intel_crtc *crtc = to_intel_crtc(new_crtc_state->uapi.crtc);
20022003
struct intel_encoder *encoder;
20032004

20042005
if (!IS_DG2(i915))

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

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
struct drm_i915_private;
1212
struct intel_atomic_state;
13+
struct intel_crtc;
1314
struct intel_crtc_state;
1415
struct intel_encoder;
1516
struct intel_mpllb_state;
@@ -33,6 +34,6 @@ int intel_snps_phy_check_hdmi_link_rate(int clock);
3334
void intel_snps_phy_set_signal_levels(struct intel_encoder *encoder,
3435
const struct intel_crtc_state *crtc_state);
3536
void intel_mpllb_state_verify(struct intel_atomic_state *state,
36-
const struct intel_crtc_state *new_crtc_state);
37+
struct intel_crtc *crtc);
3738

3839
#endif /* __INTEL_SNPS_PHY_H__ */

0 commit comments

Comments
 (0)