From patchwork Fri Nov 27 12:10:23 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Patrik Jakobsson X-Patchwork-Id: 7713061 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id DE2619F2E9 for ; Fri, 27 Nov 2015 12:10:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F03492063B for ; Fri, 27 Nov 2015 12:10:26 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 0C38A2062E for ; Fri, 27 Nov 2015 12:10:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 896796E7F2; Fri, 27 Nov 2015 04:10:25 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by gabe.freedesktop.org (Postfix) with ESMTP id 9FB0E6E7F2 for ; Fri, 27 Nov 2015 04:10:24 -0800 (PST) Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga102.fm.intel.com with ESMTP; 27 Nov 2015 04:10:24 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,351,1444719600"; d="scan'208";a="3076934" Received: from patrik-desktop.isw.intel.com ([10.237.180.166]) by fmsmga004.fm.intel.com with ESMTP; 27 Nov 2015 04:10:25 -0800 From: Patrik Jakobsson To: intel-gfx@lists.freedesktop.org Date: Fri, 27 Nov 2015 13:10:23 +0100 Message-Id: <1448626223-8777-1-git-send-email-patrik.jakobsson@linux.intel.com> X-Mailer: git-send-email 2.5.0 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH] drm/i915/skl: Use alternate aux power domain for port E X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP There is no dedicated aux channel for port E on SKL. Instead the VBT describes which of the other aux channels to use. When grabbing an aux power domain for port E we need to take this into account. Cc: Ville Syrjälä Signed-off-by: Patrik Jakobsson --- drivers/gpu/drm/i915/intel_display.c | 19 +++++++++++++++---- drivers/gpu/drm/i915/intel_dp.c | 2 +- drivers/gpu/drm/i915/intel_drv.h | 1 + 3 files changed, 17 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 0743337..86c89d4 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -5212,8 +5212,11 @@ static enum intel_display_power_domain port_to_power_domain(enum port port) } } -static enum intel_display_power_domain port_to_aux_power_domain(enum port port) +static enum intel_display_power_domain port_to_aux_power_domain( + struct drm_i915_private *dev_priv, enum port port) { + enum port alternate_port; + switch (port) { case PORT_A: return POWER_DOMAIN_AUX_A; @@ -5224,7 +5227,14 @@ static enum intel_display_power_domain port_to_aux_power_domain(enum port port) case PORT_D: return POWER_DOMAIN_AUX_D; case PORT_E: - /* FIXME: Check VBT for actual wiring of PORT E */ + if (IS_SKYLAKE(dev_priv)) { + alternate_port = skl_porte_aux_port(dev_priv); + if (alternate_port != PORT_E) + return port_to_aux_power_domain(dev_priv, + alternate_port); + WARN_ON_ONCE(alternate_port == PORT_E); + } + return POWER_DOMAIN_AUX_D; default: MISSING_CASE(port); @@ -5263,6 +5273,7 @@ enum intel_display_power_domain intel_display_port_aux_power_domain(struct intel_encoder *intel_encoder) { struct drm_device *dev = intel_encoder->base.dev; + struct drm_i915_private *dev_priv = dev->dev_private; struct intel_digital_port *intel_dig_port; switch (intel_encoder->type) { @@ -5279,10 +5290,10 @@ intel_display_port_aux_power_domain(struct intel_encoder *intel_encoder) case INTEL_OUTPUT_DISPLAYPORT: case INTEL_OUTPUT_EDP: intel_dig_port = enc_to_dig_port(&intel_encoder->base); - return port_to_aux_power_domain(intel_dig_port->port); + return port_to_aux_power_domain(dev_priv, intel_dig_port->port); case INTEL_OUTPUT_DP_MST: intel_dig_port = enc_to_mst(&intel_encoder->base)->primary; - return port_to_aux_power_domain(intel_dig_port->port); + return port_to_aux_power_domain(dev_priv, intel_dig_port->port); default: MISSING_CASE(intel_encoder->type); return POWER_DOMAIN_AUX_A; diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index f2bfca0..81eb558 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -1070,7 +1070,7 @@ static i915_reg_t ilk_aux_data_reg(struct drm_i915_private *dev_priv, * On SKL we don't have Aux for port E so we rely * on VBT to set a proper alternate aux channel. */ -static enum port skl_porte_aux_port(struct drm_i915_private *dev_priv) +enum port skl_porte_aux_port(struct drm_i915_private *dev_priv) { const struct ddi_vbt_port_info *info = &dev_priv->vbt.ddi_port_info[PORT_E]; diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 8fae824..1ef2c0e 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -1248,6 +1248,7 @@ void intel_dp_hot_plug(struct intel_encoder *intel_encoder); void vlv_power_sequencer_reset(struct drm_i915_private *dev_priv); uint32_t intel_dp_pack_aux(const uint8_t *src, int src_bytes); void intel_plane_destroy(struct drm_plane *plane); +enum port skl_porte_aux_port(struct drm_i915_private *dev_priv); void intel_edp_drrs_enable(struct intel_dp *intel_dp); void intel_edp_drrs_disable(struct intel_dp *intel_dp); void intel_edp_drrs_invalidate(struct drm_device *dev,