From patchwork Mon Aug 17 12:51:48 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivakumar Thulasimani X-Patchwork-Id: 7025001 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 3A9A4C05AC for ; Mon, 17 Aug 2015 12:51:28 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 5C48B20689 for ; Mon, 17 Aug 2015 12:51:27 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 877282068E for ; Mon, 17 Aug 2015 12:51:26 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 07BCE6E125; Mon, 17 Aug 2015 05:51:26 -0700 (PDT) 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 73C456E125 for ; Mon, 17 Aug 2015 05:51:24 -0700 (PDT) Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga101.jf.intel.com with ESMTP; 17 Aug 2015 05:51:24 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,694,1432623600"; d="scan'208";a="785268463" Received: from rtshiva-desktop.iind.intel.com ([10.223.26.71]) by fmsmga002.fm.intel.com with ESMTP; 17 Aug 2015 05:51:22 -0700 From: Sivakumar Thulasimani To: intel-gfx@lists.freedesktop.org, ville.syrjala@linux.intel.com, jani.nikula@linux.intel.com Date: Mon, 17 Aug 2015 18:21:48 +0530 Message-Id: <1439815909-6996-2-git-send-email-sivakumar.thulasimani@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1439815909-6996-1-git-send-email-sivakumar.thulasimani@intel.com> References: <1439815909-6996-1-git-send-email-sivakumar.thulasimani@intel.com> Subject: [Intel-gfx] [PATCH 1/2] drm/i915: Read sink_count dpcd always for short hpd 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.8 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: "Thulasimani,Sivakumar" Compliance test 4.2.2.8 requires driver to read the sink_count for short pulse interrupt even when the panel is not enabled. This patch performs the following a) reading sink_count by reusing intel_dp_detect_dpcd instead of using intel_dp_get_dpcd b) moving crtc enabled checks post sink_count read call v2: avoid code movement with functionality changes (Ville) Signed-off-by: Sivakumar Thulasimani --- drivers/gpu/drm/i915/intel_dp.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index b905c19..0b73e98 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -132,6 +132,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 enum drm_connector_status +intel_dp_detect_dpcd(struct intel_dp *intel_dp); static int intel_dp_max_link_bw(struct intel_dp *intel_dp) @@ -4362,21 +4364,23 @@ intel_dp_check_link_status(struct intel_dp *intel_dp) WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex)); - if (!intel_encoder->base.crtc) + /* 4.2.2.8 requires source to read link_status, 0 - 12 DPCD & + * sink_count even for short pulse irrespective of the sink is + * in use or not + */ + if (!intel_dp_get_link_status(intel_dp, link_status)) { return; + } - if (!to_intel_crtc(intel_encoder->base.crtc)->active) + /* reuse to read both 0 - 12 DPCD & sink_count */ + if (intel_dp_detect_dpcd(intel_dp) != connector_status_connected) return; - /* Try to read receiver status if the link appears to be up */ - if (!intel_dp_get_link_status(intel_dp, link_status)) { + if (!intel_encoder->base.crtc) return; - } - /* Now read the DPCD to see if it's actually running */ - if (!intel_dp_get_dpcd(intel_dp)) { + if (!to_intel_crtc(intel_encoder->base.crtc)->active) return; - } /* Try to read the source of the interrupt */ if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 &&