From patchwork Mon Jun 30 03:12:24 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Wang, Quanxian" X-Patchwork-Id: 4445391 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 53AE0BEEAA for ; Mon, 30 Jun 2014 02:58:49 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 8E254202E9 for ; Mon, 30 Jun 2014 02:58:48 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8774F202F0 for ; Mon, 30 Jun 2014 02:58:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 231EE6E1A6; Sun, 29 Jun 2014 19:58:46 -0700 (PDT) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by gabe.freedesktop.org (Postfix) with ESMTP id 29A426E1A6 for ; Sun, 29 Jun 2014 19:58:45 -0700 (PDT) Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP; 29 Jun 2014 19:58:44 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.01,573,1400050800"; d="scan'208";a="555059164" Received: from quanxian-devel.bj.intel.com ([10.238.158.87]) by fmsmga001.fm.intel.com with ESMTP; 29 Jun 2014 19:58:43 -0700 From: Quanxian Wang To: intel-gfx@lists.freedesktop.org Date: Mon, 30 Jun 2014 11:12:24 +0800 Message-Id: <1404097944-10935-1-git-send-email-quanxian.wang@intel.com> X-Mailer: git-send-email 1.8.1.2 Subject: [Intel-gfx] [PATCH] drm/i915/vlv: DP_SINK_COUNT is not reliable for branch device. X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.15 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, 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 Background: Valleyview platform VTC1010 with a branch device DP2HDMI attached by a sink device Giantec HDMI display. Firstly changing to virtual console termial, after a while(10-20 minutes), connector issues a faked dpms signal which cause kernel to power off the monitor. And kernel will delete all allocated connecotr and encoder attached to this connector. This will cause monitor could not be restored at all even if you press any key or mouse. The root cause is that intel_dp_detect_dpcd funtion detects DP_SINK_COUNT from dpcd to check how many sink devices are attached. If greater than 0, it will be fine to keep connector alive. Otherwise the connector will be changed to be disconnected. And then all things related with this connector will be deleted. With testing, when SINK_COUNT is 0, drm_probe_ddc works and connector is still alive. So this patch will ignore the condition of SINK_COUNT=0, and continue to check if connector is really alive without touch others process. Signed-off-by: Quanxian Wang --- drivers/gpu/drm/i915/intel_dp.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c index 23b62b0..9984d22 100644 --- a/drivers/gpu/drm/i915/intel_dp.c +++ b/drivers/gpu/drm/i915/intel_dp.c @@ -3414,8 +3414,8 @@ intel_dp_detect_dpcd(struct intel_dp *intel_dp) ®, 1) < 0) return connector_status_unknown; - return DP_GET_SINK_COUNT(reg) ? connector_status_connected - : connector_status_disconnected; + if (DP_GET_SINK_COUNT(reg)) + return connector_status_connected; } /* If no HPD, poke DDC gently */