All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "20240127063627.1369883-1-arun.r.murthy@intel.com"
	<20240127063627.1369883-1-arun.r.murthy@intel.com>
Cc: "intel-gfx@lists.freedesktop.org" <intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH 1/2] drm/display/dp: Check for MSTM_CAP before MSTM_CTRL write
Date: Tue, 30 Jan 2024 16:01:26 +0200	[thread overview]
Message-ID: <ZbkBNs7XC6TFWlfQ@intel.com> (raw)
In-Reply-To: <LV2PR11MB6024F22AA5D550720E6D1C458B7D2@LV2PR11MB6024.namprd11.prod.outlook.com>

On Tue, Jan 30, 2024 at 07:56:26AM +0000, Lin, Charlton wrote:
> On 1/27/2024 12:06 PM, Arun R Murthy wrote:
> > With DP2.1, multistream packetization and the underneth MST protocol
> > will be required for SST. So check for MSTM_CAP to see if MST is really
> > required and skip the MSTM_CTRL write so that we ensure that only the
> > underneth protocol and the multistream packetization will be enabled and
> > sink will not be confused by a corresponding dpcd write.
> >
> > Signed-off-by: Arun R Murthy <arun.r.murthy@intel.com>
> > ---
> >  drivers/gpu/drm/display/drm_dp_mst_topology.c | 26 +++++++++++--------
> >  1 file changed, 15 insertions(+), 11 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/display/drm_dp_mst_topology.c b/drivers/gpu/drm/display/drm_dp_mst_topology.c
> > index 8ca01a6bf645..22d81732a978 100644
> > --- a/drivers/gpu/drm/display/drm_dp_mst_topology.c
> > +++ b/drivers/gpu/drm/display/drm_dp_mst_topology.c
> > @@ -3666,10 +3666,11 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms
> >                           mgr->mst_primary = mstb;
> >                           drm_dp_mst_topology_get_mstb(mgr->mst_primary);
> >
> > -                        ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL,
> > -                                                                   DP_MST_EN |
> > -                                                                   DP_UP_REQ_EN |
> > -                                                                   DP_UPSTREAM_IS_SRC);
> > +                       if (drm_dp_read_mst_cap(mgr->aux, mgr->dpcd))
> > +                                      ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL,
> > +                                                                                 DP_MST_EN |
> > +                                                                                 DP_UP_REQ_EN |
> > +                                                                                 DP_UPSTREAM_IS_SRC);
> >                           if (ret < 0)
> >                                         goto out_unlock;
> >
> > @@ -3684,7 +3685,8 @@ int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr, bool ms
> >                           mstb = mgr->mst_primary;
> >                           mgr->mst_primary = NULL;
> >                           /* this can fail if the device is gone */
> > -                        drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, 0);
> > +                       if (drm_dp_read_mst_cap(mgr->aux, mgr->dpcd))
> > +                                      drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL, 0);
> >                           ret = 0;
> >                           mgr->payload_id_table_cleared = false;
> >
> > @@ -3724,8 +3726,9 @@ drm_dp_mst_topology_mgr_invalidate_mstb(struct drm_dp_mst_branch *mstb)
> >  void drm_dp_mst_topology_mgr_suspend(struct drm_dp_mst_topology_mgr *mgr)
> >  {
> >            mutex_lock(&mgr->lock);
> > -          drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL,
> > -                                          DP_MST_EN | DP_UPSTREAM_IS_SRC);
> > +         if (drm_dp_read_mst_cap(mgr->aux, mgr->dpcd))
> > +                       drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL,
> > +                                                       DP_MST_EN | DP_UPSTREAM_IS_SRC);
> >            mutex_unlock(&mgr->lock);
> >            flush_work(&mgr->up_req_work);
> >            flush_work(&mgr->work);
> > @@ -3773,10 +3776,11 @@ int drm_dp_mst_topology_mgr_resume(struct drm_dp_mst_topology_mgr *mgr,
> >                           goto out_fail;
> >            }
> >
> > -          ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL,
> > -                                                     DP_MST_EN |
> > -                                                     DP_UP_REQ_EN |
> > -                                                     DP_UPSTREAM_IS_SRC);
> > +         if (drm_dp_read_mst_cap(mgr->aux, mgr->dpcd))
> > +                       ret = drm_dp_dpcd_writeb(mgr->aux, DP_MSTM_CTRL,
> 
> This did not compile in Chrome dev environemnt due to uninitialized variable ret.
> 
> > +                                                                   DP_MST_EN |
> > +                                                                   DP_UP_REQ_EN |
> > +                                                                   DP_UPSTREAM_IS_SRC);
> >            if (ret < 0) {
> >                           drm_dbg_kms(mgr->dev, "mst write failed - undocked during suspend?\n");
> >                           goto out_fail;
> 
> Tested-by: Charlton Lin <charlton.lin@intel.com>

The mst code does the whole toplogy discovery over sideband,
so if we don't enable that we should not even get a connector
registered. How is anything at all working with this?

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2024-01-30 14:01 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-30  7:56 [PATCH 1/2] drm/display/dp: Check for MSTM_CAP before MSTM_CTRL write Lin, Charlton
2024-01-30 14:01 ` Ville Syrjälä [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-01-27  6:36 Arun R Murthy
2024-01-27  6:36 ` Arun R Murthy

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=ZbkBNs7XC6TFWlfQ@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=20240127063627.1369883-1-arun.r.murthy@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.