linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Quentin Schulz <quentin.schulz@bootlin.com>
Cc: Manasi Navare <manasi.d.navare@intel.com>,
	Mark Rutland <mark.rutland@arm.com>,
	David Airlie <airlied@linux.ie>,
	stelford@cadence.com, dri-devel@lists.freedesktop.org,
	linux-kernel@vger.kernel.org, pgaj@cadence.com,
	Laurent Pinchart <Laurent.pinchart@ideasonboard.com>,
	jartur@cadence.com, ltyrala@cadence.com,
	linux-rockchip@lists.infradead.org, piotrs@cadence.com,
	devicetree@vger.kernel.org, jbergsagel@ti.com,
	Rob Herring <robh+dt@kernel.org>, Sean Paul <sean@poorly.run>,
	Damian Kos <dkos@cadence.com>,
	linux-arm-kernel@lists.infradead.org,
	Quentin Schulz <quentin.schulz@free-electrons.com>
Subject: Re: [PATCH v4 2/5] drm/dp: fix link probing for devices supporting DP 1.4+
Date: Tue, 2 Oct 2018 16:28:49 +0300	[thread overview]
Message-ID: <20181002132849.GR9144@intel.com> (raw)
In-Reply-To: <20181001092708.ow4rxgzp4haax76k@qschulz>

On Mon, Oct 01, 2018 at 11:27:08AM +0200, Quentin Schulz wrote:
> Hi Manasi,
> 
> On Fri, Sep 21, 2018 at 12:59:30AM -0700, Manasi Navare wrote:
> > Thanks for the patch. Verified with the DP 1.4 spec and looks good to me.
> > Also look at the related patch that makes use of the correct extended capabilities:
> > 
> > https://patchwork.freedesktop.org/patch/249400/
> > 
> 
> If I'm not mistaken, you could get rid of the patch in the Intel driver
> when we have this one merged. Is there any reason not to, have I missed
> something?

i915 (and most other drivers) don't use this code. Also as mentioned in
that thread you should probably validate that the data in the extended
caps looks sane, otherwise the entire point of having it for compatibility
with older source devices is lost.

> 
> Thanks,
> Quentin
> 
> > Reviewed-by: Manasi Navare <manasi.d.navare@intel.com>
> > 
> > Manasi
> > 
> > 
> > On Thu, Sep 20, 2018 at 03:54:37PM +0100, Damian Kos wrote:
> > > From: Quentin Schulz <quentin.schulz@free-electrons.com>
> > > 
> > > DP 1.4 introduced a DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT bit in
> > > DP_TRAINING_AUX_RD_INTERVAL register. If set, DPCD registers from
> > > DP_DPCD_REV to DP_ADAPTER_CAP should be retrieved starting from
> > > DP_DPCD_REV_EXTENDED. All registers are copied except DP_DPCD_REV,
> > > DP_MAX_LINK_RATE and DP_DOWNSTREAMPORT_PRESENT which represent the
> > > "true capabilities" of DPRX device.
> > > 
> > > Original DP_DPCD_REV, DP_MAX_LINK_RATE and DP_DOWNSTREAMPORT_PRESENT
> > > might falsely return lower capabilities to "avoid interoperability
> > > issues with some of the existing DP Source devices that malfunction
> > > when they discover the higher capabilities within those three
> > > registers.".
> > > 
> > > Before DP 1.4, DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT bit was reserved
> > > and read 0 so it's safe to check against it even if DP revision is
> > > <1.4
> > > 
> > > Signed-off-by: Quentin Schulz <quentin.schulz@free-electrons.com>
> > > Signed-off-by: Damian Kos <dkos@cadence.com>
> > > ---
> > >  drivers/gpu/drm/drm_dp_helper.c | 30 +++++++++++++++++++++++++++++-
> > >  1 file changed, 29 insertions(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> > > index 8c6b9fd89f8a..735ebde5c2f0 100644
> > > --- a/drivers/gpu/drm/drm_dp_helper.c
> > > +++ b/drivers/gpu/drm/drm_dp_helper.c
> > > @@ -370,10 +370,38 @@ int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link)
> > >  {
> > >  	u8 values[3];
> > >  	int err;
> > > +	unsigned int addr;
> > >  
> > >  	memset(link, 0, sizeof(*link));
> > >  
> > > -	err = drm_dp_dpcd_read(aux, DP_DPCD_REV, values, sizeof(values));
> > > +	/*
> > > +	 * DP 1.4 introduced a DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT bit in
> > > +	 * DP_TRAINING_AUX_RD_INTERVAL register. If set, DPCD registers from
> > > +	 * DP_DPCD_REV to DP_ADAPTER_CAP should be retrieved starting from
> > > +	 * DP_DPCD_REV_EXTENDED. All registers are copied except DP_DPCD_REV,
> > > +	 * DP_MAX_LINK_RATE and DP_DOWNSTREAMPORT_PRESENT which represent the
> > > +	 * "true capabilities" of DPRX device.
> > > +	 *
> > > +	 * Original DP_DPCD_REV, DP_MAX_LINK_RATE and DP_DOWNSTREAMPORT_PRESENT
> > > +	 * might falsely return lower capabilities to "avoid interoperability
> > > +	 * issues with some of the existing DP Source devices that malfunction
> > > +	 * when they discover the higher capabilities within those three
> > > +	 * registers.".
> > > +	 *
> > > +	 * Before DP 1.4, DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT bit was reserved
> > > +	 * and read 0 so it's safe to check against it even if DP revision is
> > > +	 * <1.4
> > > +	 */
> > > +	err = drm_dp_dpcd_readb(aux, DP_TRAINING_AUX_RD_INTERVAL, values);
> > > +	if (err < 0)
> > > +		return err;
> > > +
> > > +	if (values[0] & DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT)
> > > +		addr = DP_DP13_DPCD_REV;
> > > +	else
> > > +		addr = DP_DPCD_REV;
> > > +
> > > +	err = drm_dp_dpcd_read(aux, addr, values, sizeof(values));
> > >  	if (err < 0)
> > >  		return err;
> > >  
> > > -- 
> > > 2.17.1
> > > 
> > > _______________________________________________
> > > dri-devel mailing list
> > > dri-devel@lists.freedesktop.org
> > > https://lists.freedesktop.org/mailman/listinfo/dri-devel



> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel


-- 
Ville Syrjälä
Intel

  reply	other threads:[~2018-10-02 13:29 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-09-20 14:54 [PATCH v4 0/5] drm: add support for Cadence MHDP DPI/DP bridge Damian Kos
2018-09-20 14:54 ` [PATCH v4 1/5] drm/rockchip: prepare common code for cdns and rk dpi/dp driver Damian Kos
2018-09-20 14:54 ` [PATCH v4 2/5] drm/dp: fix link probing for devices supporting DP 1.4+ Damian Kos
2018-09-21  7:59   ` Manasi Navare
2018-10-01  9:27     ` Quentin Schulz
2018-10-02 13:28       ` Ville Syrjälä [this message]
2018-09-20 14:54 ` [PATCH v4 3/5] drm/dp: make dp_get_lane_status usable from outside of the core Damian Kos
2018-09-20 14:54 ` [PATCH v4 4/5] dt-bindings: drm/bridge: Document Cadence MHDP bridge bindings Damian Kos
2018-09-20 14:54 ` [PATCH v4 5/5] drm: bridge: add support for Cadence MHDP DPI/DP bridge Damian Kos
2018-09-21  8:41   ` Heiko Stuebner
2018-09-24 11:40     ` Damian Kos
2018-09-24 12:28       ` Heiko Stuebner
2018-09-24 12:47         ` Damian Kos
2018-09-21 14:01   ` Sean Paul
2018-09-24 10:22     ` Damian Kos

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=20181002132849.GR9144@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=Laurent.pinchart@ideasonboard.com \
    --cc=airlied@linux.ie \
    --cc=devicetree@vger.kernel.org \
    --cc=dkos@cadence.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=jartur@cadence.com \
    --cc=jbergsagel@ti.com \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rockchip@lists.infradead.org \
    --cc=ltyrala@cadence.com \
    --cc=manasi.d.navare@intel.com \
    --cc=mark.rutland@arm.com \
    --cc=pgaj@cadence.com \
    --cc=piotrs@cadence.com \
    --cc=quentin.schulz@bootlin.com \
    --cc=quentin.schulz@free-electrons.com \
    --cc=robh+dt@kernel.org \
    --cc=sean@poorly.run \
    --cc=stelford@cadence.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;
as well as URLs for NNTP newsgroup(s).