From patchwork Tue Sep 22 17:09:39 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Clint Taylor X-Patchwork-Id: 7241561 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.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 75EAFBEEC1 for ; Tue, 22 Sep 2015 17:12:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 98F9020907 for ; Tue, 22 Sep 2015 17:12:36 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 7C65E208FB for ; Tue, 22 Sep 2015 17:12:35 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 069CD899DC; Tue, 22 Sep 2015 10:12:35 -0700 (PDT) X-Original-To: Intel-gfx@lists.freedesktop.org Delivered-To: Intel-gfx@lists.freedesktop.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by gabe.freedesktop.org (Postfix) with ESMTP id D3BD4899DC for ; Tue, 22 Sep 2015 10:12:33 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga103.jf.intel.com with ESMTP; 22 Sep 2015 10:12:29 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.17,574,1437462000"; d="scan'208";a="650161784" Received: from cataylo2-ubuntu64-12.jf.intel.com ([134.134.150.145]) by orsmga003.jf.intel.com with ESMTP; 22 Sep 2015 10:12:29 -0700 From: clinton.a.taylor@intel.com To: Intel-gfx@lists.freedesktop.org Date: Tue, 22 Sep 2015 10:09:39 -0700 Message-Id: <1442941779-13633-1-git-send-email-clinton.a.taylor@intel.com> X-Mailer: git-send-email 1.7.9.5 Subject: [Intel-gfx] [PATCH] drm/i915: eDP HPD connected check to reduce T3 time 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: , MIME-Version: 1.0 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, 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: Clint Taylor To reduce eDP T3 time check for digital port connected instead of msleep. Maintain VBT time if HPD is not asserted on the port. Current eDP T3 time is an msleep for the panel_power_up time specified in VBT. The eDP specification allows maximum T3 time of 200ms. Typically panels raise HPD from 70ms-105ms and are ready for AUX traffic and training. Reading HPD will reduce power-on and resume times by over 100ms on systems with eDP HPD connected. Signed-off-by: Clint Taylor --- drivers/gpu/drm/i915/intel_dp.c | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 77e4115..7caf3ab 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -129,6 +129,8 @@ static void edp_panel_vdd_off(struct intel_dp *intel_dp, bool sync); static void vlv_init_panel_power_sequencer(struct intel_dp *intel_dp); static void vlv_steal_power_sequencer(struct drm_device *dev, enum pipe pipe); +static bool intel_digital_port_connected(struct drm_i915_private *dev_priv, + struct intel_digital_port *port); static unsigned int intel_dp_unused_lane_mask(int lane_count) { @@ -1772,6 +1774,7 @@ static bool edp_panel_vdd_on(struct intel_dp *intel_dp) u32 pp; u32 pp_stat_reg, pp_ctrl_reg; bool need_to_disable = !intel_dp->want_panel_vdd; + int i, step = 0; lockdep_assert_held(&dev_priv->pps_mutex); @@ -1809,7 +1812,15 @@ static bool edp_panel_vdd_on(struct intel_dp *intel_dp) if (!edp_have_panel_power(intel_dp)) { DRM_DEBUG_KMS("eDP port %c panel power wasn't enabled\n", port_name(intel_dig_port->port)); - msleep(intel_dp->panel_power_up_delay); + step = intel_dp->panel_power_up_delay / 10; + for (i=0; i < intel_dp->panel_power_up_delay; i+=step) { + if (intel_digital_port_connected(dev_priv, intel_dig_port)) { + DRM_DEBUG_KMS("Port %c HPD detected\n", + port_name(intel_dig_port->port)); + break; + } + msleep(10); + } } return need_to_disable;