From patchwork Wed Dec 21 01:57:40 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dhinakaran Pandiyan X-Patchwork-Id: 9482441 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0567960772 for ; Wed, 21 Dec 2016 01:58:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E11A428138 for ; Wed, 21 Dec 2016 01:58:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4333281C3; Wed, 21 Dec 2016 01:58:39 +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=-4.2 required=2.0 tests=BAYES_00, 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 7ADCA28138 for ; Wed, 21 Dec 2016 01:58:39 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 851126E02E; Wed, 21 Dec 2016 01:58:36 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga05.intel.com (mga05.intel.com [192.55.52.43]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8F6F46E02E for ; Wed, 21 Dec 2016 01:58:34 +0000 (UTC) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga105.fm.intel.com with ESMTP; 20 Dec 2016 17:58:33 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos; i="5.33,381,1477983600"; d="scan'208"; a="1084836360" Received: from nuc-skylake.jf.intel.com ([10.54.75.136]) by fmsmga001.fm.intel.com with ESMTP; 20 Dec 2016 17:58:33 -0800 From: Dhinakaran Pandiyan To: intel-gfx@lists.freedesktop.org Date: Tue, 20 Dec 2016 17:57:40 -0800 Message-Id: <1482285460-3065-1-git-send-email-dhinakaran.pandiyan@intel.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <87k2avm3a0.fsf@intel.com> References: <87k2avm3a0.fsf@intel.com> Cc: Ander Conselvande Oliveira , stable@vger.kernel.org, Dhinakaran Pandiyan Subject: [Intel-gfx] [PATCH v3] drm/i915/dp: Do not reset detect_done flag in intel_dp_detect 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-Virus-Scanned: ClamAV using ClamSMTP From: "Navare, Manasi D" The detect_done flag was introduced in the 'commit 7d23e3c37bb3 ("drm/i915: Cleaning up intel_dp_hpd_pulse")' in order to avoid multiple detects on hotplug where intel_dp_long_pulse() was called from HPD handler as well as intel_dp_detect(). Later, 'commit 1015811609c0 ("drm/i915: Move long hpd handling into the hotplug work")' deferred long hpd handling to hotplug work to avoid handling it twice. But, resetting the flag after long hpd handling leads to the code being executed again during mode enumeration. So, do not reset the detect_done flag to False in intel_dp_detect(). The flag is reset in intel_dp_hpd_pulse() to allow a full detect and set when the hotplug work does a full DPCD detect. However if ->detect() gets called during mode enumeration after a DPCD detect, return the cached connector status. Resetting the flag in the encoder's reset callback should take care of hotplug between suspend/resume. v2: Allow full detect after encoder reset. (Ville) Set the detect_done flag for connector disconnected case too. (DK) Commit message changes. Cc: stable@vger.kernel.org Cc: Ville Syrjala Cc: Ander Conselvande Oliveira Cc: Jani Nikula Fixes: commit 7d23e3c37bb3 ("drm/i915: Cleaning up intel_dp_hpd_pulse") Signed-off-by: Manasi Navare Signed-off-by: Dhinakaran Pandiyan --- drivers/gpu/drm/i915/intel_dp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 45ebc96..5689cf3 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4473,7 +4473,6 @@ intel_dp_long_pulse(struct intel_connector *intel_connector) intel_dp_set_edid(intel_dp); if (is_edp(intel_dp) || intel_connector->detect_edid) status = connector_status_connected; - intel_dp->detect_done = true; /* Try to read the source of the interrupt */ if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 && @@ -4508,10 +4507,10 @@ intel_dp_detect(struct drm_connector *connector, bool force) connector->base.id, connector->name); /* If full detect is not performed yet, do a full detect */ - if (!intel_dp->detect_done) + if (!intel_dp->detect_done) { + intel_dp->detect_done = true; status = intel_dp_long_pulse(intel_dp->attached_connector); - - intel_dp->detect_done = false; + } return status; } @@ -4803,6 +4802,8 @@ void intel_dp_encoder_reset(struct drm_encoder *encoder) if (lspcon->active) lspcon_resume(lspcon); + intel_dp->detect_done = false; + if (to_intel_encoder(encoder)->type != INTEL_OUTPUT_EDP) return;