From patchwork Mon Aug 17 11:31:36 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sivakumar Thulasimani X-Patchwork-Id: 7024601 Return-Path: X-Original-To: patchwork-intel-gfx@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 0FA709F373 for ; Mon, 17 Aug 2015 11:31:17 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 28D9F205E1 for ; Mon, 17 Aug 2015 11:31:16 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 557A220411 for ; Mon, 17 Aug 2015 11:31:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id BECC4720F4; Mon, 17 Aug 2015 04:31:13 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga14.intel.com (mga14.intel.com [192.55.52.115]) by gabe.freedesktop.org (Postfix) with ESMTP id D8736720F9 for ; Mon, 17 Aug 2015 04:31:11 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP; 17 Aug 2015 04:31:11 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.15,694,1432623600"; d="scan'208";a="770253265" Received: from rtshiva-desktop.iind.intel.com ([10.223.26.71]) by fmsmga001.fm.intel.com with ESMTP; 17 Aug 2015 04:31:10 -0700 From: Sivakumar Thulasimani To: intel-gfx@lists.freedesktop.org Date: Mon, 17 Aug 2015 17:01:36 +0530 Message-Id: <1439811096-13561-3-git-send-email-sivakumar.thulasimani@intel.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1439811096-13561-1-git-send-email-sivakumar.thulasimani@intel.com> References: <1439811096-13561-1-git-send-email-sivakumar.thulasimani@intel.com> Subject: [Intel-gfx] [PATCH 2/2] drm/i915: Perform full detect on sink_count change 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" This patch checks for changes in sink_count during short pulse hpd in check_link_status and forces full detect when sink_count changes. Compliance test 4.2.2.8 expects this behavior in compliant driver. Signed-off-by: Sivakumar Thulasimani --- drivers/gpu/drm/i915/intel_dp.c | 24 ++++++++++++++++++------ drivers/gpu/drm/i915/intel_drv.h | 1 + 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index e4de8e5..04a9ade 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -4359,14 +4359,13 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp) /* If we're HPD-aware, SINK_COUNT changes dynamically */ if (intel_dp->dpcd[DP_DPCD_REV] >= 0x11 && intel_dp->downstream_ports[0] & DP_DS_PORT_HPD) { - uint8_t reg; if (intel_dp_dpcd_read_wake(&intel_dp->aux, DP_SINK_COUNT, - ®, 1) < 0) + &intel_dp->sink_count, 1) < 0) return connector_status_unknown; - return DP_GET_SINK_COUNT(reg) ? connector_status_connected - : connector_status_disconnected; + return DP_GET_SINK_COUNT(intel_dp->sink_count) ? + connector_status_connected : connector_status_disconnected; } /* If no HPD, poke DDC gently */ @@ -4401,17 +4400,20 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp) * 4. Check link status on receipt of hot-plug interrupt */ static void -intel_dp_check_link_status(struct intel_dp *intel_dp) +intel_dp_check_link_status(struct intel_dp *intel_dp, bool *need_full_detect) { struct drm_device *dev = intel_dp_to_dev(intel_dp); struct intel_encoder *intel_encoder = &dp_to_dig_port(intel_dp)->base; struct intel_crtc *crtc = to_intel_crtc(dp_to_dig_port(intel_dp)->base.base.crtc); u8 sink_irq_vector; + u8 old_sink_count = intel_dp->sink_count; u8 link_status[DP_LINK_STATUS_SIZE]; WARN_ON(!drm_modeset_is_locked(&dev->mode_config.connection_mutex)); + *need_full_detect = false; + /* 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 @@ -4423,6 +4425,12 @@ intel_dp_check_link_status(struct intel_dp *intel_dp) if (intel_dp_detect_dpcd(intel_dp) != connector_status_connected) return; + if (old_sink_count != intel_dp->sink_count) { + DRM_ERROR("forcing full detect\n"); + *need_full_detect = true; + return; + } + if (!intel_encoder->base.crtc) return; @@ -5026,13 +5034,17 @@ intel_dp_hpd_pulse(struct intel_digital_port *intel_dig_port, bool long_hpd) } if (!intel_dp->is_mst) { + bool full_detect = false; /* * we'll check the link status via the normal hot plug path later - * but for short hpds we should check it now */ drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); - intel_dp_check_link_status(intel_dp); + intel_dp_check_link_status(intel_dp, &full_detect); drm_modeset_unlock(&dev->mode_config.connection_mutex); + + if (full_detect) + goto put_power; } } diff --git a/drivers/gpu/drm/i915/intel_drv.h b/drivers/gpu/drm/i915/intel_drv.h index 81b7d77..8aca5bb 100644 --- a/drivers/gpu/drm/i915/intel_drv.h +++ b/drivers/gpu/drm/i915/intel_drv.h @@ -712,6 +712,7 @@ struct intel_dp { enum hdmi_force_audio force_audio; bool limited_color_range; bool color_range_auto; + uint8_t sink_count; uint8_t dpcd[DP_RECEIVER_CAP_SIZE]; uint8_t psr_dpcd[EDP_PSR_RECEIVER_CAP_SIZE]; uint8_t downstream_ports[DP_MAX_DOWNSTREAM_PORTS];