From patchwork Mon Feb 3 15:13:43 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Ville Syrjala X-Patchwork-Id: 11362973 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id C88E9138D for ; Mon, 3 Feb 2020 15:15:09 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id AF40B21741 for ; Mon, 3 Feb 2020 15:15:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org AF40B21741 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B6ED16EC55; Mon, 3 Feb 2020 15:15:07 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga07.intel.com (mga07.intel.com [134.134.136.100]) by gabe.freedesktop.org (Postfix) with ESMTPS id A8BC16EC59; Mon, 3 Feb 2020 15:15:06 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 03 Feb 2020 07:15:05 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.70,398,1574150400"; d="scan'208";a="337543565" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.174]) by fmsmga001.fm.intel.com with SMTP; 03 Feb 2020 07:15:03 -0800 Received: by stinkbox (sSMTP sendmail emulation); Mon, 03 Feb 2020 17:15:02 +0200 From: Ville Syrjala To: dri-devel@lists.freedesktop.org Subject: [PATCH 26/26] drm/i915: Try to frob the TMDS buffer enable knob on DP++ dongles on DP DFPs Date: Mon, 3 Feb 2020 17:13:43 +0200 Message-Id: <20200203151343.14378-27-ville.syrjala@linux.intel.com> X-Mailer: git-send-email 2.24.1 In-Reply-To: <20200203151343.14378-1-ville.syrjala@linux.intel.com> References: <20200203151343.14378-1-ville.syrjala@linux.intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" From: Ville Syrjälä To save a bit of power let's try to power down the TMDS buffers on DP++ dongles hooked to downstream facing DP++ ports. Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/display/intel_ddi.c | 6 ++++++ drivers/gpu/drm/i915/display/intel_dp.c | 25 ++++++++++++++++++++++++ 2 files changed, 31 insertions(+) diff --git a/drivers/gpu/drm/i915/display/intel_ddi.c b/drivers/gpu/drm/i915/display/intel_ddi.c index 92c280905f31..5daa52909980 100644 --- a/drivers/gpu/drm/i915/display/intel_ddi.c +++ b/drivers/gpu/drm/i915/display/intel_ddi.c @@ -3512,6 +3512,9 @@ static void hsw_ddi_pre_enable_dp(struct intel_encoder *encoder, else WARN_ON(is_mst && port == PORT_A); + intel_dp_dual_mode_set_tmds_output(encoder, + &intel_dp->dp_dual_mode, true); + intel_dp_set_link_params(intel_dp, crtc_state->port_clock, crtc_state->lane_count, is_mst); @@ -3757,6 +3760,9 @@ static void intel_ddi_post_disable_dp(struct intel_encoder *encoder, dig_port->ddi_io_power_domain); intel_ddi_clk_disable(encoder); + + intel_dp_dual_mode_set_tmds_output(encoder, + &intel_dp->dp_dual_mode, false); } static void intel_ddi_post_disable_hdmi(struct intel_encoder *encoder, diff --git a/drivers/gpu/drm/i915/display/intel_dp.c b/drivers/gpu/drm/i915/display/intel_dp.c index 5143c1b0fd92..0452cc9423e6 100644 --- a/drivers/gpu/drm/i915/display/intel_dp.c +++ b/drivers/gpu/drm/i915/display/intel_dp.c @@ -3510,19 +3510,28 @@ static void g4x_post_disable_dp(struct intel_encoder *encoder, /* Only ilk+ has port A */ if (port == PORT_A) ilk_edp_pll_off(intel_dp, old_crtc_state); + + intel_dp_dual_mode_set_tmds_output(encoder, + &intel_dp->dp_dual_mode, false); } static void vlv_post_disable_dp(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { + struct intel_dp *intel_dp = enc_to_intel_dp(encoder); + intel_dp_link_down(encoder, old_crtc_state); + + intel_dp_dual_mode_set_tmds_output(encoder, + &intel_dp->dp_dual_mode, false); } static void chv_post_disable_dp(struct intel_encoder *encoder, const struct intel_crtc_state *old_crtc_state, const struct drm_connector_state *old_conn_state) { + struct intel_dp *intel_dp = enc_to_intel_dp(encoder); struct drm_i915_private *dev_priv = to_i915(encoder->base.dev); intel_dp_link_down(encoder, old_crtc_state); @@ -3533,6 +3542,9 @@ static void chv_post_disable_dp(struct intel_encoder *encoder, chv_data_lane_soft_reset(encoder, old_crtc_state, true); vlv_dpio_put(dev_priv); + + intel_dp_dual_mode_set_tmds_output(encoder, + &intel_dp->dp_dual_mode, false); } static void @@ -3748,6 +3760,9 @@ static void g4x_pre_enable_dp(struct intel_encoder *encoder, struct intel_dp *intel_dp = enc_to_intel_dp(encoder); enum port port = encoder->port; + intel_dp_dual_mode_set_tmds_output(encoder, + &intel_dp->dp_dual_mode, true); + intel_dp_prepare(encoder, pipe_config); /* Only ilk+ has port A */ @@ -3865,6 +3880,11 @@ static void vlv_pre_enable_dp(struct intel_encoder *encoder, const struct intel_crtc_state *pipe_config, const struct drm_connector_state *conn_state) { + struct intel_dp *intel_dp = enc_to_intel_dp(encoder); + + intel_dp_dual_mode_set_tmds_output(encoder, + &intel_dp->dp_dual_mode, true); + vlv_phy_pre_encoder_enable(encoder, pipe_config); intel_enable_dp(encoder, pipe_config, conn_state); @@ -3883,6 +3903,11 @@ static void chv_pre_enable_dp(struct intel_encoder *encoder, const struct intel_crtc_state *pipe_config, const struct drm_connector_state *conn_state) { + struct intel_dp *intel_dp = enc_to_intel_dp(encoder); + + intel_dp_dual_mode_set_tmds_output(encoder, + &intel_dp->dp_dual_mode, true); + chv_phy_pre_encoder_enable(encoder, pipe_config); intel_enable_dp(encoder, pipe_config, conn_state);