From patchwork Mon Nov 24 17:16:23 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Egbert Eich X-Patchwork-Id: 5368491 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C5337C11AC for ; Mon, 24 Nov 2014 17:17:18 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id DA74C202F0 for ; Mon, 24 Nov 2014 17:17:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id EBD7E200FE for ; Mon, 24 Nov 2014 17:17:15 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9FF816E7F3; Mon, 24 Nov 2014 09:17:13 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mx2.suse.de (cantor2.suse.de [195.135.220.15]) by gabe.freedesktop.org (Postfix) with ESMTP id 339A46E7C9 for ; Mon, 24 Nov 2014 09:17:12 -0800 (PST) Received: from relay1.suse.de (charybdis-ext.suse.de [195.135.220.254]) by mx2.suse.de (Postfix) with ESMTP id 33B00ACDE; Mon, 24 Nov 2014 17:17:10 +0000 (UTC) Received: from sles12.fritz.box (sles12.fritz.box [192.168.178.37]) by debian (Postfix) with ESMTP id B79A9E1300; Mon, 24 Nov 2014 18:14:34 +0100 (CET) From: Egbert Eich To: intel-gfx@lists.freedesktop.org Date: Mon, 24 Nov 2014 18:16:23 +0100 Message-Id: <1416849387-20984-2-git-send-email-eich@suse.de> X-Mailer: git-send-email 1.8.4.5 In-Reply-To: <1416849387-20984-1-git-send-email-eich@suse.de> References: <1416849387-20984-1-git-send-email-eich@suse.de> MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 1/5] drm/i915: Try to avoid pps_{lock, unlock}() on DP ports 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 From: Ville Syrjälä Signed-off-by: Ville Syrjälä --- drivers/gpu/drm/i915/intel_dp.c | 48 ++++++++++++++++++++++++----------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 81f959d..a24c8cc7 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -807,17 +807,19 @@ intel_dp_aux_ch(struct intel_dp *intel_dp, uint32_t status; int try, clock = 0; bool has_aux_irq = HAS_AUX_IRQ(dev); - bool vdd; + bool vdd = false; - pps_lock(intel_dp); + if (is_edp(intel_dp)) { + pps_lock(intel_dp); - /* - * We will be called with VDD already enabled for dpcd/edid/oui reads. - * In such cases we want to leave VDD enabled and it's up to upper layers - * to turn it off. But for eg. i2c-dev access we need to turn it on/off - * ourselves. - */ - vdd = edp_panel_vdd_on(intel_dp); + /* + * We will be called with VDD already enabled for dpcd/edid/oui reads. + * In such cases we want to leave VDD enabled and it's up to upper layers + * to turn it off. But for eg. i2c-dev access we need to turn it on/off + * ourselves. + */ + vdd = edp_panel_vdd_on(intel_dp); + } /* dp aux is extremely sensitive to irq latency, hence request the * lowest possible wakeup latency and so prevent the cpu from going into @@ -924,10 +926,12 @@ out: pm_qos_update_request(&dev_priv->pm_qos, PM_QOS_DEFAULT_VALUE); intel_aux_display_runtime_put(dev_priv); - if (vdd) - edp_panel_vdd_off(intel_dp, false); + if (is_edp(intel_dp)) { + if (vdd) + edp_panel_vdd_off(intel_dp, false); - pps_unlock(intel_dp); + pps_unlock(intel_dp); + } return ret; } @@ -2291,18 +2295,22 @@ static void intel_enable_dp(struct intel_encoder *encoder) if (WARN_ON(dp_reg & DP_PORT_EN)) return; - pps_lock(intel_dp); + if (is_edp(intel_dp)) { + pps_lock(intel_dp); - if (IS_VALLEYVIEW(dev)) - vlv_init_panel_power_sequencer(intel_dp); + if (IS_VALLEYVIEW(dev)) + vlv_init_panel_power_sequencer(intel_dp); - intel_dp_enable_port(intel_dp); + intel_dp_enable_port(intel_dp); - edp_panel_vdd_on(intel_dp); - edp_panel_on(intel_dp); - edp_panel_vdd_off(intel_dp, true); + edp_panel_vdd_on(intel_dp); + edp_panel_on(intel_dp); + edp_panel_vdd_off(intel_dp, true); - pps_unlock(intel_dp); + pps_unlock(intel_dp); + } else { + intel_dp_enable_port(intel_dp); + } if (IS_VALLEYVIEW(dev)) vlv_wait_port_ready(dev_priv, dp_to_dig_port(intel_dp));