From patchwork Tue Feb 23 22:11:52 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: 8397261 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 77E66C0553 for ; Tue, 23 Feb 2016 22:13:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A9F8D202BE for ; Tue, 23 Feb 2016 22:13:24 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 8CFAD202F0 for ; Tue, 23 Feb 2016 22:13:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 633EE6E6A1; Tue, 23 Feb 2016 22:13:22 +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 1DA6D6E6A1; Tue, 23 Feb 2016 22:13:21 +0000 (UTC) Received: from int-mx10.intmail.prod.int.phx2.redhat.com (int-mx10.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by mx1.redhat.com (Postfix) with ESMTPS id 50E0F8553B; Tue, 23 Feb 2016 22:13:20 +0000 (UTC) Received: from whitewolf.lyude.com (vpn-231-59.phx2.redhat.com [10.3.231.59]) by int-mx10.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id u1NMDIj9021728 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 23 Feb 2016 17:13:19 -0500 From: Lyude To: intel-gfx@lists.freedesktop.org Subject: [PATCH] drm/i915: Resume DP MST before doing any kind of modesetting Date: Tue, 23 Feb 2016 17:11:52 -0500 Message-Id: <1456265512-15670-1-git-send-email-cpaul@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 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=-4.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 As it turns out, resuming DP MST is racey since we don't make sure MST is ready before we start modesetting, it just usually happens to be ready in time. This isn't the case on all systems, particularly a ThinkPad T560 with displays connected through the dock. On these systems, resuming the laptop while connected to the dock usually results in blank monitors. Making sure MST is ready before doing any kind of modesetting fixes this issue. We originally changed the resume order in commit e7d6f7d70829 ("drm/i915: resume MST after reading back hw state") to fix a ton of WARN_ON's after resume, but this doesn't seem to be an issue now anyhow. CC: stable@vger.kernel.org Signed-off-by: Lyude --- drivers/gpu/drm/i915/i915_drv.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.c b/drivers/gpu/drm/i915/i915_drv.c index f357058..4dcf3dd 100644 --- a/drivers/gpu/drm/i915/i915_drv.c +++ b/drivers/gpu/drm/i915/i915_drv.c @@ -733,6 +733,14 @@ static int i915_drm_resume(struct drm_device *dev) intel_opregion_setup(dev); intel_init_pch_refclk(dev); + + /* + * We need to make sure that we resume MST before doing anything + * display related, otherwise we risk trying to bring up a display on + * MST before the hub is actually ready + */ + intel_dp_mst_resume(dev); + drm_mode_config_reset(dev); /* @@ -765,8 +773,6 @@ static int i915_drm_resume(struct drm_device *dev) intel_display_resume(dev); drm_modeset_unlock_all(dev); - intel_dp_mst_resume(dev); - /* * ... but also need to make sure that hotplug processing * doesn't cause havoc. Like in the driver load code we don't