Skip to content

Commit e16bcbb

Browse files
committed
drm/i915: Handle joined pipes inside hsw_crtc_disable()
Reorganize the crtc disable path to only deal with the master pipes/transcoders in intel_old_crtc_state_disables() and offload the handling of joined pipes to hsw_crtc_disable(). This makes the whole thing much more sensible since we can actually control the order in which we do the per-pipe vs. per-transcoder modeset steps. v2: Use the name 'pipe_crtc' for the per-pipe crtc pointer Tested-by: Vidya Srinivas <[email protected]> Reviewed-by: Arun R Murthy <[email protected]> Signed-off-by: Ville Syrjälä <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent b7ce280 commit e16bcbb

File tree

1 file changed

+39
-25
lines changed

1 file changed

+39
-25
lines changed

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

Lines changed: 39 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -1816,29 +1816,28 @@ static void hsw_crtc_disable(struct intel_atomic_state *state,
18161816
const struct intel_crtc_state *old_crtc_state =
18171817
intel_atomic_get_old_crtc_state(state, crtc);
18181818
struct drm_i915_private *i915 = to_i915(crtc->base.dev);
1819+
struct intel_crtc *pipe_crtc;
18191820

18201821
/*
18211822
* FIXME collapse everything to one hook.
18221823
* Need care with mst->ddi interactions.
18231824
*/
1824-
if (!intel_crtc_is_bigjoiner_slave(old_crtc_state)) {
1825-
intel_encoders_disable(state, crtc);
1826-
intel_encoders_post_disable(state, crtc);
1827-
}
1828-
1829-
intel_disable_shared_dpll(old_crtc_state);
1825+
intel_encoders_disable(state, crtc);
1826+
intel_encoders_post_disable(state, crtc);
18301827

1831-
if (!intel_crtc_is_bigjoiner_slave(old_crtc_state)) {
1832-
struct intel_crtc *slave_crtc;
1828+
for_each_intel_crtc_in_pipe_mask(&i915->drm, pipe_crtc,
1829+
intel_crtc_joined_pipe_mask(old_crtc_state)) {
1830+
const struct intel_crtc_state *old_pipe_crtc_state =
1831+
intel_atomic_get_old_crtc_state(state, pipe_crtc);
18331832

1834-
intel_encoders_post_pll_disable(state, crtc);
1833+
intel_disable_shared_dpll(old_pipe_crtc_state);
1834+
}
18351835

1836-
intel_dmc_disable_pipe(i915, crtc->pipe);
1836+
intel_encoders_post_pll_disable(state, crtc);
18371837

1838-
for_each_intel_crtc_in_pipe_mask(&i915->drm, slave_crtc,
1839-
intel_crtc_bigjoiner_slave_pipes(old_crtc_state))
1840-
intel_dmc_disable_pipe(i915, slave_crtc->pipe);
1841-
}
1838+
for_each_intel_crtc_in_pipe_mask(&i915->drm, pipe_crtc,
1839+
intel_crtc_joined_pipe_mask(old_crtc_state))
1840+
intel_dmc_disable_pipe(i915, pipe_crtc->pipe);
18421841
}
18431842

18441843
static void i9xx_pfit_enable(const struct intel_crtc_state *crtc_state)
@@ -6869,21 +6868,31 @@ static void intel_old_crtc_state_disables(struct intel_atomic_state *state,
68696868
struct intel_crtc *crtc)
68706869
{
68716870
struct drm_i915_private *dev_priv = to_i915(state->base.dev);
6872-
const struct intel_crtc_state *new_crtc_state =
6873-
intel_atomic_get_new_crtc_state(state, crtc);
6871+
const struct intel_crtc_state *old_crtc_state =
6872+
intel_atomic_get_old_crtc_state(state, crtc);
6873+
struct intel_crtc *pipe_crtc;
68746874

68756875
/*
68766876
* We need to disable pipe CRC before disabling the pipe,
68776877
* or we race against vblank off.
68786878
*/
6879-
intel_crtc_disable_pipe_crc(crtc);
6879+
for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, pipe_crtc,
6880+
intel_crtc_joined_pipe_mask(old_crtc_state))
6881+
intel_crtc_disable_pipe_crc(pipe_crtc);
68806882

68816883
dev_priv->display.funcs.display->crtc_disable(state, crtc);
6882-
crtc->active = false;
6883-
intel_fbc_disable(crtc);
68846884

6885-
if (!new_crtc_state->hw.active)
6886-
intel_initial_watermarks(state, crtc);
6885+
for_each_intel_crtc_in_pipe_mask(&dev_priv->drm, pipe_crtc,
6886+
intel_crtc_joined_pipe_mask(old_crtc_state)) {
6887+
const struct intel_crtc_state *new_pipe_crtc_state =
6888+
intel_atomic_get_new_crtc_state(state, pipe_crtc);
6889+
6890+
pipe_crtc->active = false;
6891+
intel_fbc_disable(pipe_crtc);
6892+
6893+
if (!new_pipe_crtc_state->hw.active)
6894+
intel_initial_watermarks(state, pipe_crtc);
6895+
}
68876896
}
68886897

68896898
static void intel_commit_modeset_disables(struct intel_atomic_state *state)
@@ -6923,29 +6932,34 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state)
69236932
if ((disable_pipes & BIT(crtc->pipe)) == 0)
69246933
continue;
69256934

6935+
if (intel_crtc_is_bigjoiner_slave(old_crtc_state))
6936+
continue;
6937+
69266938
/* In case of Transcoder port Sync master slave CRTCs can be
69276939
* assigned in any order and we need to make sure that
69286940
* slave CRTCs are disabled first and then master CRTC since
69296941
* Slave vblanks are masked till Master Vblanks.
69306942
*/
69316943
if (!is_trans_port_sync_slave(old_crtc_state) &&
6932-
!intel_dp_mst_is_slave_trans(old_crtc_state) &&
6933-
!intel_crtc_is_bigjoiner_slave(old_crtc_state))
6944+
!intel_dp_mst_is_slave_trans(old_crtc_state))
69346945
continue;
69356946

69366947
intel_old_crtc_state_disables(state, crtc);
69376948

6938-
disable_pipes &= ~BIT(crtc->pipe);
6949+
disable_pipes &= ~intel_crtc_joined_pipe_mask(old_crtc_state);
69396950
}
69406951

69416952
/* Disable everything else left on */
69426953
for_each_old_intel_crtc_in_state(state, crtc, old_crtc_state, i) {
69436954
if ((disable_pipes & BIT(crtc->pipe)) == 0)
69446955
continue;
69456956

6957+
if (intel_crtc_is_bigjoiner_slave(old_crtc_state))
6958+
continue;
6959+
69466960
intel_old_crtc_state_disables(state, crtc);
69476961

6948-
disable_pipes &= ~BIT(crtc->pipe);
6962+
disable_pipes &= ~intel_crtc_joined_pipe_mask(old_crtc_state);
69496963
}
69506964

69516965
drm_WARN_ON(&i915->drm, disable_pipes);

0 commit comments

Comments
 (0)