From 18bba3fa29187bb5122ed057989203dc05bc46aa Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Fri, 17 Nov 2006 08:05:23 +1100 Subject: Dump some useful info when a PGRAPH error occurs. The "channel" detect doesn't work on my nv40, but the rest seems to produce sane info. --- shared-core/nouveau_fifo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shared-core/nouveau_fifo.c') diff --git a/shared-core/nouveau_fifo.c b/shared-core/nouveau_fifo.c index c662165b..73c4e9f9 100644 --- a/shared-core/nouveau_fifo.c +++ b/shared-core/nouveau_fifo.c @@ -536,7 +536,7 @@ void nouveau_fifo_cleanup(drm_device_t* dev, DRMFILE filp) DRM_DEBUG("clearing FIFO enables from filp\n"); for(i=0;ififos[i].filp==filp) + if (dev_priv->fifos[i].used && dev_priv->fifos[i].filp==filp) nouveau_fifo_free(dev,i); /* check we still point at an active channel */ -- cgit v1.2.3 From e9194dd1b068666dd94e73d95dc3cd031a89a6b7 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sat, 18 Nov 2006 10:03:45 +1100 Subject: Check some return vals, fixes a couple of oopses. --- shared-core/nouveau_fifo.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'shared-core/nouveau_fifo.c') diff --git a/shared-core/nouveau_fifo.c b/shared-core/nouveau_fifo.c index 73c4e9f9..441bde40 100644 --- a/shared-core/nouveau_fifo.c +++ b/shared-core/nouveau_fifo.c @@ -403,6 +403,10 @@ static int nouveau_fifo_alloc(drm_device_t* dev,drm_nouveau_fifo_alloc_t* init, NV_DMA_ACCESS_RO, NV_DMA_TARGET_VIDMEM); } + if (!cb_obj) { + DRM_ERROR("unable to alloc object for command buffer\n"); + return DRM_ERR(EINVAL); + } dev_priv->fifos[i].cmdbuf_obj = cb_obj; /* that fifo is used */ -- cgit v1.2.3 From 9ac7a8b0b4c0431b605c3f8d0b4a696903010c51 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Sat, 18 Nov 2006 10:09:29 +1100 Subject: Only return FIFO number if the FIFO is marked as in use.. --- shared-core/nouveau_fifo.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'shared-core/nouveau_fifo.c') diff --git a/shared-core/nouveau_fifo.c b/shared-core/nouveau_fifo.c index 441bde40..b6fc613c 100644 --- a/shared-core/nouveau_fifo.c +++ b/shared-core/nouveau_fifo.c @@ -564,7 +564,7 @@ int nouveau_fifo_id_get(drm_device_t* dev, DRMFILE filp) int i; for(i=0;ififos[i].filp == filp) + if (dev_priv->fifos[i].used && dev_priv->fifos[i].filp == filp) return i; return -1; } -- cgit v1.2.3