Skip to content

Commit 4627bef

Browse files
committed
drm/i915: Simplify the state checker calling convetions
We're passing in a totally random mismash of things into the state checker. Clean it up to pass in the minimum needed. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20231004155607.7719-11-ville.syrjala@linux.intel.com Reviewed-by: Jani Nikula <jani.nikula@intel.com>
1 parent a4e7112 commit 4627bef

3 files changed

Lines changed: 18 additions & 21 deletions

File tree

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7218,7 +7218,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
72187218

72197219
intel_set_cdclk_pre_plane_update(state);
72207220

7221-
intel_modeset_verify_disabled(dev_priv, state);
7221+
intel_modeset_verify_disabled(state);
72227222
}
72237223

72247224
intel_sagv_pre_plane_update(state);
@@ -7304,7 +7304,7 @@ static void intel_atomic_commit_tail(struct intel_atomic_state *state)
73047304

73057305
intel_modeset_put_crtc_power_domains(crtc, &put_domains[crtc->pipe]);
73067306

7307-
intel_modeset_verify_crtc(crtc, state, old_crtc_state, new_crtc_state);
7307+
intel_modeset_verify_crtc(state, crtc);
73087308

73097309
/* Must be done after gamma readout due to HSW split gamma vs. IPS w/a */
73107310
hsw_ips_post_update(state, crtc);

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

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -86,9 +86,10 @@ verify_connector_state(struct intel_atomic_state *state,
8686
}
8787
}
8888

89-
static void intel_pipe_config_sanity_check(struct drm_i915_private *dev_priv,
90-
const struct intel_crtc_state *pipe_config)
89+
static void intel_pipe_config_sanity_check(const struct intel_crtc_state *pipe_config)
9190
{
91+
struct drm_i915_private *dev_priv = to_i915(pipe_config->uapi.crtc->dev);
92+
9293
if (pipe_config->has_pch_encoder) {
9394
int fdi_dotclock = intel_dotclock_calculate(intel_fdi_link_freq(dev_priv, pipe_config),
9495
&pipe_config->fdi_m_n);
@@ -106,8 +107,9 @@ static void intel_pipe_config_sanity_check(struct drm_i915_private *dev_priv,
106107
}
107108

108109
static void
109-
verify_encoder_state(struct drm_i915_private *dev_priv, struct intel_atomic_state *state)
110+
verify_encoder_state(struct intel_atomic_state *state)
110111
{
112+
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
111113
struct intel_encoder *encoder;
112114
struct drm_connector *connector;
113115
const struct drm_connector_state *old_conn_state, *new_conn_state;
@@ -214,7 +216,7 @@ verify_crtc_state(struct intel_atomic_state *state,
214216
if (!new_crtc_state->hw.active)
215217
return;
216218

217-
intel_pipe_config_sanity_check(dev_priv, pipe_config);
219+
intel_pipe_config_sanity_check(pipe_config);
218220

219221
if (!intel_pipe_config_compare(new_crtc_state,
220222
pipe_config, false)) {
@@ -224,11 +226,12 @@ verify_crtc_state(struct intel_atomic_state *state,
224226
}
225227
}
226228

227-
void intel_modeset_verify_crtc(struct intel_crtc *crtc,
228-
struct intel_atomic_state *state,
229-
const struct intel_crtc_state *old_crtc_state,
230-
const struct intel_crtc_state *new_crtc_state)
229+
void intel_modeset_verify_crtc(struct intel_atomic_state *state,
230+
struct intel_crtc *crtc)
231231
{
232+
const struct intel_crtc_state *new_crtc_state =
233+
intel_atomic_get_new_crtc_state(state, crtc);
234+
232235
if (!intel_crtc_needs_modeset(new_crtc_state) &&
233236
!intel_crtc_needs_fastset(new_crtc_state))
234237
return;
@@ -241,10 +244,9 @@ void intel_modeset_verify_crtc(struct intel_crtc *crtc,
241244
intel_c10pll_state_verify(state, crtc);
242245
}
243246

244-
void intel_modeset_verify_disabled(struct drm_i915_private *dev_priv,
245-
struct intel_atomic_state *state)
247+
void intel_modeset_verify_disabled(struct intel_atomic_state *state)
246248
{
247-
verify_encoder_state(dev_priv, state);
249+
verify_encoder_state(state);
248250
verify_connector_state(state, NULL);
249251
intel_shared_dpll_verify_disabled(state);
250252
}

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

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,11 @@
66
#ifndef __INTEL_MODESET_VERIFY_H__
77
#define __INTEL_MODESET_VERIFY_H__
88

9-
struct drm_i915_private;
109
struct intel_atomic_state;
1110
struct intel_crtc;
12-
struct intel_crtc_state;
1311

14-
void intel_modeset_verify_crtc(struct intel_crtc *crtc,
15-
struct intel_atomic_state *state,
16-
const struct intel_crtc_state *old_crtc_state,
17-
const struct intel_crtc_state *new_crtc_state);
18-
void intel_modeset_verify_disabled(struct drm_i915_private *dev_priv,
19-
struct intel_atomic_state *state);
12+
void intel_modeset_verify_crtc(struct intel_atomic_state *state,
13+
struct intel_crtc *crtc);
14+
void intel_modeset_verify_disabled(struct intel_atomic_state *state);
2015

2116
#endif /* __INTEL_MODESET_VERIFY_H__ */

0 commit comments

Comments
 (0)