From: Imre Deak <imre.deak@intel.com>
To: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH] drm: Print some debug/error info during DP dual mode detect
Date: Wed, 26 Oct 2016 18:27:38 +0300 [thread overview]
Message-ID: <1477495658.9337.1.camel@intel.com> (raw)
In-Reply-To: <20161026151044.GJ4617@intel.com>
On Wed, 2016-10-26 at 18:10 +0300, Ville Syrjälä wrote:
> On Wed, Oct 26, 2016 at 05:50:08PM +0300, Imre Deak wrote:
> > There's at least one LSPCON device that occasionally returns an unexpected
> > adaptor ID which leads to a failed detect. Print some debug info to help
> > debugging this and future cases. Also print an error for an unexpected
> > adaptor ID, so users can report it.
> >
> > Cc: dri-devel@lists.freedesktop.org
> > Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > Signed-off-by: Imre Deak <imre.deak@intel.com>
> > ---
> > drivers/gpu/drm/drm_dp_dual_mode_helper.c | 13 +++++++++++++
> > 1 file changed, 13 insertions(+)
> >
> > diff --git a/drivers/gpu/drm/drm_dp_dual_mode_helper.c b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> > index 488355b..a0e603b 100644
> > --- a/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> > +++ b/drivers/gpu/drm/drm_dp_dual_mode_helper.c
> > @@ -142,6 +142,11 @@ static bool is_hdmi_adaptor(const char hdmi_id[DP_DUAL_MODE_HDMI_ID_LEN])
> > sizeof(dp_dual_mode_hdmi_id)) == 0;
> > }
> >
> > +static bool is_type1_adaptor(uint8_t adaptor_id)
> > +{
> > + return adaptor_id == 0 || adaptor_id == 0xff;
> > +}
> > +
> > static bool is_type2_adaptor(uint8_t adaptor_id)
> > {
> > return adaptor_id == (DP_DUAL_MODE_TYPE_TYPE2 |
> > @@ -193,6 +198,8 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
> > */
> > ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_HDMI_ID,
> > hdmi_id, sizeof(hdmi_id));
> > + DRM_DEBUG_KMS("DP dual mode HDMI ID: %*pE (err %zd)\n",
> > + ret ? 0 : (int)sizeof(hdmi_id), hdmi_id, ret);
>
> What does that %*pE print with size==0, nothing?
Yes.
> > if (ret)
> > return DRM_DP_DUAL_MODE_UNKNOWN;
> >
> > @@ -210,6 +217,8 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
> > */
> > ret = drm_dp_dual_mode_read(adapter, DP_DUAL_MODE_ADAPTOR_ID,
> > &adaptor_id, sizeof(adaptor_id));
> > + DRM_DEBUG_KMS("DP dual mode adaptor ID: %02x (err %zd)\n",
> > + adaptor_id, ret);
> > if (ret == 0) {
> > if (is_lspcon_adaptor(hdmi_id, adaptor_id))
> > return DRM_DP_DUAL_MODE_LSPCON;
> > @@ -219,6 +228,10 @@ enum drm_dp_dual_mode_type drm_dp_dual_mode_detect(struct i2c_adapter *adapter)
> > else
> > return DRM_DP_DUAL_MODE_TYPE2_DVI;
> > }
> > + if (!is_type1_adaptor(adaptor_id) && adaptor_id != hdmi_id[0])
> ^^^^^^^^^^^^^^^^^^^^^^^^
> I take it that was to account for the broken adaptors that ignore the
> offset?
Yep.
> > + DRM_ERROR("Unexpected DP dual mode adapter ID %02x\n",
> > + adaptor_id);
>
> s/adapter/adaptor/ since that's what the spec called it, and I continued
> down the same path to not confuse it the the i2c adapter.
Ok.
> With that
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> > +
> > }
> >
> > if (is_hdmi_adaptor(hdmi_id))
> > --
> > 2.5.0
>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2016-10-26 15:27 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-26 14:50 [PATCH] drm: Print some debug/error info during DP dual mode detect Imre Deak
2016-10-26 15:10 ` Ville Syrjälä
2016-10-26 15:27 ` Imre Deak [this message]
2016-10-26 15:53 ` ✗ Fi.CI.BAT: failure for " Patchwork
2016-10-26 16:29 ` [PATCH v2] " Imre Deak
2016-10-26 19:59 ` Sean Paul
2016-10-26 17:16 ` ✓ Fi.CI.BAT: success for drm: Print some debug/error info during DP dual mode detect (rev2) 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=1477495658.9337.1.camel@intel.com \
--to=imre.deak@intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=ville.syrjala@linux.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 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.