From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Mika Kahola <mika.kahola@intel.com>
Cc: daniel.vetter@ffwll.ch, intel-gfx@lists.freedesktop.org,
dri-devel@lists.freedesktop.org
Subject: Re: [PATCH v7 1/5] drm: Read DP branch device HW revision
Date: Thu, 11 Aug 2016 11:22:15 +0300 [thread overview]
Message-ID: <20160811082215.GI4329@intel.com> (raw)
In-Reply-To: <1470903283.26860.7.camel@sorvi>
On Thu, Aug 11, 2016 at 11:14:43AM +0300, Mika Kahola wrote:
> On Thu, 2016-08-11 at 10:10 +0300, Ville Syrjälä wrote:
> > On Mon, Aug 08, 2016 at 04:00:26PM +0300, Mika Kahola wrote:
> > > HW revision is mandatory field for DisplayPort branch
> > > devices. This is defined in DPCD register field 0x509.
> >
> > But what do we want to do with it? Me, I don't see a point in parsing a
> > bunch of stuff from the DPCD unless there's a real use case for it.
> > /dev/drm_dp_aux will provide all the debug aid we need if we need to
> > check random pieces of data from the DPCD, so even exposing this sort
> > of stuff via debugfs is IMO pretty pointless.
> >
> > If there's a good reason for a debug print, then I think we could parse
> > something and dump it out so that it's always in the dmesg. But so far
> > I'm not aware of any bug that would have required to deal with different
> > hw revisions of things and whatnot.
> >
> Digging up the HW and SW revisions are just for debugging purposes. My
> idea here was that it would be handy if this information would be
> available if we face a problem let's say with VGA dongle for example. It
> is true that at the moment we don't have a single bug that would require
> HW/SW revision information but maybe in the future we have one.
>
> So, if we don't want to have this stuff in drm_dp_helpers and/or debugfs
> I could make a change and print this info on dmesg when DP branch device
> is plugged in.
Perhaps. We do print out the OUI as well, so there is some precedent.
>
> Cheers,
> Mika
>
> > >
> > > v2: move drm_dp_ds_revision structure to be part of
> > > drm_dp_link structure (Daniel)
> > >
> > > Signed-off-by: Mika Kahola <mika.kahola@intel.com>
> > > ---
> > > drivers/gpu/drm/drm_dp_helper.c | 27 +++++++++++++++++++++++++++
> > > drivers/gpu/drm/i915/intel_drv.h | 1 +
> > > include/drm/drm_dp_helper.h | 9 +++++++++
> > > 3 files changed, 37 insertions(+)
> > >
> > > diff --git a/drivers/gpu/drm/drm_dp_helper.c b/drivers/gpu/drm/drm_dp_helper.c
> > > index 75b2873..5fecdc1 100644
> > > --- a/drivers/gpu/drm/drm_dp_helper.c
> > > +++ b/drivers/gpu/drm/drm_dp_helper.c
> > > @@ -514,6 +514,33 @@ int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
> > > EXPORT_SYMBOL(drm_dp_downstream_max_bpc);
> > >
> > > /**
> > > + * drm_dp_downstream_hw_rev() - read DP branch device HW revision
> > > + * @aux: DisplayPort AUX channel
> > > + *
> > > + * Returns 0 on succes or negative error code on failure
> > > + */
> > > +int drm_dp_downstream_hw_rev(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
> > > + struct drm_dp_aux *aux, struct drm_dp_link *link)
> > > +{
> > > + uint8_t tmp;
> > > + int err;
> > > +
> > > + if (!(dpcd[DP_DOWNSTREAMPORT_PRESENT] & DP_DWN_STRM_PORT_PRESENT))
> > > + return -EINVAL;
> > > +
> > > + err = drm_dp_dpcd_read(aux, DP_BRANCH_HW_REV, &tmp, 1);
> > > +
> > > + if (err < 0)
> > > + return err;
> > > +
> > > + link->ds_hw_rev.major = (tmp & 0xf0) >> 4;
> > > + link->ds_hw_rev.minor = tmp & 0xf;
> > > +
> > > + return 0;
> > > +}
> > > +EXPORT_SYMBOL(drm_dp_downstream_hw_rev);
> > > +
> > > +/**
> > > * drm_dp_downstream_id() - identify branch device
> > > * @aux: DisplayPort AUX channel
> > > *
> > > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> > > index e74d851..a6eccf5 100644
> > > --- a/drivers/gpu/drm/i915/intel_drv.h
> > > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > > @@ -865,6 +865,7 @@ struct intel_dp {
> > > uint8_t num_sink_rates;
> > > int sink_rates[DP_MAX_SUPPORTED_RATES];
> > > struct drm_dp_aux aux;
> > > + struct drm_dp_link link;
> > > uint8_t train_set[4];
> > > int panel_power_up_delay;
> > > int panel_power_down_delay;
> > > diff --git a/include/drm/drm_dp_helper.h b/include/drm/drm_dp_helper.h
> > > index 8e1fe58..1127948 100644
> > > --- a/include/drm/drm_dp_helper.h
> > > +++ b/include/drm/drm_dp_helper.h
> > > @@ -446,6 +446,7 @@
> > > #define DP_SINK_OUI 0x400
> > > #define DP_BRANCH_OUI 0x500
> > > #define DP_BRANCH_ID 0x503
> > > +#define DP_BRANCH_HW_REV 0x509
> > >
> > > #define DP_SET_POWER 0x600
> > > # define DP_SET_POWER_D0 0x1
> > > @@ -803,11 +804,17 @@ int drm_dp_dpcd_read_link_status(struct drm_dp_aux *aux,
> > > */
> > > #define DP_LINK_CAP_ENHANCED_FRAMING (1 << 0)
> > >
> > > +struct drm_dp_ds_revision {
> > > + int major;
> > > + int minor;
> > > +};
> > > +
> > > struct drm_dp_link {
> > > unsigned char revision;
> > > unsigned int rate;
> > > unsigned int num_lanes;
> > > unsigned long capabilities;
> > > + struct drm_dp_ds_revision ds_hw_rev;
> > > };
> > >
> > > int drm_dp_link_probe(struct drm_dp_aux *aux, struct drm_dp_link *link);
> > > @@ -819,6 +826,8 @@ int drm_dp_downstream_max_clock(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
> > > int drm_dp_downstream_max_bpc(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
> > > const u8 port_cap[4]);
> > > int drm_dp_downstream_id(struct drm_dp_aux *aux, char id[6]);
> > > +int drm_dp_downstream_hw_rev(const u8 dpcd[DP_RECEIVER_CAP_SIZE],
> > > + struct drm_dp_aux *aux, struct drm_dp_link *link);
> > >
> > > void drm_dp_aux_init(struct drm_dp_aux *aux);
> > > int drm_dp_aux_register(struct drm_dp_aux *aux);
> > > --
> > > 1.9.1
> >
>
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2016-08-11 8:22 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-08 13:00 [PATCH v7 0/5] drm/i915: DP branch devices Mika Kahola
2016-08-08 13:00 ` [PATCH v7 1/5] drm: Read DP branch device HW revision Mika Kahola
2016-08-11 7:10 ` Ville Syrjälä
2016-08-11 8:14 ` Mika Kahola
2016-08-11 8:22 ` Ville Syrjälä [this message]
2016-08-11 17:21 ` Jim Bride
2016-08-11 17:46 ` Ville Syrjälä
2016-08-08 13:00 ` [PATCH v7 2/5] drm: Read DP branch device SW revision Mika Kahola
2016-08-08 13:00 ` [PATCH v7 3/5] drm/i915: Check pixel rate for DP to VGA dongle Mika Kahola
2016-08-11 7:18 ` Ville Syrjälä
2016-08-11 9:43 ` Mika Kahola
2016-08-11 10:51 ` Ville Syrjälä
2016-08-11 10:56 ` Daniel Vetter
2016-08-11 12:26 ` Mika Kahola
2016-08-11 14:23 ` Ville Syrjälä
2016-08-08 13:00 ` [PATCH v7 4/5] drm: Update bits per component for display info Mika Kahola
2016-08-11 7:22 ` Ville Syrjälä
2016-08-11 8:53 ` Daniel Vetter
2016-08-08 13:00 ` [PATCH v7 5/5] drm: Add DP branch device info on debugfs Mika Kahola
2016-08-08 13:10 ` ✗ Ro.CI.BAT: failure for drm/i915: DP branch devices (rev7) Patchwork
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=20160811082215.GI4329@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mika.kahola@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