From patchwork Thu Jan 24 03:27:11 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Herton Ronaldo Krzesinski X-Patchwork-Id: 215169 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from chlorine.canonical.com (chlorine.canonical.com [91.189.94.204]) by ozlabs.org (Postfix) with ESMTP id 780EB2C007E for ; Thu, 24 Jan 2013 14:31:28 +1100 (EST) Received: from localhost ([127.0.0.1] helo=chlorine.canonical.com) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TyDX5-0003ae-UO; Thu, 24 Jan 2013 03:31:20 +0000 Received: from youngberry.canonical.com ([91.189.89.112]) by chlorine.canonical.com with esmtp (Exim 4.71) (envelope-from ) id 1TyDX3-0003Zc-Tj for kernel-team@lists.ubuntu.com; Thu, 24 Jan 2013 03:31:17 +0000 Received: from 189.58.28.114.dynamic.adsl.gvt.net.br ([189.58.28.114] helo=canonical.com) by youngberry.canonical.com with esmtpsa (TLS1.0:DHE_RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1TyDX3-0007Jo-7y; Thu, 24 Jan 2013 03:31:17 +0000 From: Herton Ronaldo Krzesinski To: linux-kernel@vger.kernel.org, stable@vger.kernel.org, kernel-team@lists.ubuntu.com Subject: [PATCH 59/74] drm/nv17-50: restore fence buffer on resume Date: Thu, 24 Jan 2013 01:27:11 -0200 Message-Id: <1358998046-613-60-git-send-email-herton.krzesinski@canonical.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: <1358998046-613-1-git-send-email-herton.krzesinski@canonical.com> References: <1358998046-613-1-git-send-email-herton.krzesinski@canonical.com> X-Extended-Stable: 3.5 Cc: Marcin Slusarz , Ben Skeggs X-BeenThere: kernel-team@lists.ubuntu.com X-Mailman-Version: 2.1.13 Precedence: list List-Id: Kernel team discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: kernel-team-bounces@lists.ubuntu.com Errors-To: kernel-team-bounces@lists.ubuntu.com 3.5.7.4 -stable review patch. If anyone has any objections, please let me know. ------------------ From: Marcin Slusarz commit f20ebd034eab43fd38c58b11c5bb5fb125e5f7d7 upstream. Since commit 5e120f6e4b3f35b741c5445dfc755f50128c3c44 "drm/nouveau/fence: convert to exec engine, and improve channel sync" nouveau fence sync implementation for nv17-50 and nvc0+ started to rely on state of fence buffer left by previous sync operation. But as pinned bo's (where fence state is stored) are not saved+restored across suspend/resume, we need to do it manually. nvc0+ was fixed by commit d6ba6d215a538a58f0f0026f0961b0b9125e8042 "drm/nvc0/fence: restore pre-suspend fence buffer context on resume". Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=50121 Signed-off-by: Marcin Slusarz Signed-off-by: Ben Skeggs [ herton: backport for 3.5, looks like we only need to call nouveau_bo_wr32 on nv10_fence_init ] Signed-off-by: Herton Ronaldo Krzesinski --- drivers/gpu/drm/nouveau/nv10_fence.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/gpu/drm/nouveau/nv10_fence.c b/drivers/gpu/drm/nouveau/nv10_fence.c index 8a1b750..18932a6 100644 --- a/drivers/gpu/drm/nouveau/nv10_fence.c +++ b/drivers/gpu/drm/nouveau/nv10_fence.c @@ -155,6 +155,9 @@ nv10_fence_fini(struct drm_device *dev, int engine, bool suspend) static int nv10_fence_init(struct drm_device *dev, int engine) { + struct nv10_fence_priv *priv = nv_engine(dev, engine); + + nouveau_bo_wr32(priv->bo, 0, priv->sequence); return 0; }