From: Jani Nikula <jani.nikula@linux.intel.com>
To: Ville Syrjala <ville.syrjala@linux.intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v2 3/9] drm/i915: Extract intel_disable_ddi_buf()
Date: Wed, 11 Oct 2017 22:53:14 +0300 [thread overview]
Message-ID: <87mv4xo40l.fsf@intel.com> (raw)
In-Reply-To: <20171010121207.570-4-ville.syrjala@linux.intel.com>
On Tue, 10 Oct 2017, Ville Syrjala <ville.syrjala@linux.intel.com> wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> Extract the code to disable the DDI_BUF_CTL into small helper. This
> will allows us to detangle the encoder type mess in
> intel_ddi_post_disable().
>
> v2: Keep using intel_ddi_get_encoder_port() for now
>
> Reviewed-by: Jani Nikula <jani.nikula@intel.com> #v1
Holds for v2
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_ddi.c | 41 +++++++++++++++++++++++-----------------
> 1 file changed, 24 insertions(+), 17 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 1cc61ba48e3a..e4d1d934231b 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -2257,17 +2257,37 @@ static void intel_ddi_pre_enable(struct intel_encoder *encoder,
> }
> }
>
> +static void intel_disable_ddi_buf(struct intel_encoder *encoder)
> +{
> + struct drm_i915_private *dev_priv = to_i915(encoder->base.dev);
> + enum port port = intel_ddi_get_encoder_port(encoder);
> + bool wait = false;
> + u32 val;
> +
> + val = I915_READ(DDI_BUF_CTL(port));
> + if (val & DDI_BUF_CTL_ENABLE) {
> + val &= ~DDI_BUF_CTL_ENABLE;
> + I915_WRITE(DDI_BUF_CTL(port), val);
> + wait = true;
> + }
> +
> + val = I915_READ(DP_TP_CTL(port));
> + val &= ~(DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_MASK);
> + val |= DP_TP_CTL_LINK_TRAIN_PAT1;
> + I915_WRITE(DP_TP_CTL(port), val);
> +
> + if (wait)
> + intel_wait_ddi_buf_idle(dev_priv, port);
> +}
> +
> static void intel_ddi_post_disable(struct intel_encoder *intel_encoder,
> const struct intel_crtc_state *old_crtc_state,
> const struct drm_connector_state *old_conn_state)
> {
> struct drm_encoder *encoder = &intel_encoder->base;
> struct drm_i915_private *dev_priv = to_i915(encoder->dev);
> - enum port port = intel_ddi_get_encoder_port(intel_encoder);
> struct intel_digital_port *dig_port = enc_to_dig_port(encoder);
> int type = intel_encoder->type;
> - uint32_t val;
> - bool wait = false;
>
> if (type == INTEL_OUTPUT_DP || type == INTEL_OUTPUT_EDP) {
> /*
> @@ -2286,20 +2306,7 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder,
> intel_dp_sink_dpms(intel_dp, DRM_MODE_DPMS_OFF);
> }
>
> - val = I915_READ(DDI_BUF_CTL(port));
> - if (val & DDI_BUF_CTL_ENABLE) {
> - val &= ~DDI_BUF_CTL_ENABLE;
> - I915_WRITE(DDI_BUF_CTL(port), val);
> - wait = true;
> - }
> -
> - val = I915_READ(DP_TP_CTL(port));
> - val &= ~(DP_TP_CTL_ENABLE | DP_TP_CTL_LINK_TRAIN_MASK);
> - val |= DP_TP_CTL_LINK_TRAIN_PAT1;
> - I915_WRITE(DP_TP_CTL(port), val);
> -
> - if (wait)
> - intel_wait_ddi_buf_idle(dev_priv, port);
> + intel_disable_ddi_buf(intel_encoder);
>
> if (type == INTEL_OUTPUT_HDMI) {
> dig_port->set_infoframes(encoder, false,
--
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-10-11 19:53 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-10-10 12:11 [PATCH v2 0/9] drm/i915: Cleaner DDI DP vs. HDMI split Ville Syrjala
2017-10-10 12:11 ` [PATCH v2 1/9] drm/i915: Dump 'output_types' in crtc state dump Ville Syrjala
2017-10-11 19:50 ` Jani Nikula
2017-10-10 12:12 ` [PATCH v2 2/9] drm/i915: Extract intel_ddi_clk_disable() Ville Syrjala
2017-10-11 19:52 ` Jani Nikula
2017-10-10 12:12 ` [PATCH v2 3/9] drm/i915: Extract intel_disable_ddi_buf() Ville Syrjala
2017-10-11 19:53 ` Jani Nikula [this message]
2017-10-10 12:12 ` [PATCH 4/9] drm/i915: Inline the required bits of intel_ddi_post_disable() into intel_ddi_fdi_post_disable() Ville Syrjala
2017-10-10 12:12 ` [PATCH v2 5/9] drm/i915: Split intel_ddi_post_disable() into DP vs. HDMI variants Ville Syrjala
2017-10-10 12:12 ` [PATCH 6/9] drm/i915: Remove useless eDP check from intel_ddi_pre_enable_dp() Ville Syrjala
2017-10-10 12:12 ` [PATCH 7/9] drm/i915: Split intel_disable_ddi() into DP vs. HDMI variants Ville Syrjala
2017-10-11 20:03 ` Jani Nikula
2017-10-12 9:49 ` Ville Syrjälä
2017-10-13 14:13 ` Jani Nikula
2017-10-10 12:12 ` [PATCH v2 8/9] drm/i915: Plumb crtc_state etc. directly to intel_ddi_pre_enable_{dp, hdmi}() Ville Syrjala
2017-10-13 14:25 ` Jani Nikula
2017-10-10 12:12 ` [PATCH v2 9/9] drm/i915: Split intel_enable_ddi() into DP and HDMI variants Ville Syrjala
2017-10-11 20:06 ` Jani Nikula
2017-10-13 14:20 ` Jani Nikula
2017-10-13 18:10 ` Ville Syrjälä
2017-10-10 13:07 ` ✗ Fi.CI.BAT: warning for drm/i915: Cleaner DDI DP vs. HDMI split Patchwork
2017-10-10 13:21 ` Ville Syrjälä
2017-10-13 17:03 ` ✓ Fi.CI.BAT: success " Patchwork
2017-10-13 18:16 ` Ville Syrjälä
2017-10-13 18:49 ` Jani Nikula
2017-10-14 0:10 ` ✗ Fi.CI.IGT: failure " 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=87mv4xo40l.fsf@intel.com \
--to=jani.nikula@linux.intel.com \
--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 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).