From patchwork Fri Oct 3 14:36:00 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Moreau X-Patchwork-Id: 5022771 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.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id AD951C11AB for ; Fri, 3 Oct 2014 14:36:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id F416520158 for ; Fri, 3 Oct 2014 14:36:15 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id DEFCD200F2 for ; Fri, 3 Oct 2014 14:36:14 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ACCF06E528; Fri, 3 Oct 2014 07:36:12 -0700 (PDT) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from smtp3-g21.free.fr (smtp3-g21.free.fr [212.27.42.3]) by gabe.freedesktop.org (Postfix) with ESMTP id 56DB36E429; Fri, 3 Oct 2014 07:36:11 -0700 (PDT) Received: from Normandy.localdomain (unknown [46.193.160.248]) (Authenticated sender: pierre.morrow) by smtp3-g21.free.fr (Postfix) with ESMTPSA id 90681A634A; Fri, 3 Oct 2014 16:35:25 +0200 (CEST) From: Pierre Moreau To: nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org, Ben Skeggs Subject: [PATCH v2 1/2] drm/nouveau/fb/nv50: Add PFB writes Date: Fri, 3 Oct 2014 16:36:00 +0200 Message-Id: <1412346960-26876-1-git-send-email-pierre.morrow@free.fr> X-Mailer: git-send-email 2.1.2 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.15 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,FREEMAIL_FROM, 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 (This is a v2 of patch "drm/nouveau/disp/nv50: Add PFB writes") This fix a GPU lockup on 9400M (NVAC) when using acceleration, see https://bugs.freedesktop.org/show_bug.cgi?id=27501 v2: - Move code to subdev/fb/nv50.c as suggested by Roy Spliet; - Remove arbitrary writes to 100c18/100c24 as suggested by Roy Spliet; - Replace write to 100c1c of arbitrary value by the address of a scratch page as proposed by Ilia Mirkin; - Remove enabling of bits 16 and 0 as they don't yield in any changes. Signed-off-by: Pierre Moreau --- drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c b/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c index 4150b0d..5c84d13 100644 --- a/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c +++ b/drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c @@ -289,6 +289,17 @@ nv50_fb_init(struct nouveau_object *object) if (ret) return ret; + /* Not a clue what this is exactly. Without enabling bit 1 of + * 100c14, system will lockup while initialising the card + * (#27501) + */ + if (nv_device(priv)->chipset == 0xac) { + if ((nv_rd32(priv, 0x100c14) & 0x00000002) == 0x00000000) { + nv_wr32(priv, 0x100c1c, priv->r100c08 >> 8); + nv_mask(priv, 0x100c14, 0x00000000, 0x00000002); + } + } + /* Not a clue what this is exactly. Without pointing it at a * scratch page, VRAM->GART blits with M2MF (as in DDX DFS) * cause IOMMU "read from address 0" errors (rh#561267)