From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Souza, Jose" <jose.souza@intel.com>
Cc: "intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"De Marchi, Lucas" <lucas.demarchi@intel.com>
Subject: Re: [Intel-gfx] [PATCH 3/7] drm/i915/tgl: Select master trasconder for MST stream
Date: Wed, 4 Dec 2019 21:03:15 +0200 [thread overview]
Message-ID: <20191204190315.GC1208@intel.com> (raw)
In-Reply-To: <d93dd152f2d0401a5e4533fcb017bd4e02bf87af.camel@intel.com>
On Wed, Dec 04, 2019 at 06:48:42PM +0000, Souza, Jose wrote:
> On Wed, 2019-12-04 at 12:55 +0200, Ville Syrjälä wrote:
> > On Tue, Dec 03, 2019 at 10:12:47PM +0000, Souza, Jose wrote:
> > > On Tue, 2019-12-03 at 14:47 +0200, Ville Syrjälä wrote:
> > > > On Mon, Dec 02, 2019 at 10:03:38PM +0000, Souza, Jose wrote:
> > > > > On Thu, 2019-11-28 at 14:06 +0200, Ville Syrjälä wrote:
> > > > > > On Thu, Nov 28, 2019 at 01:14:37AM +0000, Souza, Jose wrote:
> > > > > > > On Wed, 2019-11-27 at 21:59 +0200, Ville Syrjälä wrote:
> > > > > > > > On Tue, Nov 26, 2019 at 08:30:31PM +0000, Souza, Jose
> > > > > > > > wrote:
> > > > > > > > > On Tue, 2019-11-26 at 22:05 +0200, Ville Syrjälä wrote:
> > > > > > > > > > On Fri, Nov 22, 2019 at 04:54:55PM -0800, José
> > > > > > > > > > Roberto de
> > > > > > > > > > Souza
> > > > > > > > > > wrote:
> > > > > > > > > > > On TGL the blending of all the streams have moved
> > > > > > > > > > > from
> > > > > > > > > > > DDI
> > > > > > > > > > > to
> > > > > > > > > > > transcoder, so now every transcoder working over
> > > > > > > > > > > the
> > > > > > > > > > > same
> > > > > > > > > > > MST
> > > > > > > > > > > port
> > > > > > > > > > > must
> > > > > > > > > > > send its stream to a master transcoder and master
> > > > > > > > > > > will
> > > > > > > > > > > send
> > > > > > > > > > > to
> > > > > > > > > > > DDI
> > > > > > > > > > > respecting the time slots.
> > > > > > > > > > >
> > > > > > > > > > > A previous approach was using the lowest
> > > > > > > > > > > pipe/transcoder as
> > > > > > > > > > > master
> > > > > > > > > > > transcoder but as the comment in
> > > > > > > > > > > skl_commit_modeset_enables()
> > > > > > > > > > > states,
> > > > > > > > > > > that is not always true.
> > > > > > > > > > >
> > > > > > > > > > > So here promoting the first pipe/transcoder of the
> > > > > > > > > > > stream
> > > > > > > > > > > as
> > > > > > > > > > > master.
> > > > > > > > > > > That caused several other problems as during the
> > > > > > > > > > > commit
> > > > > > > > > > > phase
> > > > > > > > > > > the
> > > > > > > > > > > state computed should not be changed.
> > > > > > > > > > >
> > > > > > > > > > > So the master transcoder is store into intel_dp and
> > > > > > > > > > > the
> > > > > > > > > > > modeset
> > > > > > > > > > > in
> > > > > > > > > > > slave pipes/transcoders is forced using
> > > > > > > > > > > mst_master_trans_pending.
> > > > > > > > > > >
> > > > > > > > > > > v2:
> > > > > > > > > > > - added missing config compute to trigger
> > > > > > > > > > > fullmodeset
> > > > > > > > > > > in
> > > > > > > > > > > slave
> > > > > > > > > > > transcoders
> > > > > > > > > > >
> > > > > > > > > > > BSpec: 50493
> > > > > > > > > > > BSpec: 49190
> > > > > > > > > > > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > > > > > > > > > > Cc: Lucas De Marchi <lucas.demarchi@intel.com>
> > > > > > > > > > > Signed-off-by: José Roberto de Souza <
> > > > > > > > > > > jose.souza@intel.com>
> > > > > > > > > > > ---
> > > > > > > > > > > drivers/gpu/drm/i915/display/intel_ddi.c | 1
> > > > > > > > > > > 0 +-
> > > > > > > > > > > drivers/gpu/drm/i915/display/intel_display.c | 5
> > > > > > > > > > > 8
> > > > > > > > > > > ++++++-
> > > > > > > > > > > .../drm/i915/display/intel_display_types.h |
> > > > > > > > > > > 3 +
> > > > > > > > > > > drivers/gpu/drm/i915/display/intel_dp.c |
> > > > > > > > > > > 1 +
> > > > > > > > > > > drivers/gpu/drm/i915/display/intel_dp_mst.c |
> > > > > > > > > > > 149
> > > > > > > > > > > +++++++++++++++++-
> > > > > > > > > > > drivers/gpu/drm/i915/display/intel_dp_mst.h |
> > > > > > > > > > > 2 +
> > > > > > > > > > > 6 files changed, 216 insertions(+), 7 deletions(-)
> > > > > > > > > > >
> > > > > > > > > > > diff --git
> > > > > > > > > > > a/drivers/gpu/drm/i915/display/intel_ddi.c
> > > > > > > > > > > b/drivers/gpu/drm/i915/display/intel_ddi.c
> > > > > > > > > > > index a976606d21c7..d2f0d393d3ee 100644
> > > > > > > > > > > --- a/drivers/gpu/drm/i915/display/intel_ddi.c
> > > > > > > > > > > +++ b/drivers/gpu/drm/i915/display/intel_ddi.c
> > > > > > > > > > > @@ -35,6 +35,7 @@
> > > > > > > > > > > #include "intel_display_types.h"
> > > > > > > > > > > #include "intel_dp.h"
> > > > > > > > > > > #include "intel_dp_link_training.h"
> > > > > > > > > > > +#include "intel_dp_mst.h"
> > > > > > > > > > > #include "intel_dpio_phy.h"
> > > > > > > > > > > #include "intel_dsi.h"
> > > > > > > > > > > #include "intel_fifo_underrun.h"
> > > > > > > > > > > @@ -1903,8 +1904,13 @@
> > > > > > > > > > > intel_ddi_transcoder_func_reg_val_get(const
> > > > > > > > > > > struct intel_crtc_state *crtc_state)
> > > > > > > > > > > temp |= TRANS_DDI_MODE_SELECT_DP_MST;
> > > > > > > > > > > temp |= DDI_PORT_WIDTH(crtc_state-
> > > > > > > > > > > > lane_count);
> > > > > > > > > > >
> > > > > > > > > > > - if (INTEL_GEN(dev_priv) >= 12)
> > > > > > > > > > > - temp |=
> > > > > > > > > > > TRANS_DDI_MST_TRANSPORT_SELECT(crtc_state-
> > > > > > > > > > > > cpu_transcoder);
> > > > > > > > > > > + if (INTEL_GEN(dev_priv) >= 12) {
> > > > > > > > > > > + enum transcoder master;
> > > > > > > > > > > +
> > > > > > > > > > > + master =
> > > > > > > > > > > intel_dp_mst_master_trans_get(encoder);
> > > > > > > > > >
> > > > > > > > > > Why isn't that just stored in the crtc state like
> > > > > > > > > > everything
> > > > > > > > > > else?
> > > > > > > > > >
> > > > > > > > > > I'm thinking we should maybe do it just like port
> > > > > > > > > > sync
> > > > > > > > > > and
> > > > > > > > > > have
> > > > > > > > > > both
> > > > > > > > > > master + slave_mask. That way it should be pretty
> > > > > > > > > > trivial
> > > > > > > > > > to
> > > > > > > > > > add
> > > > > > > > > > all
> > > > > > > > > > the relevant crtcs to the state when needed.
> > > > > > > > >
> > > > > > > > > I guess port sync is not doing the right thing and it
> > > > > > > > > could
> > > > > > > > > cause
> > > > > > > > > underruns.
> > > > > > > > > When it is going to enable the master CRTC of the port
> > > > > > > > > sync
> > > > > > > > > it
> > > > > > > > > forcibly
> > > > > > > > > enables the slave first, what could cause underruns
> > > > > > > > > because
> > > > > > > > > of
> > > > > > > > > overlap
> > > > > > > > > in ddb allocations(that is what I understood from the
> > > > > > > > > comment
> > > > > > > > > in
> > > > > > > > > skl_commit_modeset_enables()).
> > > > > > > >
> > > > > > > > Not necessarily just underruns but even a system hang.
> > > > > > > > The
> > > > > > > > fix
> > > > > > > > should
> > > > > > > > be
> > > > > > > > a trivial "check the slave for ddb overlap as well", but
> > > > > > > > apparently I
> > > > > > > > failed at convicing people to do that.
> > > > > > > >
> > > > > > > > I've actually been pondering about decoupling the plane
> > > > > > > > updates
> > > > > > > > from
> > > > > > > > the crtc enable stuff entirely. At least theoretically
> > > > > > > > crtc
> > > > > > > > enable
> > > > > > > > should be able to excute in any order as long we don't
> > > > > > > > enable
> > > > > > > > any
> > > > > > > > new planes.
> > > > > > > >
> > > > > > > > But none of that really matters for the discussion at
> > > > > > > > hand.
> > > > > > > > Though
> > > > > > > > there are other problems with the port sync stuff that
> > > > > > > > would
> > > > > > > > need
> > > > > > > > to be handled better. Eg. I think it now adds both crtcs
> > > > > > > > to
> > > > > > > > the
> > > > > > > > state
> > > > > > > > always which is going to cut the fps in half. Also the
> > > > > > > > place
> > > > > > > > where
> > > > > > > > it does that stuff is rather suspicious. All that stuff
> > > > > > > > should be
> > > > > > > > somewhere a bit higher up IMO.
> > > > > > > >
> > > > > > > > > So for MST we only know who is the master in the commit
> > > > > > > > > phase
> > > > > > > > > and
> > > > > > > > > at
> > > > > > > > > this point we should not modify the computed state.
> > > > > > > >
> > > > > > > > I'm not suggesting modifying anything during commit
> > > > > > > > phase. I
> > > > > > > > think
> > > > > > > > you are effectiely doing that right now by stuffing that
> > > > > > > > mst
> > > > > > > > master
> > > > > > > > transcoder into intel_dp.
> > > > > > >
> > > > > > > Sorry, I still don't get what approach are you suggesting
> > > > > > > here.
> > > > > > >
> > > > > > > If we can't modify the state in the commit phase, adding
> > > > > > > mst_master_transcoder in the CRTC state will not be
> > > > > > > possible
> > > > > > > while
> > > > > > > respecting the order imposed by ddb allocations.
> > > > > >
> > > > > > The ddb allocation ordering only comes into play when there
> > > > > > are
> > > > > > already active pipes. It should always be possible to not
> > > > > > enable
> > > > > > the slaves until the master has been shuffled into place in
> > > > > > the
> > > > > > ddb and enabled.
> > > > >
> > > > > This sounds contradictory to what you answered here:
> > > > > https://lists.freedesktop.org/archives/intel-gfx/2019-November/221608.html
> > > > >
> > > > > Will need to some testing to get the steps but I was able
> > > > > consistent to
> > > > > get to state were doing a full modeset in pipe A(mst master)
> > > > > caused
> > > > > the
> > > > > pipe B(mst slave) to enabled first because of the ddb
> > > > > allocations.
> > > > >
> > > > > So can I or not do something like port sync does? And force the
> > > > > enable
> > > > > of master before the slaves? If possible, the comment in
> > > > > skl_commit_modeset_enables() will need some changes.
> > > >
> > > > I suspect for the mst stuff we should do:
> > > >
> > > > while_dirty_mst_masters() {
> > > > if (!ddb_overlap)
> > > > enable();
> > > > }
> > > > while_dirty_mst_slaves() {
> > > > if (!ddb_overlap)
> > > > enable();
> > > > }
> > >
> > > What about this case?
> > >
> > > Pipe/transcoder A and B in the same MST stream
> > >
> > > # old state - DDB allocation: AABBB
> > > mst master = transcoder A(computed in atomic check phase)
> > > entries[0].start = 0
> > > entries[0].end = 1
> > > entries[1].start = 2
> > > entries[1].end = 4
> > >
> > > # new state - DDB allocation: AAABBB
> > > mst master = transcoder A(computed in atomic check phase)
> > > entries[0].start = 0
> > > entries[0].end = 2
> > > entries[1].start = 3
> > > entries[1].end = 5
> > >
> > > while_dirty_mst_masters()
> > > first iteration: pipe A will overlap with old pipe B DDB
> >
> > There won't be an old DDB allocation for a pipe if it's going
> > trough a modeset.
>
> Just added some debug messages to skl_commit_modeset_enables(), changed
> the resolution of the 2 pipes enabled in the same MST stream and
> old_crtc_state->wm.skl.ddb is set kept set with the old values.
>
> So should we fix that first loop in skl_commit_modeset_enables()?
>
> for_each_oldnew_intel_crtc_in_state(state, crtc, old_crtc_state,
> new_crtc_state, i)
> /* ignore allocations for crtc's that have been turned off. */
> if (!needs_modeset(new_crtc_state) && new_crtc_state-
> >hw.active)
> entries[i] = old_crtc_state->wm.skl.ddb;
I thought this is what it already did, but I guess I was wrong. Yes,
I think this is what it should do.
> In this case there is not difference between old_crtc_state->wm.skl.ddb
> or new_crtc_state->wm.skl.ddb, so maybe also change to new_crtc_state?
I think it's better to keep using the old crtc state here. Just in case
someone comes up with a good reason to do ddb reallocation across pipes
when there isn't a modeset.
--
Ville Syrjälä
Intel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2019-12-04 19:03 UTC|newest]
Thread overview: 65+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-11-23 0:54 [PATCH 1/7] drm/i915/display: Refactor intel_commit_modeset_disables() José Roberto de Souza
2019-11-23 0:54 ` [Intel-gfx] " José Roberto de Souza
2019-11-23 0:54 ` [PATCH 2/7] drm/i915/display: Check the old state to find port sync slave José Roberto de Souza
2019-11-23 0:54 ` [Intel-gfx] " José Roberto de Souza
2019-11-26 19:41 ` Ville Syrjälä
2019-11-26 19:41 ` [Intel-gfx] " Ville Syrjälä
2019-11-23 0:54 ` [PATCH 3/7] drm/i915/tgl: Select master trasconder for MST stream José Roberto de Souza
2019-11-23 0:54 ` [Intel-gfx] " José Roberto de Souza
2019-11-26 20:05 ` Ville Syrjälä
2019-11-26 20:05 ` [Intel-gfx] " Ville Syrjälä
2019-11-26 20:30 ` Souza, Jose
2019-11-26 20:30 ` [Intel-gfx] " Souza, Jose
2019-11-27 19:59 ` Ville Syrjälä
2019-11-27 19:59 ` [Intel-gfx] " Ville Syrjälä
2019-11-28 1:14 ` Souza, Jose
2019-11-28 1:14 ` [Intel-gfx] " Souza, Jose
2019-11-28 12:06 ` Ville Syrjälä
2019-11-28 12:06 ` [Intel-gfx] " Ville Syrjälä
2019-12-02 22:03 ` Souza, Jose
2019-12-02 22:03 ` [Intel-gfx] " Souza, Jose
2019-12-03 12:47 ` Ville Syrjälä
2019-12-03 22:12 ` Souza, Jose
2019-12-04 10:55 ` Ville Syrjälä
2019-12-04 18:48 ` Souza, Jose
2019-12-04 19:03 ` Ville Syrjälä [this message]
2019-11-23 0:54 ` [PATCH 4/7] drm/i915/dp: Power down sink before disable pipe/transcoder clock José Roberto de Souza
2019-11-23 0:54 ` [Intel-gfx] " José Roberto de Souza
2019-11-26 20:15 ` Ville Syrjälä
2019-11-26 20:15 ` [Intel-gfx] " Ville Syrjälä
2019-11-26 22:12 ` Souza, Jose
2019-11-26 22:12 ` [Intel-gfx] " Souza, Jose
2019-11-27 19:24 ` Ville Syrjälä
2019-11-27 19:24 ` [Intel-gfx] " Ville Syrjälä
2019-11-28 1:08 ` Souza, Jose
2019-11-28 1:08 ` [Intel-gfx] " Souza, Jose
2019-11-28 18:30 ` Ville Syrjälä
2019-11-28 18:30 ` [Intel-gfx] " Ville Syrjälä
2019-11-23 0:54 ` [PATCH 5/7] drm/i915/display/mst: Move DPMS_OFF call to post_disable José Roberto de Souza
2019-11-23 0:54 ` [Intel-gfx] " José Roberto de Souza
2019-11-28 18:31 ` Ville Syrjälä
2019-11-28 18:31 ` [Intel-gfx] " Ville Syrjälä
2019-11-23 0:54 ` [PATCH 6/7] drm/i915/display/tgl: Fix the order of the step to turn transcoder clock off José Roberto de Souza
2019-11-23 0:54 ` [Intel-gfx] " José Roberto de Souza
2019-11-28 18:40 ` Ville Syrjälä
2019-11-28 18:40 ` [Intel-gfx] " Ville Syrjälä
2019-12-03 23:29 ` Souza, Jose
2019-12-04 10:56 ` Ville Syrjälä
2019-11-23 0:54 ` [PATCH 7/7] drm/display/dp: Fix MST disable sequences José Roberto de Souza
2019-11-23 0:54 ` [Intel-gfx] " José Roberto de Souza
2019-11-23 1:28 ` ✓ Fi.CI.BAT: success for series starting with [1/7] drm/i915/display: Refactor intel_commit_modeset_disables() Patchwork
2019-11-23 1:28 ` [Intel-gfx] " Patchwork
2019-11-24 7:11 ` ✓ Fi.CI.IGT: " Patchwork
2019-11-24 7:11 ` [Intel-gfx] " Patchwork
2019-11-26 19:40 ` [PATCH 1/7] " Ville Syrjälä
2019-11-26 19:40 ` [Intel-gfx] " Ville Syrjälä
2019-11-26 22:03 ` Souza, Jose
2019-11-26 22:03 ` [Intel-gfx] " Souza, Jose
2019-11-26 22:49 ` Matt Roper
2019-11-26 22:49 ` [Intel-gfx] " Matt Roper
2019-11-26 23:03 ` Souza, Jose
2019-11-26 23:03 ` [Intel-gfx] " Souza, Jose
2019-11-27 18:49 ` Lucas De Marchi
2019-11-27 18:49 ` [Intel-gfx] " Lucas De Marchi
2019-11-27 19:11 ` Ville Syrjälä
2019-11-27 19:11 ` [Intel-gfx] " Ville Syrjälä
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20191204190315.GC1208@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jose.souza@intel.com \
--cc=lucas.demarchi@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox