From patchwork Fri Dec 11 06:17:30 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: sonika.jindal@intel.com X-Patchwork-Id: 7826421 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 BE44EBEEE1 for ; Fri, 11 Dec 2015 06:17:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CDF0620503 for ; Fri, 11 Dec 2015 06:17:50 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id CE30A20460 for ; Fri, 11 Dec 2015 06:17:49 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E2B916E34A; Thu, 10 Dec 2015 22:17:48 -0800 (PST) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by gabe.freedesktop.org (Postfix) with ESMTP id 2FF716E34A for ; Thu, 10 Dec 2015 22:17:48 -0800 (PST) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga101.jf.intel.com with ESMTP; 10 Dec 2015 22:17:48 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.20,412,1444719600"; d="scan'208";a="705288867" Received: from fmsmsx105.amr.corp.intel.com ([10.18.124.203]) by orsmga003.jf.intel.com with ESMTP; 10 Dec 2015 22:17:34 -0800 Received: from fmsmsx117.amr.corp.intel.com (10.18.116.17) by FMSMSX105.amr.corp.intel.com (10.18.124.203) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 10 Dec 2015 22:17:34 -0800 Received: from bgsmsx153.gar.corp.intel.com (10.224.23.4) by fmsmsx117.amr.corp.intel.com (10.18.116.17) with Microsoft SMTP Server (TLS) id 14.3.248.2; Thu, 10 Dec 2015 22:17:33 -0800 Received: from bgsmsx104.gar.corp.intel.com ([169.254.5.21]) by BGSMSX153.gar.corp.intel.com ([169.254.2.243]) with mapi id 14.03.0248.002; Fri, 11 Dec 2015 11:47:31 +0530 From: "Jindal, Sonika" To: "Wang, Gary C" , "intel-gfx@lists.freedesktop.org" Thread-Topic: [Intel-gfx] [PATCH] drm/i915: Correct max delay for HDMI hotplug live status checking Thread-Index: AQHRM7gWulllhLzdjUCgEWA6fZSjPp7FOlHggAAP7iCAAAPVgA== Date: Fri, 11 Dec 2015 06:17:30 +0000 Message-ID: <000C66961D35964B9714611E548C10AD0C339510@BGSMSX104.gar.corp.intel.com> References: <1449799710-21189-1-git-send-email-gary.c.wang@intel.com> <000C66961D35964B9714611E548C10AD0C3393D7@BGSMSX104.gar.corp.intel.com> <9D94B3A055E7584690C06E97E27A67B90B2DA655@PGSMSX101.gar.corp.intel.com> In-Reply-To: <9D94B3A055E7584690C06E97E27A67B90B2DA655@PGSMSX101.gar.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [10.223.10.10] MIME-Version: 1.0 Subject: Re: [Intel-gfx] [PATCH] drm/i915: Correct max delay for HDMI hotplug live status checking 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 Sure. Can you please also post your findings about different panels taking different time to settle the live status so that we know that this increase in retrials is helping you with multiple monitors? Regards, Sonika -----Original Message----- From: Wang, Gary C Sent: Friday, December 11, 2015 11:34 AM To: Jindal, Sonika ; intel-gfx@lists.freedesktop.org Subject: RE: [Intel-gfx] [PATCH] drm/i915: Correct max delay for HDMI hotplug live status checking Hi Sonika, Thanks for your comment, and it's more readability on code. But it only delay 2 integration of each 10ms among checking hot-plug with 3 times. Could I change it to following snippet code to read hotplug_status 4 times at most for 3 integration 10ms delay? unsigned int retry = 3; do { live_status = intel_digital_port_connected(dev_priv, hdmi_to_dig_port(intel_hdmi)); if (live_status || !retry) break; mdelay(10); } while (retry--); Thanks! Gary -----Original Message----- From: Jindal, Sonika Sent: Friday, December 11, 2015 1:05 PM To: Wang, Gary C ; intel-gfx@lists.freedesktop.org Subject: RE: [Intel-gfx] [PATCH] drm/i915: Correct max delay for HDMI hotplug live status checking How about following instead of two levels of check in the while loop: unsigned int retry = 3; do { live_status = intel_digital_port_connected(dev_priv, hdmi_to_dig_port(intel_hdmi)); if (live_status) break; mdelay(10); } while (--retry); Regards, Sonika -----Original Message----- From: Intel-gfx [mailto:intel-gfx-bounces@lists.freedesktop.org] On Behalf Of Wang, Gary C Sent: Friday, December 11, 2015 7:39 AM To: intel-gfx@lists.freedesktop.org Subject: [Intel-gfx] [PATCH] drm/i915: Correct max delay for HDMI hotplug live status checking The total delay of HDMI hotplug detecting with 30ms should have been split into a resolution of 3 retries of 10ms each, for the worst cases. But it still suffered from only waiting 10ms at most in intel_hdmi_detect(). This patch corrects it by reading hotplug status with 4 times at most for 30ms delay. Reviewed-by: Cooper Chiou Cc: Gavin Hindman Signed-off-by: Gary Wang --- drivers/gpu/drm/i915/intel_hdmi.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) mode change 100644 => 100755 drivers/gpu/drm/i915/intel_hdmi.c -- 1.9.1 _______________________________________________ Intel-gfx mailing list Intel-gfx@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/intel-gfx diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c old mode 100644 new mode 100755 index be7fab9..888401b --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c @@ -1387,16 +1387,19 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); struct drm_i915_private *dev_priv = to_i915(connector->dev); bool live_status = false; - unsigned int retry = 3; + // read hotplug status 4 times at most for 30ms delay (3 retries of 10ms each) + unsigned int retry = 4; DRM_DEBUG_KMS("[CONNECTOR:%d:%s]\n", connector->base.id, connector->name); intel_display_power_get(dev_priv, POWER_DOMAIN_GMBUS); - while (!live_status && --retry) { + while (!live_status && retry--) { live_status = intel_digital_port_connected(dev_priv, hdmi_to_dig_port(intel_hdmi)); + if (live_status || !retry) + break; mdelay(10); }