Message ID | 20230525101036.21564-1-stanislav.lisovskiy@intel.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | drm/i915: Fix the disabling sequence for Bigjoiner | expand |
On Thu, 2023-05-25 at 13:10 +0300, Stanislav Lisovskiy wrote: > According to BSpec 49190, when enabling crtcs, we first setup > slave and then master crtc, however for disabling it should go > vice versa, i.e first master, then slave, however current code > does disabling in a same way as enabling. Fix this, by skipping > non-master crtcs, instead of non-slaves. > > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> > --- > drivers/gpu/drm/i915/display/intel_display.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c > index 0490c6412ab5..68958ba0ef49 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -6662,7 +6662,7 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) > */ > if (!is_trans_port_sync_slave(old_crtc_state) && > !intel_dp_mst_is_slave_trans(old_crtc_state) && > - !intel_crtc_is_bigjoiner_slave(old_crtc_state)) > + !intel_crtc_is_bigjoiner_master(old_crtc_state)) > continue; > > intel_old_crtc_state_disables(state, old_crtc_state, Looks good to me. Reviewed-by: Luca Coelho <luciano.coelho@intel.com> -- Cheers, Luca.
On Thu, May 25, 2023 at 01:10:36PM +0300, Stanislav Lisovskiy wrote: > According to BSpec 49190, when enabling crtcs, we first setup > slave and then master crtc, however for disabling it should go > vice versa, i.e first master, then slave, however current code > does disabling in a same way as enabling. Fix this, by skipping > non-master crtcs, instead of non-slaves. > > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> > --- > drivers/gpu/drm/i915/display/intel_display.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c > index 0490c6412ab5..68958ba0ef49 100644 > --- a/drivers/gpu/drm/i915/display/intel_display.c > +++ b/drivers/gpu/drm/i915/display/intel_display.c > @@ -6662,7 +6662,7 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) > */ > if (!is_trans_port_sync_slave(old_crtc_state) && > !intel_dp_mst_is_slave_trans(old_crtc_state) && > - !intel_crtc_is_bigjoiner_slave(old_crtc_state)) > + !intel_crtc_is_bigjoiner_master(old_crtc_state)) I don't see what does this fix. The sequence is correct at the moment and this change would break it, leaving the encoder PLL enabled incorrectly when the encoder->post_pll_disable() hook is called. Hence it's NAK from side. > continue; > > intel_old_crtc_state_disables(state, old_crtc_state, > -- > 2.37.3 >
On Wed, Jul 05, 2023 at 06:32:51PM +0300, Imre Deak wrote: > On Thu, May 25, 2023 at 01:10:36PM +0300, Stanislav Lisovskiy wrote: > > According to BSpec 49190, when enabling crtcs, we first setup > > slave and then master crtc, however for disabling it should go > > vice versa, i.e first master, then slave, however current code > > does disabling in a same way as enabling. Fix this, by skipping > > non-master crtcs, instead of non-slaves. > > > > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> > > --- > > drivers/gpu/drm/i915/display/intel_display.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c > > index 0490c6412ab5..68958ba0ef49 100644 > > --- a/drivers/gpu/drm/i915/display/intel_display.c > > +++ b/drivers/gpu/drm/i915/display/intel_display.c > > @@ -6662,7 +6662,7 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) > > */ > > if (!is_trans_port_sync_slave(old_crtc_state) && > > !intel_dp_mst_is_slave_trans(old_crtc_state) && > > - !intel_crtc_is_bigjoiner_slave(old_crtc_state)) > > + !intel_crtc_is_bigjoiner_master(old_crtc_state)) > > I don't see what does this fix. The sequence is correct at the moment > and this change would break it, leaving the encoder PLL enabled > incorrectly when the encoder->post_pll_disable() hook is called. Hence > it's NAK from side. Well, as I pointed out the BSpec 49190 instructs us to disable master first, then slave. Current code skips all non-slaves in first cycle, i.e it disables first slaves and then masters. Which is _wrong_. Anything else in particular, where do you need clarifications? Stan > > > continue; > > > > intel_old_crtc_state_disables(state, old_crtc_state, > > -- > > 2.37.3 > >
On Wed, Jul 05, 2023 at 06:32:51PM +0300, Imre Deak wrote: > On Thu, May 25, 2023 at 01:10:36PM +0300, Stanislav Lisovskiy wrote: > > According to BSpec 49190, when enabling crtcs, we first setup > > slave and then master crtc, however for disabling it should go > > vice versa, i.e first master, then slave, however current code > > does disabling in a same way as enabling. Fix this, by skipping > > non-master crtcs, instead of non-slaves. > > > > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> > > --- > > drivers/gpu/drm/i915/display/intel_display.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c > > index 0490c6412ab5..68958ba0ef49 100644 > > --- a/drivers/gpu/drm/i915/display/intel_display.c > > +++ b/drivers/gpu/drm/i915/display/intel_display.c > > @@ -6662,7 +6662,7 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) > > */ > > if (!is_trans_port_sync_slave(old_crtc_state) && > > !intel_dp_mst_is_slave_trans(old_crtc_state) && > > - !intel_crtc_is_bigjoiner_slave(old_crtc_state)) > > + !intel_crtc_is_bigjoiner_master(old_crtc_state)) > > I don't see what does this fix. The sequence is correct at the moment > and this change would break it, leaving the encoder PLL enabled > incorrectly when the encoder->post_pll_disable() hook is called. Hence > it's NAK from side. Citing BSpec: Follow the steps to disable Planes, Pipe, and Transcoder for pipe B and transcoder B(master) Follow the steps to Disable Planes and Pipe for pipe C(slave) Disable port associated with Transcoder B however because of !intel_crtc_is_bigjoiner_slave(old_crtc_state), we are skipping masters and do disabling for the slave crtc first. If fixing that going to break something - that is another story(anyway doesn't mean we shouldn't fix) Stan > > > continue; > > > > intel_old_crtc_state_disables(state, old_crtc_state, > > -- > > 2.37.3 > >
On Thu, Jul 06, 2023 at 11:24:21AM +0300, Lisovskiy, Stanislav wrote: > On Wed, Jul 05, 2023 at 06:32:51PM +0300, Imre Deak wrote: > > On Thu, May 25, 2023 at 01:10:36PM +0300, Stanislav Lisovskiy wrote: > > > According to BSpec 49190, when enabling crtcs, we first setup > > > slave and then master crtc, however for disabling it should go > > > vice versa, i.e first master, then slave, however current code > > > does disabling in a same way as enabling. Fix this, by skipping > > > non-master crtcs, instead of non-slaves. > > > > > > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> > > > --- > > > drivers/gpu/drm/i915/display/intel_display.c | 2 +- > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c > > > index 0490c6412ab5..68958ba0ef49 100644 > > > --- a/drivers/gpu/drm/i915/display/intel_display.c > > > +++ b/drivers/gpu/drm/i915/display/intel_display.c > > > @@ -6662,7 +6662,7 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) > > > */ > > > if (!is_trans_port_sync_slave(old_crtc_state) && > > > !intel_dp_mst_is_slave_trans(old_crtc_state) && > > > - !intel_crtc_is_bigjoiner_slave(old_crtc_state)) > > > + !intel_crtc_is_bigjoiner_master(old_crtc_state)) > > > > I don't see what does this fix. The sequence is correct at the moment > > and this change would break it, leaving the encoder PLL enabled > > incorrectly when the encoder->post_pll_disable() hook is called. Hence > > it's NAK from side. > > Well, as I pointed out the BSpec 49190 instructs us to disable master > first, then slave. Current code skips all non-slaves in first cycle, > i.e it disables first slaves and then masters. Which is _wrong_. This is correct at the moment, followed in the encoder's disable hook which is only assigned to the master CRTC. > Anything else in particular, where do you need clarifications? > > Stan > > > > > > continue; > > > > > > intel_old_crtc_state_disables(state, old_crtc_state, > > > -- > > > 2.37.3 > > >
On Thu, Jul 06, 2023 at 11:47:26AM +0300, Imre Deak wrote: > On Thu, Jul 06, 2023 at 11:24:21AM +0300, Lisovskiy, Stanislav wrote: > > On Wed, Jul 05, 2023 at 06:32:51PM +0300, Imre Deak wrote: > > > On Thu, May 25, 2023 at 01:10:36PM +0300, Stanislav Lisovskiy wrote: > > > > According to BSpec 49190, when enabling crtcs, we first setup > > > > slave and then master crtc, however for disabling it should go > > > > vice versa, i.e first master, then slave, however current code > > > > does disabling in a same way as enabling. Fix this, by skipping > > > > non-master crtcs, instead of non-slaves. > > > > > > > > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> > > > > --- > > > > drivers/gpu/drm/i915/display/intel_display.c | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c > > > > index 0490c6412ab5..68958ba0ef49 100644 > > > > --- a/drivers/gpu/drm/i915/display/intel_display.c > > > > +++ b/drivers/gpu/drm/i915/display/intel_display.c > > > > @@ -6662,7 +6662,7 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) > > > > */ > > > > if (!is_trans_port_sync_slave(old_crtc_state) && > > > > !intel_dp_mst_is_slave_trans(old_crtc_state) && > > > > - !intel_crtc_is_bigjoiner_slave(old_crtc_state)) > > > > + !intel_crtc_is_bigjoiner_master(old_crtc_state)) > > > > > > I don't see what does this fix. The sequence is correct at the moment > > > and this change would break it, leaving the encoder PLL enabled > > > incorrectly when the encoder->post_pll_disable() hook is called. Hence > > > it's NAK from side. > > > > Well, as I pointed out the BSpec 49190 instructs us to disable master > > first, then slave. Current code skips all non-slaves in first cycle, > > i.e it disables first slaves and then masters. Which is _wrong_. > > This is correct at the moment, followed in the encoder's disable hook > which is only assigned to the master CRTC. Hmmm... I will check it. > > > Anything else in particular, where do you need clarifications? > > > > Stan > > > > > > > > > continue; > > > > > > > > intel_old_crtc_state_disables(state, old_crtc_state, > > > > -- > > > > 2.37.3 > > > >
On Thu, Jul 06, 2023 at 11:47:26AM +0300, Imre Deak wrote: > On Thu, Jul 06, 2023 at 11:24:21AM +0300, Lisovskiy, Stanislav wrote: > > On Wed, Jul 05, 2023 at 06:32:51PM +0300, Imre Deak wrote: > > > On Thu, May 25, 2023 at 01:10:36PM +0300, Stanislav Lisovskiy wrote: > > > > According to BSpec 49190, when enabling crtcs, we first setup > > > > slave and then master crtc, however for disabling it should go > > > > vice versa, i.e first master, then slave, however current code > > > > does disabling in a same way as enabling. Fix this, by skipping > > > > non-master crtcs, instead of non-slaves. > > > > > > > > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> > > > > --- > > > > drivers/gpu/drm/i915/display/intel_display.c | 2 +- > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c > > > > index 0490c6412ab5..68958ba0ef49 100644 > > > > --- a/drivers/gpu/drm/i915/display/intel_display.c > > > > +++ b/drivers/gpu/drm/i915/display/intel_display.c > > > > @@ -6662,7 +6662,7 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) > > > > */ > > > > if (!is_trans_port_sync_slave(old_crtc_state) && > > > > !intel_dp_mst_is_slave_trans(old_crtc_state) && > > > > - !intel_crtc_is_bigjoiner_slave(old_crtc_state)) > > > > + !intel_crtc_is_bigjoiner_master(old_crtc_state)) > > > > > > I don't see what does this fix. The sequence is correct at the moment > > > and this change would break it, leaving the encoder PLL enabled > > > incorrectly when the encoder->post_pll_disable() hook is called. Hence > > > it's NAK from side. > > > > Well, as I pointed out the BSpec 49190 instructs us to disable master > > first, then slave. Current code skips all non-slaves in first cycle, > > i.e it disables first slaves and then masters. Which is _wrong_. > > This is correct at the moment, followed in the encoder's disable hook > which is only assigned to the master CRTC. Yep, I see now why it was implemented this way. We basically handle everything in a single hook, taking care of the correct sequence. As I understood otherwise we are going to have problems with the pll subsystem, i.e we can't disable pll for master before the slaves(basically means our pll subsystem contradicts what the crtc/pipe/encoder sequence requires). I still think this is bery counterintuitive implementation, i.e when there is a single hook for master taking care of everything, while slaves are just noop. This makes the whole thing very prone for screwing things up. Ideally we should still have fully functional hooks for all slaves. If the pll stuff requires special treatment, that probably should be dealt somehow separately(don't have any solution for that yet), but definitely we shouldn't live further like that. Things might get even more complicated in future. Stan > > > Anything else in particular, where do you need clarifications? > > > > Stan > > > > > > > > > continue; > > > > > > > > intel_old_crtc_state_disables(state, old_crtc_state, > > > > -- > > > > 2.37.3 > > > >
On Thu, Jul 06, 2023 at 01:32:17PM +0300, Lisovskiy, Stanislav wrote: > On Thu, Jul 06, 2023 at 11:47:26AM +0300, Imre Deak wrote: > > On Thu, Jul 06, 2023 at 11:24:21AM +0300, Lisovskiy, Stanislav wrote: > > > On Wed, Jul 05, 2023 at 06:32:51PM +0300, Imre Deak wrote: > > > > On Thu, May 25, 2023 at 01:10:36PM +0300, Stanislav Lisovskiy wrote: > > > > > According to BSpec 49190, when enabling crtcs, we first setup > > > > > slave and then master crtc, however for disabling it should go > > > > > vice versa, i.e first master, then slave, however current code > > > > > does disabling in a same way as enabling. Fix this, by skipping > > > > > non-master crtcs, instead of non-slaves. > > > > > > > > > > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> > > > > > --- > > > > > drivers/gpu/drm/i915/display/intel_display.c | 2 +- > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c > > > > > index 0490c6412ab5..68958ba0ef49 100644 > > > > > --- a/drivers/gpu/drm/i915/display/intel_display.c > > > > > +++ b/drivers/gpu/drm/i915/display/intel_display.c > > > > > @@ -6662,7 +6662,7 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) > > > > > */ > > > > > if (!is_trans_port_sync_slave(old_crtc_state) && > > > > > !intel_dp_mst_is_slave_trans(old_crtc_state) && > > > > > - !intel_crtc_is_bigjoiner_slave(old_crtc_state)) > > > > > + !intel_crtc_is_bigjoiner_master(old_crtc_state)) > > > > > > > > I don't see what does this fix. The sequence is correct at the moment > > > > and this change would break it, leaving the encoder PLL enabled > > > > incorrectly when the encoder->post_pll_disable() hook is called. Hence > > > > it's NAK from side. > > > > > > Well, as I pointed out the BSpec 49190 instructs us to disable master > > > first, then slave. Current code skips all non-slaves in first cycle, > > > i.e it disables first slaves and then masters. Which is _wrong_. > > > > This is correct at the moment, followed in the encoder's disable hook > > which is only assigned to the master CRTC. > > Yep, I see now why it was implemented this way. > We basically handle everything in a single hook, taking care of the correct > sequence. As I understood otherwise we are going to have problems with the pll > subsystem, i.e we can't disable pll for master before the slaves(basically means > our pll subsystem contradicts what the crtc/pipe/encoder sequence requires). > > I still think this is bery counterintuitive implementation, i.e when there is a single > hook for master taking care of everything, while slaves are just noop. > This makes the whole thing very prone for screwing things up. > Ideally we should still have fully functional hooks for all slaves. > If the pll stuff requires special treatment, that probably should be dealt somehow > separately(don't have any solution for that yet), but definitely we shouldn't live > further like that. Things might get even more complicated in future. IMO what we should aim for is to call the high level crtc hooks only for the master crtc (ie. essentially the transcoder), and then iterate through the pipes inside the hooks at the approptiate points. To do that cleanly we want to split the code along the pipe-transcoder boundary as much as possible.
On Thu, Jul 06, 2023 at 09:02:29PM +0300, Ville Syrjälä wrote: > On Thu, Jul 06, 2023 at 01:32:17PM +0300, Lisovskiy, Stanislav wrote: > > On Thu, Jul 06, 2023 at 11:47:26AM +0300, Imre Deak wrote: > > > On Thu, Jul 06, 2023 at 11:24:21AM +0300, Lisovskiy, Stanislav wrote: > > > > On Wed, Jul 05, 2023 at 06:32:51PM +0300, Imre Deak wrote: > > > > > On Thu, May 25, 2023 at 01:10:36PM +0300, Stanislav Lisovskiy wrote: > > > > > > According to BSpec 49190, when enabling crtcs, we first setup > > > > > > slave and then master crtc, however for disabling it should go > > > > > > vice versa, i.e first master, then slave, however current code > > > > > > does disabling in a same way as enabling. Fix this, by skipping > > > > > > non-master crtcs, instead of non-slaves. > > > > > > > > > > > > Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> > > > > > > --- > > > > > > drivers/gpu/drm/i915/display/intel_display.c | 2 +- > > > > > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > > > > > > > > > diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c > > > > > > index 0490c6412ab5..68958ba0ef49 100644 > > > > > > --- a/drivers/gpu/drm/i915/display/intel_display.c > > > > > > +++ b/drivers/gpu/drm/i915/display/intel_display.c > > > > > > @@ -6662,7 +6662,7 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) > > > > > > */ > > > > > > if (!is_trans_port_sync_slave(old_crtc_state) && > > > > > > !intel_dp_mst_is_slave_trans(old_crtc_state) && > > > > > > - !intel_crtc_is_bigjoiner_slave(old_crtc_state)) > > > > > > + !intel_crtc_is_bigjoiner_master(old_crtc_state)) > > > > > > > > > > I don't see what does this fix. The sequence is correct at the moment > > > > > and this change would break it, leaving the encoder PLL enabled > > > > > incorrectly when the encoder->post_pll_disable() hook is called. Hence > > > > > it's NAK from side. > > > > > > > > Well, as I pointed out the BSpec 49190 instructs us to disable master > > > > first, then slave. Current code skips all non-slaves in first cycle, > > > > i.e it disables first slaves and then masters. Which is _wrong_. > > > > > > This is correct at the moment, followed in the encoder's disable hook > > > which is only assigned to the master CRTC. > > > > Yep, I see now why it was implemented this way. > > We basically handle everything in a single hook, taking care of the correct > > sequence. As I understood otherwise we are going to have problems with the pll > > subsystem, i.e we can't disable pll for master before the slaves(basically means > > our pll subsystem contradicts what the crtc/pipe/encoder sequence requires). > > > > I still think this is bery counterintuitive implementation, i.e when there is a single > > hook for master taking care of everything, while slaves are just noop. > > This makes the whole thing very prone for screwing things up. > > Ideally we should still have fully functional hooks for all slaves. > > If the pll stuff requires special treatment, that probably should be dealt somehow > > separately(don't have any solution for that yet), but definitely we shouldn't live > > further like that. Things might get even more complicated in future. > > IMO what we should aim for is to call the high level crtc hooks only for > the master crtc (ie. essentially the transcoder), and then iterate through > the pipes inside the hooks at the approptiate points. To do that > cleanly we want to split the code along the pipe-transcoder boundary > as much as possible. Problem is that we are still iterating slave crtcs in other places, just as regular pipes, which can create some additional mess. If we choose this approach then, it would be nice not to even try treating slave crtcs like regular pipe in places like skl_modeset_disables/enables. We should probably just skip them if we detect that they are bigjoiner slaves. So we go through only regular or joiner master pipes there. And all the joiner enable/disable logic would be then done in correspondent master crtc enable/disable hook. Otherwise we are at risk of messing things up. Also we will then have to use all those weird checks, all over the place. Stan > > -- > Ville Syrjälä > Intel
diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c index 0490c6412ab5..68958ba0ef49 100644 --- a/drivers/gpu/drm/i915/display/intel_display.c +++ b/drivers/gpu/drm/i915/display/intel_display.c @@ -6662,7 +6662,7 @@ static void intel_commit_modeset_disables(struct intel_atomic_state *state) */ if (!is_trans_port_sync_slave(old_crtc_state) && !intel_dp_mst_is_slave_trans(old_crtc_state) && - !intel_crtc_is_bigjoiner_slave(old_crtc_state)) + !intel_crtc_is_bigjoiner_master(old_crtc_state)) continue; intel_old_crtc_state_disables(state, old_crtc_state,
According to BSpec 49190, when enabling crtcs, we first setup slave and then master crtc, however for disabling it should go vice versa, i.e first master, then slave, however current code does disabling in a same way as enabling. Fix this, by skipping non-master crtcs, instead of non-slaves. Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> --- drivers/gpu/drm/i915/display/intel_display.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)