From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: "Sharma, Shashank" <shashank.sharma@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3] drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails
Date: Fri, 23 Mar 2018 17:24:20 +0200 [thread overview]
Message-ID: <20180323152420.GB5453@intel.com> (raw)
In-Reply-To: <c53ff73e-6e59-c26e-a64f-4f17f1fcd7cf@intel.com>
On Thu, Mar 22, 2018 at 09:37:43PM +0530, Sharma, Shashank wrote:
>
> On 3/22/2018 9:17 PM, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> >
> > When we're disabling the HDMI link we try to reset the scrambling and
> > TMDS bit clock ratio back to the default values. This will fail if the
> > sink has already been disconnected. Thus we should not print an error
> > message when resetting the scrambling/TMDS bit clock ratio fail during
> > disable. During enable we do want the error, and during disable we may
> > still want to know what happended for debug purposes so let's use
> > DRM_DEBUG_KMS() there.
> >
> > v2: Remember them consts
> > v3: Go back to just one function and print the errors/debugs
> > from callers (Shashank)
> >
> > Cc: Shashank Sharma <shashank.sharma@intel.com>
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105644
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105655
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_ddi.c | 19 ++++++++++++-------
> > drivers/gpu/drm/i915/intel_drv.h | 2 +-
> > drivers/gpu/drm/i915/intel_hdmi.c | 40 ++++++++++++++++-----------------------
> > 3 files changed, 29 insertions(+), 32 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> > index 8c2d778560f0..c449619427da 100644
> > --- a/drivers/gpu/drm/i915/intel_ddi.c
> > +++ b/drivers/gpu/drm/i915/intel_ddi.c
> > @@ -2424,12 +2424,14 @@ static void intel_enable_ddi_hdmi(struct intel_encoder *encoder,
> > {
> > struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> > struct intel_digital_port *dig_port = enc_to_dig_port(&encoder->base);
> > + struct drm_connector *connector = conn_state->connector;
> > enum port port = encoder->port;
> >
> > - intel_hdmi_handle_sink_scrambling(encoder,
> > - conn_state->connector,
> > - crtc_state->hdmi_high_tmds_clock_ratio,
> > - crtc_state->hdmi_scrambling);
> > + if (!intel_hdmi_handle_sink_scrambling(encoder, connector,
> > + crtc_state->hdmi_high_tmds_clock_ratio,
> > + crtc_state->hdmi_scrambling))
> > + DRM_ERROR("[CONNECTOR:%d:%s] Failed to configure sink scrambling/TMDS bit clock ratio\n",
> > + connector->base.id, connector->name);
> >
> > /* Display WA #1143: skl,kbl,cfl */
> > if (IS_GEN9_BC(dev_priv)) {
> > @@ -2520,13 +2522,16 @@ static void intel_disable_ddi_hdmi(struct intel_encoder *encoder,
> > const struct intel_crtc_state *old_crtc_state,
> > const struct drm_connector_state *old_conn_state)
> > {
> > + struct drm_connector *connector = old_conn_state->connector;
> > +
> > if (old_crtc_state->has_audio)
> > intel_audio_codec_disable(encoder,
> > old_crtc_state, old_conn_state);
> >
> > - intel_hdmi_handle_sink_scrambling(encoder,
> > - old_conn_state->connector,
> > - false, false);
> > + if (!intel_hdmi_handle_sink_scrambling(encoder, connector,
> > + false, false))
> > + DRM_DEBUG_KMS("[CONNECTOR:%d:%s] Failed to reset sink scrambling/TMDS bit clock ratio\n",
> > + connector->base.id, connector->name);
> > }
> >
> > static void intel_disable_ddi(struct intel_encoder *encoder,
> > diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> > index a215aa78b0be..6e5c0f77b036 100644
> > --- a/drivers/gpu/drm/i915/intel_drv.h
> > +++ b/drivers/gpu/drm/i915/intel_drv.h
> > @@ -1783,7 +1783,7 @@ struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder);
> > bool intel_hdmi_compute_config(struct intel_encoder *encoder,
> > struct intel_crtc_state *pipe_config,
> > struct drm_connector_state *conn_state);
> > -void intel_hdmi_handle_sink_scrambling(struct intel_encoder *intel_encoder,
> > +bool intel_hdmi_handle_sink_scrambling(struct intel_encoder *encoder,
> > struct drm_connector *connector,
> > bool high_tmds_clock_ratio,
> > bool scrambling);
> > diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> > index 1baef4ac7ecb..ee929f31f7db 100644
> > --- a/drivers/gpu/drm/i915/intel_hdmi.c
> > +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> > @@ -2082,41 +2082,33 @@ intel_hdmi_add_properties(struct intel_hdmi *intel_hdmi, struct drm_connector *c
> > * it enables scrambling. This should be called before enabling the HDMI
> > * 2.0 port, as the sink can choose to disable the scrambling if it doesn't
> > * detect a scrambled clock within 100 ms.
> > + *
> > + * Returns:
> > + * True on success, false on failure.
> > */
> > -void intel_hdmi_handle_sink_scrambling(struct intel_encoder *encoder,
> > +bool intel_hdmi_handle_sink_scrambling(struct intel_encoder *encoder,
> > struct drm_connector *connector,
> > bool high_tmds_clock_ratio,
> > bool scrambling)
> > {
> > + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> > struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(&encoder->base);
> > - struct drm_i915_private *dev_priv = connector->dev->dev_private;
> > struct drm_scrambling *sink_scrambling =
> > - &connector->display_info.hdmi.scdc.scrambling;
> > - struct i2c_adapter *adptr = intel_gmbus_get_adapter(dev_priv,
> > - intel_hdmi->ddc_bus);
> > - bool ret;
> > + &connector->display_info.hdmi.scdc.scrambling;
> > + struct i2c_adapter *adapter =
> > + intel_gmbus_get_adapter(dev_priv, intel_hdmi->ddc_bus);
> >
> > if (!sink_scrambling->supported)
> > - return;
> > -
> > - DRM_DEBUG_KMS("Setting sink scrambling for enc:%s connector:%s\n",
> > - encoder->base.name, connector->name);
> > + return true;
> >
> > - /* Set TMDS bit clock ratio to 1/40 or 1/10 */
> > - ret = drm_scdc_set_high_tmds_clock_ratio(adptr, high_tmds_clock_ratio);
> > - if (!ret) {
> > - DRM_ERROR("Set TMDS ratio failed\n");
> > - return;
> > - }
> > -
> > - /* Enable/disable sink scrambling */
> > - ret = drm_scdc_set_scrambling(adptr, scrambling);
> > - if (!ret) {
> > - DRM_ERROR("Set sink scrambling failed\n");
> > - return;
> > - }
> > + DRM_DEBUG_KMS("[CONNECTOR:%d:%s] scrambling=%s, TMDS bit clock ratio=1/%d\n",
> > + connector->base.id, connector->name,
> > + yesno(scrambling), high_tmds_clock_ratio ? 40 : 10);
> >
> > - DRM_DEBUG_KMS("sink scrambling handled\n");
> > + /* Set TMDS bit clock ratio to 1/40 or 1/10, and enable/disable scrambling */
> > + return drm_scdc_set_high_tmds_clock_ratio(adapter,
> > + high_tmds_clock_ratio) &&
> > + drm_scdc_set_scrambling(adapter, scrambling);
> > }
> >
> > static u8 chv_port_to_ddc_pin(struct drm_i915_private *dev_priv, enum port port)
>
> Looks good to me.
>
> Reviewed-by: Shashank Sharma <shashank.sharma@intel.com>
Thanks. Pushed to dinq.
--
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:[~2018-03-23 15:24 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-03-22 13:22 [PATCH] drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails Ville Syrjala
2018-03-22 13:51 ` ✗ Fi.CI.BAT: failure for " Patchwork
2018-03-22 14:05 ` [PATCH v2] " Ville Syrjala
2018-03-22 14:05 ` Ville Syrjala
2018-03-22 15:12 ` Sharma, Shashank
2018-03-22 15:27 ` Ville Syrjälä
2018-03-22 15:26 ` ✓ Fi.CI.BAT: success for drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails (rev3) Patchwork
2018-03-22 15:47 ` [PATCH v3] drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails Ville Syrjala
2018-03-22 16:07 ` Sharma, Shashank
2018-03-23 15:24 ` Ville Syrjälä [this message]
2018-03-22 16:12 ` ✓ Fi.CI.IGT: success for drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails (rev3) Patchwork
2018-03-22 17:14 ` ✓ Fi.CI.BAT: success for drm/i915: Don't spew errors when resetting HDMI scrambling/bit clock ratio fails (rev4) Patchwork
2018-03-22 18:47 ` ✗ Fi.CI.IGT: warning " Patchwork
2018-03-23 14:07 ` Ville Syrjälä
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=20180323152420.GB5453@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=shashank.sharma@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).