From patchwork Sun Aug 6 02:19:53 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ilia Mirkin X-Patchwork-Id: 9883469 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 000E8603B4 for ; Sun, 6 Aug 2017 02:20:08 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E16612872C for ; Sun, 6 Aug 2017 02:20:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D4DAD28731; Sun, 6 Aug 2017 02:20:04 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_MED,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 4D5152872C for ; Sun, 6 Aug 2017 02:20:03 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D25616E16D; Sun, 6 Aug 2017 02:20:00 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qt0-x244.google.com (mail-qt0-x244.google.com [IPv6:2607:f8b0:400d:c0d::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 7FF3A6E16D; Sun, 6 Aug 2017 02:19:59 +0000 (UTC) Received: by mail-qt0-x244.google.com with SMTP id t37so4981335qtg.2; Sat, 05 Aug 2017 19:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=uHExAaDxE4t3M5vZmvABifRjr6ehcA9Une7HcAHu/hY=; b=TQHUES7vXNsiOPT03hwM3/V/21sz3vlSZKvioRGaH0Ln3UflIAAjubaCb6PfUAi/ZI rhXpazYJtPVolf+DroPZ4cmXxEMmBDgG0eDW5Qg3Atia5l3sibDxguz8CticSXmMp4MY jqtt4b1flHaC0IS+GTHyWCrn98bixoerFAQbFTzOwMx5P6iB+nsyJUdlyE7dHo+u3Rxk zsknkqTtpSprbZBN5SSxyxZplMAaHfRH2FPmQ9IXju7KebYRQoitzDNyowCU4kk1aW8G QDaSd/FtQov0BETJE4hyvnUbRMM/cnEIQ9GaeifdL0eyhnLRkx9ZGa4L82kKN6DODQjH QxAw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=uHExAaDxE4t3M5vZmvABifRjr6ehcA9Une7HcAHu/hY=; b=Fi625urS67LWz8ZETv1V2bUU+cc/f+2dUuaOgzuE3Enw2iVw0Fx+0sZH0MkHVa9YUy OYeJpSeCRihfJm4ngiwIUZntqSZ6A2xunx/OGEcLwGE0lKUVT0i+r+MlYKrboQVAOMQH V41aivMXc0UFlVdc79qy4r6F2Bmxj+Yeyor4t5Zj7BOe6QoLtJP19aiBVHdrzttG7+7a 0bjW1okE+9ng+NtJZ2fH5KhVOuWoyhnE5BFgaRsT7yS+2uVmldTmaZL6IDTa9seVJ2Lr iUDWUDq8mveeIdOdpo62Xu7Si9HfbMtaCTOduonF9a7KMydvKO1y5iJphztcAOt8RViJ abKw== X-Gm-Message-State: AHYfb5hgLbMcpLMA6lFbSGXrf6lN8mShMVkFaL29XX+stBa3gTzBx/UB 5RPRsT6YwGR4qQ== X-Received: by 10.200.37.139 with SMTP id e11mr10335594qte.50.1501985998523; Sat, 05 Aug 2017 19:19:58 -0700 (PDT) Received: from athos.fios-router.home (pool-100-2-1-206.nycmny.fios.verizon.net. [100.2.1.206]) by smtp.gmail.com with ESMTPSA id g206sm3237698qkb.13.2017.08.05.19.19.57 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 05 Aug 2017 19:19:57 -0700 (PDT) From: Ilia Mirkin To: Ben Skeggs , nouveau@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH] drm/nouveau/mpeg: print more debug info when rejecting dma objects Date: Sat, 5 Aug 2017 22:19:53 -0400 Message-Id: <20170806021953.3689-1-imirkin@alum.mit.edu> X-Mailer: git-send-email 2.13.0 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-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Ilia Mirkin Reviewed-by: Tobias Klausmann --- This was helpful when debugging our earlier mpeg woes. May as well have it upstream. drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c | 7 ++++++- drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv40.c | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c index 8a8895246d26..99f33d88d940 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c @@ -124,6 +124,8 @@ nv31_mpeg_tile(struct nvkm_engine *engine, int i, struct nvkm_fb_tile *tile) static bool nv31_mpeg_mthd_dma(struct nvkm_device *device, u32 mthd, u32 data) { + struct nv31_mpeg *mpeg = nv31_mpeg(device->mpeg); + struct nvkm_subdev *subdev = &mpeg->engine.subdev; u32 inst = data << 4; u32 dma0 = nvkm_rd32(device, 0x700000 + inst); u32 dma1 = nvkm_rd32(device, 0x700004 + inst); @@ -132,8 +134,11 @@ nv31_mpeg_mthd_dma(struct nvkm_device *device, u32 mthd, u32 data) u32 size = dma1 + 1; /* only allow linear DMA objects */ - if (!(dma0 & 0x00002000)) + if (!(dma0 & 0x00002000)) { + nvkm_error(subdev, "inst %08x dma0 %08x dma1 %08x dma2 %08x\n", + inst, dma0, dma1, dma2); return false; + } if (mthd == 0x0190) { /* DMA_CMD */ diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv40.c b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv40.c index 16de5bd94b14..b5ec7c504dc6 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv40.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv40.c @@ -31,6 +31,8 @@ bool nv40_mpeg_mthd_dma(struct nvkm_device *device, u32 mthd, u32 data) { struct nvkm_instmem *imem = device->imem; + struct nv31_mpeg *mpeg = nv31_mpeg(device->mpeg); + struct nvkm_subdev *subdev = &mpeg->engine.subdev; u32 inst = data << 4; u32 dma0 = nvkm_instmem_rd32(imem, inst + 0); u32 dma1 = nvkm_instmem_rd32(imem, inst + 4); @@ -39,8 +41,11 @@ nv40_mpeg_mthd_dma(struct nvkm_device *device, u32 mthd, u32 data) u32 size = dma1 + 1; /* only allow linear DMA objects */ - if (!(dma0 & 0x00002000)) + if (!(dma0 & 0x00002000)) { + nvkm_error(subdev, "inst %08x dma0 %08x dma1 %08x dma2 %08x\n", + inst, dma0, dma1, dma2); return false; + } if (mthd == 0x0190) { /* DMA_CMD */