mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Lyude Paul <lyude@redhat.com>
To: Koba Ko <koba.ko@canonical.com>,
	Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	Maxime Ripard <mripard@kernel.org>,
	Thomas Zimmermann <tzimmermann@suse.de>,
	David Airlie <airlied@linux.ie>, Daniel Vetter <daniel@ffwll.ch>,
	dri-devel@lists.freedesktop.org,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Cc: Anthony Wong <anthony.wong@canonical.com>
Subject: Re: [PATCH] drm/dp: For MST hub, Get max_link_rate&max_lane from extended rx capability field if EXTENDED_RECEIVER_CAPABILITY_FILED_PRESENT is set.
Date: Wed, 09 Sep 2020 12:33:09 -0400	[thread overview]
Message-ID: <b1dcaf433b7ebe2d0284693724f0e7d8a7fa4825.camel@redhat.com> (raw)
In-Reply-To: <CAJB-X+WPiUR8N5sLMS2UC-rPHj=TGJy2ezeBPjjeUXzbN5bfcg@mail.gmail.com>

We just added a new helper for DPCD retrieval to drm_dp_helper.c (which also
handles grabbing the extended receiver caps), we should probably make use of
it here 

On Wed, 2020-09-09 at 14:31 +0800, Koba Ko wrote:
> On Thu, Aug 27, 2020 at 1:30 PM Koba Ko <koba.ko@canonical.com> wrote:
> > Currently, DRM get the capability of the mst hub only from DP_DPCD_REV and
> > get the slower speed even the mst hub can run in the faster speed.
> > 
> > As per DP-1.3, First check DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT.
> > If DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT is 1, read the DP_DP13_DPCD_REV
> > to
> > get the faster capability.
> > If DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT is 0, read DP_DPCD_REV.
> > 
> > Signed-off-by: Koba Ko <koba.ko@canonical.com>
> > ---
> >  drivers/gpu/drm/drm_dp_mst_topology.c | 10 +++++++++-
> >  1 file changed, 9 insertions(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/drm_dp_mst_topology.c
> > b/drivers/gpu/drm/drm_dp_mst_topology.c
> > index 67dd72ea200e..3b84c6801281 100644
> > --- a/drivers/gpu/drm/drm_dp_mst_topology.c
> > +++ b/drivers/gpu/drm/drm_dp_mst_topology.c
> > @@ -3497,6 +3497,8 @@ static int drm_dp_get_vc_payload_bw(u8 dp_link_bw,
> > u8  dp_link_count)
> >  int drm_dp_mst_topology_mgr_set_mst(struct drm_dp_mst_topology_mgr *mgr,
> > bool mst_state)
> >  {
> >         int ret = 0;
> > +       u8 dpcd_ext = 0;
> > +       unsigned int dpcd_offset = 0;
> >         struct drm_dp_mst_branch *mstb = NULL;
> > 
> >         mutex_lock(&mgr->payload_lock);
> > @@ -3510,9 +3512,15 @@ int drm_dp_mst_topology_mgr_set_mst(struct
> > drm_dp_mst_topology_mgr *mgr, bool ms
> >                 struct drm_dp_payload reset_pay;
> > 
> >                 WARN_ON(mgr->mst_primary);
> > +               drm_dp_dpcd_read(mgr->aux,
> > +                                DP_TRAINING_AUX_RD_INTERVAL,
> > +                                &dpcd_ext, sizeof(dpcd_ext));
> > +
> > +               dpcd_offset =
> > +                       ((dpcd_ext &
> > DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT) ?  DP_DP13_DPCD_REV :
> > DP_DPCD_REV);
> > 
> >                 /* get dpcd info */
> > -               ret = drm_dp_dpcd_read(mgr->aux, DP_DPCD_REV, mgr->dpcd,
> > DP_RECEIVER_CAP_SIZE);
> > +               ret = drm_dp_dpcd_read(mgr->aux, dpcd_offset, mgr->dpcd,
> > DP_RECEIVER_CAP_SIZE);
> >                 if (ret != DP_RECEIVER_CAP_SIZE) {
> >                         DRM_DEBUG_KMS("failed to read DPCD\n");
> >                         goto out_unlock;
> > --
> > 2.25.1
> > 
> Add Lyude Paul
> 
-- 
Cheers,
	Lyude Paul (she/her)
	Software Engineer at Red Hat


  reply	other threads:[~2020-09-09 16:34 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-08-27  5:30 Koba Ko
2020-09-09  6:31 ` Koba Ko
2020-09-09 16:33   ` Lyude Paul [this message]
2020-09-09 18:20     ` Ville Syrjälä
2020-09-09 18:26       ` Lyude Paul
2020-09-09 18:36         ` Ville Syrjälä
2020-09-09 18:58           ` Lyude Paul

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=b1dcaf433b7ebe2d0284693724f0e7d8a7fa4825.camel@redhat.com \
    --to=lyude@redhat.com \
    --cc=airlied@linux.ie \
    --cc=anthony.wong@canonical.com \
    --cc=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=koba.ko@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=mripard@kernel.org \
    --cc=tzimmermann@suse.de \
    /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

all inboxes | Powered by JetHome®