Ilia Mirkin
2017-Aug-06 02:19 UTC
[Nouveau] [PATCH] drm/nouveau/mpeg: print more debug info when rejecting dma objects
Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> --- 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 */ -- 2.13.0
Tobias Klausmann
2017-Aug-06 14:02 UTC
[Nouveau] [PATCH] drm/nouveau/mpeg: print more debug info when rejecting dma objects
Hi, Lgtm! Reviewed-by: Tobias Klausmann <tobias.johannes.klausmann at mni.thm.de> On 8/6/17 4:19 AM, Ilia Mirkin wrote:> Signed-off-by: Ilia Mirkin <imirkin at alum.mit.edu> > --- > > 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 */
Apparently Analagous Threads
- [PATCH 1/5] drm/nv31/mpeg: no need to set compat mode differently for nv44 gr
- [PATCH 1/7] drm/nouveau: remove prototype for non-existent nouveau_connector_bpp
- [PATCH] drm/nv31-nv43/mpeg: inst not available on pre-nv44
- [PATCH 0/5] renouveau: nv30/nv40 unification
- serial port in linux