drm/nouveau/mpeg: print more debug info when rejecting dma objects
authorIlia Mirkin <imirkin@alum.mit.edu>
Sun, 6 Aug 2017 02:19:53 +0000 (22:19 -0400)
committerBen Skeggs <bskeggs@redhat.com>
Tue, 22 Aug 2017 08:04:34 +0000 (18:04 +1000)
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tobias Klausmann <tobias.johannes.klausmann@mni.thm.de>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv31.c
drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv40.c

index 8a8895246d26a23be65eb6fb29cbb001f71f728b..7fea7d45202f1a7a2cee1996dd8b45b9c0dd38df 100644 (file)
@@ -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 */
index 16de5bd94b1437d6d19a7bcbc1fb4b483f60a28c..b5ec7c504dc64c5d0c85aff4c65ccdfced3c83fe 100644 (file)
@@ -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 */