From patchwork Tue Sep 25 01:16:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Souza, Jose" X-Patchwork-Id: 10613221 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 508791390 for ; Tue, 25 Sep 2018 01:22:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5689829C28 for ; Tue, 25 Sep 2018 01:22:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 550542A065; Tue, 25 Sep 2018 01:22:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 0F6D42A082 for ; Tue, 25 Sep 2018 01:22:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 03E006E0BE; Tue, 25 Sep 2018 01:22:45 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mga18.intel.com (mga18.intel.com [134.134.136.126]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6FECD6E038; Tue, 25 Sep 2018 01:22:43 +0000 (UTC) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by orsmga106.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Sep 2018 18:22:42 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,300,1534834800"; d="scan'208";a="72586270" Received: from josouza-mobl.jf.intel.com ([10.24.10.190]) by fmsmga007.fm.intel.com with ESMTP; 24 Sep 2018 18:17:06 -0700 From: =?utf-8?q?Jos=C3=A9_Roberto_de_Souza?= To: intel-gfx@lists.freedesktop.org Subject: [PATCH 2/2] drm/i915: Do not get aux power for disconnected DP ports Date: Mon, 24 Sep 2018 18:16:49 -0700 Message-Id: <20180925011649.15505-2-jose.souza@intel.com> X-Mailer: git-send-email 2.19.0 In-Reply-To: <20180925011649.15505-1-jose.souza@intel.com> References: <20180925011649.15505-1-jose.souza@intel.com> MIME-Version: 1.0 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: =?utf-8?q?Jos=C3=A9_Roberto_de_Souza?= , dri-devel@lists.freedesktop.org Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP For ICL type-c ports there is a aux power restriction, it can only be enabled while there is sink connected. BSpec: 21750 Cc: Maarten Lankhorst Signed-off-by: José Roberto de Souza --- drivers/gpu/drm/i915/intel_dp.c | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 6b4c19123f2a..48fd38cd4ba4 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -5019,19 +5019,27 @@ intel_dp_long_pulse(struct intel_connector *connector, struct intel_dp *intel_dp = intel_attached_dp(&connector->base); enum drm_connector_status status; u8 sink_irq_vector = 0; + bool got_aux_power; WARN_ON(!drm_modeset_is_locked(&dev_priv->drm.mode_config.connection_mutex)); + /* Can't disconnect eDP */ + if (!intel_dp_is_edp(intel_dp) && + !intel_digital_port_connected(&dp_to_dig_port(intel_dp)->base)) { + status = connector_status_disconnected; + got_aux_power = false; + goto port_disconnected; + } + intel_display_power_get(dev_priv, intel_dp->aux_power_domain); + got_aux_power = true; - /* Can't disconnect eDP */ if (intel_dp_is_edp(intel_dp)) status = edp_detect(intel_dp); - else if (intel_digital_port_connected(&dp_to_dig_port(intel_dp)->base)) - status = intel_dp_detect_dpcd(intel_dp); else - status = connector_status_disconnected; + status = intel_dp_detect_dpcd(intel_dp); +port_disconnected: if (status == connector_status_disconnected) { memset(&intel_dp->compliance, 0, sizeof(intel_dp->compliance)); @@ -5122,7 +5130,8 @@ intel_dp_long_pulse(struct intel_connector *connector, if (status != connector_status_connected && !intel_dp->is_mst) intel_dp_unset_edid(intel_dp); - intel_display_power_put(dev_priv, intel_dp->aux_power_domain); + if (got_aux_power) + intel_display_power_put(dev_priv, intel_dp->aux_power_domain); return status; }