From patchwork Thu Apr 21 15:44:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: cpaul@redhat.com X-Patchwork-Id: 8902271 Return-Path: X-Original-To: patchwork-dri-devel@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 4FDB3BF29F for ; Thu, 21 Apr 2016 15:46:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7D5BD20221 for ; Thu, 21 Apr 2016 15:46:12 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id E0DAE202F8 for ; Thu, 21 Apr 2016 15:46:07 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 87CB76ED19; Thu, 21 Apr 2016 15:46:06 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by gabe.freedesktop.org (Postfix) with ESMTPS id BE8E96ED17; Thu, 21 Apr 2016 15:46:03 +0000 (UTC) Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 440C26F667; Thu, 21 Apr 2016 15:46:03 +0000 (UTC) Received: from ecstaticemu.bos.redhat.com (dhcp-25-142.bos.redhat.com [10.18.25.142]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u3LFk10i025527; Thu, 21 Apr 2016 11:46:02 -0400 From: Lyude To: intel-gfx@lists.freedesktop.org Subject: [PATCH] drm/i915/vlv: Enable polling when we shut off all power domains Date: Thu, 21 Apr 2016 11:44:48 -0400 Message-Id: <1461253488-18043-1-git-send-email-cpaul@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 Cc: stable@vger.kernel.org, "open list:INTEL DRM DRIVERS excluding Poulsbo, Moorestow..., linux-kernel@vger.kernel.org open list" , Daniel Vetter , Lyude X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-5.2 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 Unfortunately HPD isn't functional once we shut off all of the power domains. Unfortunately we can end up shutting off all of the power domains in any situation where we don't have any monitors connected, essentially breaking hpd for the user unless they reboot with one of their monitors connected. In addition, enabling polling has to be done in it's own seperate worker. The reason for this is that vlv_display_power_well_init/deinit() will get called during the DRM polling process and try to grab the locks required for turning on polling and cause a deadlock. This breaks runtime PM due to the constant wakeups, so this is more of a temporary workaround then a solution. Signed-off-by: Lyude Cc: stable@vger.kernel.org --- drivers/gpu/drm/i915/intel_display.c | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index 551541b303..f644814 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -14531,7 +14531,22 @@ static void intel_setup_outputs(struct drm_device *dev) intel_dp_is_edp(dev, PORT_C)) intel_dp_init(dev, VLV_DP_C, PORT_C); - if (IS_CHERRYVIEW(dev)) { + if (IS_VALLEYVIEW(dev)) { + struct intel_connector *connector; + + /* + * On vlv, turning off all of the power domains results + * in a loss of hpd, enable polling on all of the + * connectors so that drm polls them when this happens + */ + drm_modeset_lock(&dev->mode_config.connection_mutex, + NULL); + for_each_intel_connector(dev, connector) { + connector->polled = DRM_CONNECTOR_POLL_CONNECT | + DRM_CONNECTOR_POLL_DISCONNECT; + } + drm_modeset_unlock(&dev->mode_config.connection_mutex); + } else if (IS_CHERRYVIEW(dev)) { /* eDP not supported on port D, so don't check VBT */ if (I915_READ(CHV_HDMID) & SDVO_DETECTED) intel_hdmi_init(dev, CHV_HDMID, PORT_D);