Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp4155775imu; Mon, 7 Jan 2019 16:59:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/V5yEqEiHelFaJ1Na6R2IR4gGnc9ebBxu6FkO8kLphpCE0B+MT3EkbzkTHgir+Y8QRD7dS1 X-Received: by 2002:a62:2781:: with SMTP id n123mr65849187pfn.138.1546909185895; Mon, 07 Jan 2019 16:59:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546909185; cv=none; d=google.com; s=arc-20160816; b=gGhyzo90cGf91qZC9/ZDBJMl2bM2Xvj1dOJ29qWhmKkpMBSTp/5LK3DpHnJNvnrSL8 SXfrFkAv2WMkhJ2c87DUcxqgJEQ1bdUgsO67fAmMtYk6b4BA08pxAcf/GpO8UYtgI/Xm vWOYcUsmzObRLP1CMdRH/ZEqawGOdJAyiycfDzaxCMCS6rLENjBLckByqzS5YjlrG0i+ oKpQVzAzAV2lg9y9cbSfRthT4Og0MrKhBA43kVCmc6kf2QlB2Cnc3j30iMuf4VY+v29J wjGsdr27YEdbRUQaxzcisCPdQzD2M8/SMwUmNSCfTUq5ZghiFMoz7wEr+xqzil6c3b+m Cndw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=qBeslUlH1OE5oyZL483PkQMT11jF9dqGpuL/Cjq3hdc=; b=st5Seqsc3YmUTYzwlpXrFlSiv6zEtP3M5xE/KDja7CxuufuLKvUilcdiD3RZVPtb+k UIpHNOmqmbJYD4MOTlmLy7L9G4jfmwUeZB+OxcK8QCPSUI6PJLFgzr5g2jtyoXV8+Hiv 0St5+ltJ9dqypnvCvWvdP7TpElSXydO45C+637mpFgxHdzV/C6m+w0R1btPtseX+WoY+ 7IGe+fU4Yr7YhCXzWYGuugzq2YtBimgv31NoFGxwUlNCchVaBO53BIXQp5h6A282A0/W +VwkPX/iIug/Y/lN/+nsaQQLLDiVeSYJe8eZ3rO2PPz+MgQVivsV/6MVvV3dG8cioR0T 9oeA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r19si4656912plx.321.2019.01.07.16.59.30; Mon, 07 Jan 2019 16:59:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727306AbfAHA55 (ORCPT + 99 others); Mon, 7 Jan 2019 19:57:57 -0500 Received: from mx1.redhat.com ([209.132.183.28]:42146 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727186AbfAHA54 (ORCPT ); Mon, 7 Jan 2019 19:57:56 -0500 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id EBBFB13AAD; Tue, 8 Jan 2019 00:57:55 +0000 (UTC) Received: from malachite.bss.redhat.com (dhcp-10-20-1-11.bss.redhat.com [10.20.1.11]) by smtp.corp.redhat.com (Postfix) with ESMTP id 8072760CD0; Tue, 8 Jan 2019 00:57:53 +0000 (UTC) From: Lyude Paul To: dri-devel@lists.freedesktop.org, amd-gfx@lists.freedesktop.org Cc: Jerry Zuo , stable@vger.kernel.org, Harry Wentland , Leo Li , Alex Deucher , =?UTF-8?q?Christian=20K=C3=B6nig?= , "David (ChunMing) Zhou" , David Airlie , Daniel Vetter , Tony Cheng , David Francis , Nicholas Kazlauskas , Mikita Lipski , Shirish S , Bhawanpreet Lakha , Anthony Koo , linux-kernel@vger.kernel.org Subject: [PATCH 2/3] drm/amdgpu: Don't fail resume process if resuming atomic state fails Date: Mon, 7 Jan 2019 19:56:46 -0500 Message-Id: <20190108005651.25967-3-lyude@redhat.com> In-Reply-To: <20190108005651.25967-1-lyude@redhat.com> References: <20190108005651.25967-1-lyude@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 08 Jan 2019 00:57:56 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This is an ugly one unfortunately. Currently, all DRM drivers supporting atomic modesetting will save the state that userspace had set before suspending, then attempt to restore that state on resume. This probably worked very well at one point, like many other things, until DP MST came into the picture. While it's easy to restore state on normal display connectors that were disconnected during suspend regardless of their state post-resume, this can't really be done with MST because of the fact that setting up a downstream sink requires performing sideband transactions between the source and the MST hub, sending out the ACT packets, etc. Because of this, there isn't really a guarantee that we can restore the atomic state we had before suspend once we've resumed. This sucks pretty bad, but so far I haven't run into any compositors that this actually causes serious issues with. Most compositors will notice the hotplug we send afterwards, and then reprobe state. Since nouveau and i915 also don't fail the suspend/resume process due to failing to restore the atomic state, let's make amdgpu match this behavior. Better to resume the GPU properly, then to stop the process half way because of a potentially unavoidable atomic commit failure. Eventually, we'll have a real fix for this problem on the DRM level. But we've got some more important low-hanging fruit to deal with first. Signed-off-by: Lyude Paul Cc: Jerry Zuo Cc: # v4.15+ --- drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 3f326a2c513b..a3e65e457348 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -912,7 +912,6 @@ static int dm_resume(void *handle) struct drm_plane_state *new_plane_state; struct dm_plane_state *dm_new_plane_state; enum dc_connection_type new_connection_type = dc_connection_none; - int ret; int i; /* power on hardware */ @@ -985,13 +984,13 @@ static int dm_resume(void *handle) } } - ret = drm_atomic_helper_resume(ddev, dm->cached_state); + drm_atomic_helper_resume(ddev, dm->cached_state); dm->cached_state = NULL; amdgpu_dm_irq_resume_late(adev); - return ret; + return 0; } /** -- 2.20.1