From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: "Atwood, Matthew S" <matthew.s.atwood@intel.com>
Cc: "Navare, Manasi D" <manasi.d.navare@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>,
"dri-devel@lists.freedesktop.org"
<dri-devel@lists.freedesktop.org>
Subject: Re: [PATCH 2/2] drm/i915: implement EXTENDED_RECEIVER_CAPABILITY_FIELD_PRESENT
Date: Thu, 19 Jul 2018 15:06:56 -0700 [thread overview]
Message-ID: <20180719220656.GA2182@intel.com> (raw)
In-Reply-To: <cc949f30af4bc12dbf2f28a7a57bd88906a50533.camel@intel.com>
On Thu, Jul 19, 2018 at 02:47:59PM -0700, Atwood, Matthew S wrote:
> On Thu, 2018-07-19 at 14:07 -0700, Rodrigo Vivi wrote:
> > On Thu, Jul 19, 2018 at 01:35:49PM -0700, matthew.s.atwood@intel.com
> > wrote:
> > > From: Matt Atwood <matthew.s.atwood@intel.com>
> > >
> > > According to DP spec (2.9.3.1 of DP 1.4) if
> > > EXTENDED_RECEIVER_CAPABILITY_FIELD_PRESENT is set the addresses in
> > > DPCD
> > > 02200h through 0220Fh shall contain the DPRX's true capability.
> > > These
> > > values will match 00000h through 0000Fh, except for DPCD_REV,
> > > MAX_LINK_RATE, DOWN_STREAM_PORT_PRESENT.
> > >
> > > Read from DPCD once for all 3 values as this is an expensive
> > > operation.
> > > Spec mentions that all of address space 02200h through 0220Fh
> > > should
> > > contain the right information however currently only 3 values can
> > > differ.
> > >
> > > There is no address space in the intel_dp->dpcd struct for
> > > addresses
> > > 02200h through 0220Fh, and since so much of the data is a
> > > identical,
> > > simply overwrite the values stored in 00000h through 0000Fh with
> > > the
> > > values that can be overwritten from addresses 02200h through
> > > 0220Fh.
> > >
> > > This patch helps with backward compatibility for devices pre DP1.3.
> > >
> > > v2: read only dpcd values which can be affected, remove incorrect
> > > check,
> > > split into drm include changes into separate patch, commit message,
> > > verbose debugging statements during overwrite.
> > >
> > > v3: white space fixes
> > >
> > > Signed-off-by: Matt Atwood <matthew.s.atwood@intel.com>
> > > ---
> > > drivers/gpu/drm/i915/intel_dp.c | 37
> > > +++++++++++++++++++++++++++++++++
> > > 1 file changed, 37 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/i915/intel_dp.c
> > > b/drivers/gpu/drm/i915/intel_dp.c
> > > index dde92e4af5d3..a31fbbbd7954 100644
> > > --- a/drivers/gpu/drm/i915/intel_dp.c
> > > +++ b/drivers/gpu/drm/i915/intel_dp.c
> > > @@ -3738,6 +3738,43 @@ intel_dp_read_dpcd(struct intel_dp
> > > *intel_dp)
> > > sizeof(intel_dp->dpcd)) < 0)
> > > return false; /* aux transfer failed */
> > >
> >
> > We never know what vendors can do with reserved bits. We should never
> > assume
> > they are zero. So we shouldn't do any of below unless it is newer
> > than DP 1.3.
> I think you mean newer than DP1.2?
yeap, sorry..
>= DP1.3
> >
> > > + if (intel_dp->dpcd[DP_TRAINING_AUX_RD_INTERVAL] &
> > > + DP_EXTENDED_RECEIVER_CAP_FIELD_PRESENT) {
> > > + uint8_t dpcd_ext[6];
> > > +
> > > + DRM_DEBUG_KMS("DPCD: Extended Receiver Capability
> > > Field Present, accessing 02200h through 022FFh\n");
> > > +
> > > + if (drm_dp_dpcd_read(&intel_dp->aux,
> > > DP_DP13_DPCD_REV,
> > > + &dpcd_ext, sizeof(dpcd_ext))
> > > < 0)
> > > + return false; /* aux transfer failed */
> > > +
> > > + if (memcmp(&intel_dp->dpcd[DP_DPCD_REV],
> > > &dpcd_ext[DP_DPCD_REV],
> > > + sizeof(u8))) {
> > > + DRM_DEBUG_KMS("DPCD: new value for DPCD
> > > Revision previous value %2x new value %2x\n",
> > > + intel_dp->dpcd[DP_DPCD_REV],
> > > + dpcd_ext[DP_DPCD_REV]);
> > > + memcpy(&intel_dp->dpcd[DP_DPCD_REV],
> > > + &dpcd_ext[DP_DPCD_REV],
> > > + sizeof(u8));
> > > + }
> > > + if (memcmp(&intel_dp->dpcd[DP_MAX_LINK_RATE],
> > > + &dpcd_ext[DP_MAX_LINK_RATE],
> > > sizeof(u8))) {
> > > + DRM_DEBUG_KMS("DPCD: new value for DPCD
> > > Max Link Rate previous value %2x new value %2x\n",
> > > + intel_dp-
> > > >dpcd[DP_MAX_LINK_RATE],
> > > + dpcd_ext[DP_MAX_LINK_RATE]);
> > > + memcpy(&intel_dp->dpcd[DP_MAX_LINK_RATE],
> > > + &dpcd_ext[DP_MAX_LINK_RATE],
> > > sizeof(u8));
> > > + }
> > > + if (memcmp(&intel_dp-
> > > >dpcd[DP_DOWNSTREAMPORT_PRESENT],
> > > + &dpcd_ext[DP_DOWNSTREAMPORT_PRESENT],
> > > sizeof(u8))) {
> > > + DRM_DEBUG_KMS("DPCD: new value for DPCD
> > > Downstream Port Present previous value %2x new value %2x\n",
> > > + intel_dp-
> > > >dpcd[DP_DOWNSTREAMPORT_PRESENT],
> > > + dpcd_ext[DP_DOWNSTREAMPORT_P
> > > RESENT]);
> > > + memcpy(&intel_dp-
> > > >dpcd[DP_DOWNSTREAMPORT_PRESENT],
> > > + &dpcd_ext[DP_DOWNSTREAMPORT_PRESENT
> > > ],
> > > + sizeof(u8));
> > > + }
> > > + }
> > > DRM_DEBUG_KMS("DPCD: %*ph\n", (int) sizeof(intel_dp-
> > > >dpcd), intel_dp->dpcd);
> > >
> > > return intel_dp->dpcd[DP_DPCD_REV] != 0;
> > > --
> > > 2.17.1
> > >
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2018-07-19 22:06 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-17 21:49 [PATCH 1/2] drm/dp: add extended receiver capability field present bit matthew.s.atwood
2018-07-17 21:49 ` [PATCH 2/2] drm/i915: implement EXTENDED_RECEIVER_CAPABILITY_FIELD_PRESENT matthew.s.atwood
2018-07-17 22:34 ` [Intel-gfx] " Dhinakaran Pandiyan
2018-07-17 22:36 ` Rodrigo Vivi
2018-07-17 23:01 ` Dhinakaran Pandiyan
2018-07-19 20:35 ` [PATCH 1/2] drm/dp: add extended receiver capability field present bit matthew.s.atwood
2018-07-19 20:35 ` [PATCH 2/2] drm/i915: implement EXTENDED_RECEIVER_CAPABILITY_FIELD_PRESENT matthew.s.atwood
2018-07-19 21:07 ` Rodrigo Vivi
2018-07-19 21:47 ` Atwood, Matthew S
2018-07-19 22:06 ` Rodrigo Vivi [this message]
2018-07-19 21:04 ` [PATCH 1/2] drm/dp: add extended receiver capability field present bit Rodrigo Vivi
2018-07-17 22:00 ` ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/2] " Patchwork
2018-07-17 22:24 ` ✓ Fi.CI.BAT: success " Patchwork
2018-07-18 6:05 ` ✓ Fi.CI.IGT: " Patchwork
2018-07-18 22:36 ` [PATCH 1/2] " Rodrigo Vivi
2018-07-19 21:31 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/dp: add extended receiver capability field present bit (rev3) Patchwork
-- strict thread matches above, loose matches on Subject: below --
2018-07-20 16:18 [PATCH 1/2] drm/dp: add extended receiver capability field present bit matthew.s.atwood
2018-07-20 16:18 ` [PATCH 2/2] drm/i915: implement EXTENDED_RECEIVER_CAPABILITY_FIELD_PRESENT matthew.s.atwood
2018-07-20 17:47 ` Rodrigo Vivi
2018-07-20 17:55 ` Manasi Navare
2018-07-23 21:27 [PATCH 1/2] drm/dp: add extended receiver capability field present bit matthew.s.atwood
2018-07-23 21:27 ` [PATCH 2/2] drm/i915: implement EXTENDED_RECEIVER_CAPABILITY_FIELD_PRESENT matthew.s.atwood
2018-07-23 22:19 ` Rodrigo Vivi
2018-07-24 16:30 ` Rodrigo Vivi
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=20180719220656.GA2182@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=manasi.d.navare@intel.com \
--cc=matthew.s.atwood@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;
as well as URLs for NNTP newsgroup(s).