From: "Sharma, Shashank" <shashank.sharma@intel.com>
To: ville.syrjala@linux.intel.com, dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, stable@vger.kernel.org,
Tore Anderson <tore@fud.no>,
Paulo Zanoni <paulo.r.zanoni@intel.com>,
Daniel Vetter <daniel.vetter@ffwll.ch>
Subject: Re: [PATCH v3 3/4] drm/i915: Enable/disable TMDS output buffers in DP++ adaptor as needed
Date: Wed, 04 May 2016 15:43:30 +0530 [thread overview]
Message-ID: <5729CB4A.90607@intel.com> (raw)
In-Reply-To: <1462216105-20881-4-git-send-email-ville.syrjala@linux.intel.com>
On 5/3/2016 12:38 AM, ville.syrjala@linux.intel.com wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
>
> To save a bit of power, let's try to turn off the TMDS output buffers
> in DP++ adaptors when we're not driving the port.
>
> v2: Let's not forget DDI, toss in a debug message while at it
> v3: Just do the TMDS output control based on adaptor type. With the
> helper getting passed the type, we wouldn't actually have to
> check at all in the driver, but the check eliminates the debug
> output more honest
>
> Cc: stable@vger.kernel.org
> Cc: Tore Anderson <tore@fud.no>
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Cc: Shashank Sharma <shashank.sharma@intel.com>
> Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
> drivers/gpu/drm/i915/intel_ddi.c | 12 ++++++++++++
> drivers/gpu/drm/i915/intel_drv.h | 1 +
> drivers/gpu/drm/i915/intel_hdmi.c | 20 ++++++++++++++++++++
> 3 files changed, 33 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_ddi.c b/drivers/gpu/drm/i915/intel_ddi.c
> index 422ec81ef59b..a3600704e6d4 100644
> --- a/drivers/gpu/drm/i915/intel_ddi.c
> +++ b/drivers/gpu/drm/i915/intel_ddi.c
> @@ -1601,6 +1601,12 @@ static void intel_ddi_pre_enable(struct intel_encoder *intel_encoder)
> enum port port = intel_ddi_get_encoder_port(intel_encoder);
> int type = intel_encoder->type;
>
> + if (type == INTEL_OUTPUT_HDMI) {
how to handle type2 active adapters here, which can show type = DP ?
> + struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
> +
> + intel_dp_dual_mode_set_tmds_output(intel_hdmi, true);
> + }
> +
> intel_prepare_ddi_buffer(intel_encoder);
>
> if (type == INTEL_OUTPUT_EDP) {
> @@ -1667,6 +1673,12 @@ static void intel_ddi_post_disable(struct intel_encoder *intel_encoder)
> DPLL_CTRL2_DDI_CLK_OFF(port)));
> else if (INTEL_INFO(dev)->gen < 9)
> I915_WRITE(PORT_CLK_SEL(port), PORT_CLK_SEL_NONE);
> +
> + if (type == INTEL_OUTPUT_HDMI) {
Same as above.
Regards
Shashank
> + struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder);
> +
> + intel_dp_dual_mode_set_tmds_output(intel_hdmi, false);
> + }
> }
>
> static void intel_enable_ddi(struct intel_encoder *intel_encoder)
> diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h
> index e94d18fb2ff1..dbcb80c70e2e 100644
> --- a/drivers/gpu/drm/i915/intel_drv.h
> +++ b/drivers/gpu/drm/i915/intel_drv.h
> @@ -1419,6 +1419,7 @@ void intel_hdmi_init_connector(struct intel_digital_port *intel_dig_port,
> 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);
> +void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable);
>
>
> /* intel_lvds.c */
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 31ca11134294..c4d93e6b4bed 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -836,6 +836,22 @@ static void hsw_set_infoframes(struct drm_encoder *encoder,
> intel_hdmi_set_hdmi_infoframe(encoder, adjusted_mode);
> }
>
> +void intel_dp_dual_mode_set_tmds_output(struct intel_hdmi *hdmi, bool enable)
> +{
> + struct drm_i915_private *dev_priv = to_i915(intel_hdmi_to_dev(hdmi));
> + struct i2c_adapter *adapter =
> + intel_gmbus_get_adapter(dev_priv, hdmi->ddc_bus);
> +
> + if (hdmi->dp_dual_mode.type < DRM_DP_DUAL_MODE_TYPE2_DVI)
> + return;
> +
> + DRM_DEBUG_KMS("%s DP dual mode adaptor TMDS output\n",
> + enable ? "Enabling" : "Disabling");
> +
> + drm_dp_dual_mode_set_tmds_output(hdmi->dp_dual_mode.type,
> + adapter, enable);
> +}
> +
> static void intel_hdmi_prepare(struct intel_encoder *encoder)
> {
> struct drm_device *dev = encoder->base.dev;
> @@ -845,6 +861,8 @@ static void intel_hdmi_prepare(struct intel_encoder *encoder)
> const struct drm_display_mode *adjusted_mode = &crtc->config->base.adjusted_mode;
> u32 hdmi_val;
>
> + intel_dp_dual_mode_set_tmds_output(intel_hdmi, true);
> +
> hdmi_val = SDVO_ENCODING_HDMI;
> if (!HAS_PCH_SPLIT(dev) && crtc->config->limited_color_range)
> hdmi_val |= HDMI_COLOR_RANGE_16_235;
> @@ -1142,6 +1160,8 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)
> }
>
> intel_hdmi->set_infoframes(&encoder->base, false, NULL);
> +
> + intel_dp_dual_mode_set_tmds_output(intel_hdmi, false);
> }
>
> static void g4x_disable_hdmi(struct intel_encoder *encoder)
>
next prev parent reply other threads:[~2016-05-04 10:13 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-05-02 19:08 [PATCH v2 0/4] drm: DP++ adaptor support (v2) ville.syrjala
2016-05-02 19:08 ` [PATCH v2 1/4] drm: Add helper for DP++ adaptors ville.syrjala
2016-05-03 7:46 ` [Intel-gfx] " Jani Nikula
2016-05-03 13:38 ` Ville Syrjälä
2016-05-03 14:55 ` [PATCH v3 " ville.syrjala
2016-05-03 17:56 ` [PATCH v4 " ville.syrjala
2016-05-04 6:26 ` Sharma, Shashank
2016-05-06 12:37 ` Zanoni, Paulo R
2016-05-06 13:10 ` Ville Syrjälä
2016-05-06 13:46 ` [PATCH v5 " ville.syrjala
2016-05-03 16:33 ` [PATCH v2 " Sharma, Shashank
2016-05-03 17:38 ` Ville Syrjälä
2016-05-02 19:08 ` [PATCH v2 2/4] drm/i915: Respect DP++ adaptor TMDS clock limit ville.syrjala
2016-05-04 10:08 ` Sharma, Shashank
2016-05-02 19:08 ` [PATCH v3 3/4] drm/i915: Enable/disable TMDS output buffers in DP++ adaptor as needed ville.syrjala
2016-05-04 10:13 ` Sharma, Shashank [this message]
2016-05-04 11:49 ` Ville Syrjälä
2016-05-04 13:48 ` Sharma, Shashank
2016-05-02 19:08 ` [PATCH v2 4/4] drm/i915: Determine DP++ type 1 DVI adaptor presence based on VBT ville.syrjala
2016-05-04 10:24 ` Sharma, Shashank
2016-05-04 11:29 ` Ville Syrjälä
2016-05-04 11:45 ` [PATCH v3 " ville.syrjala
2016-05-04 13:50 ` Sharma, Shashank
2016-05-09 12:12 ` [PATCH v2 0/4] drm: DP++ adaptor support (v2) 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=5729CB4A.90607@intel.com \
--to=shashank.sharma@intel.com \
--cc=daniel.vetter@ffwll.ch \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=paulo.r.zanoni@intel.com \
--cc=stable@vger.kernel.org \
--cc=tore@fud.no \
--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