[Nouveau] [RFC PATCH] drm/nouveau: report channel owner in error messages

2012-12-06 Thread Marcin Slusarz
Full piglit run with this patch:
http://people.freedesktop.org/~mslusarz/chan_owners.txt

This patch covers only a small subset of all error messages, so:
Not-yet-signed-off-by: Marcin Slusarz marcin.slus...@gmail.com

Comments? Ideas?

(This commit depends on this one:
http://people.freedesktop.org/~mslusarz/0001-drm-nouveau-split-fifo-interrupt-handler.patch
 )
---
 core/engine/fifo/nv04.c|   43 +---
 core/engine/graph/nv50.c   |   14 +--
 core/include/core/client.h |2 -
 core/subdev/fb/nv50.c  |   53 ++---
 nouveau_drm.c  |5 ++--
 5 files changed, 100 insertions(+), 17 deletions(-)

diff --git a/drivers/gpu/drm/nouveau/core/engine/fifo/nv04.c 
b/drivers/gpu/drm/nouveau/core/engine/fifo/nv04.c
index 76944c4..f5d4d28 100644
--- a/drivers/gpu/drm/nouveau/core/engine/fifo/nv04.c
+++ b/drivers/gpu/drm/nouveau/core/engine/fifo/nv04.c
@@ -24,6 +24,7 @@
 
 #include core/os.h
 #include core/class.h
+#include core/client.h
 #include core/engctx.h
 #include core/namedb.h
 #include core/handle.h
@@ -398,10 +399,29 @@ out:
return handled;
 }
 
+static struct nouveau_client *
+nv04_fifo_client_for_chid(struct nv04_fifo_priv *priv, u32 chid)
+{
+   struct nouveau_fifo_chan *chan;
+   struct nouveau_client *client = NULL;
+   unsigned long flags;
+
+   spin_lock_irqsave(priv-base.lock, flags);
+   if (chid = priv-base.min 
+   chid = priv-base.max) {
+   chan = (void *)priv-base.channel[chid];
+   client = nouveau_client(chan);
+   }
+   spin_unlock_irqrestore(priv-base.lock, flags);
+
+   return client;
+}
+
 static void
 nv04_fifo_cache_error(struct nouveau_device *device,
struct nv04_fifo_priv *priv, u32 chid, u32 get)
 {
+   struct nouveau_client *client;
u32 mthd, data;
int ptr;
 
@@ -421,9 +441,12 @@ nv04_fifo_cache_error(struct nouveau_device *device,
}
 
if (!nv04_fifo_swmthd(priv, chid, mthd, data)) {
+   client = nv04_fifo_client_for_chid(priv, chid);
+
nv_error(priv,
-CACHE_ERROR - Ch %d/%d Mthd 0x%04x Data 0x%08x\n,
-chid, (mthd  13)  7, mthd  0x1ffc, data);
+CACHE_ERROR - Ch %d/%d [%s] Mthd 0x%04x Data 
0x%08x\n,
+chid, (mthd  13)  7, client ? client-name : unk,
+mthd  0x1ffc, data);
}
 
nv_wr32(priv, NV04_PFIFO_CACHE1_DMA_PUSH, 0);
@@ -445,11 +468,14 @@ static void
 nv04_fifo_dma_pusher(struct nouveau_device *device, struct nv04_fifo_priv 
*priv,
u32 chid)
 {
+   struct nouveau_client *client;
u32 dma_get = nv_rd32(priv, 0x003244);
u32 dma_put = nv_rd32(priv, 0x003240);
u32 push = nv_rd32(priv, 0x003220);
u32 state = nv_rd32(priv, 0x003228);
 
+   client = nv04_fifo_client_for_chid(priv, chid);
+
if (device-card_type == NV_50) {
u32 ho_get = nv_rd32(priv, 0x003328);
u32 ho_put = nv_rd32(priv, 0x003320);
@@ -457,9 +483,10 @@ nv04_fifo_dma_pusher(struct nouveau_device *device, struct 
nv04_fifo_priv *priv,
u32 ib_put = nv_rd32(priv, 0x003330);
 
nv_error(priv,
-DMA_PUSHER - Ch %d Get 0x%02x%08x Put 0x%02x%08x 
IbGet 0x%08x IbPut 0x%08x State 0x%08x (err: %s) Push 0x%08x\n,
-chid, ho_get, dma_get, ho_put, dma_put, ib_get, ib_put,
-state, nv_dma_state_err(state), push);
+DMA_PUSHER - Ch %d [%s] Get 0x%02x%08x Put 0x%02x%08x 
IbGet 0x%08x IbPut 0x%08x State 0x%08x (err: %s) Push 0x%08x\n,
+chid, client ? client-name : unk, ho_get, dma_get,
+ho_put, dma_put, ib_get, ib_put, state,
+nv_dma_state_err(state), push);
 
/* METHOD_COUNT, in DMA_STATE on earlier chipsets */
nv_wr32(priv, 0x003364, 0x);
@@ -471,9 +498,9 @@ nv04_fifo_dma_pusher(struct nouveau_device *device, struct 
nv04_fifo_priv *priv,
nv_wr32(priv, 0x003334, ib_put);
} else {
nv_error(priv,
-DMA_PUSHER - Ch %d Get 0x%08x Put 0x%08x State 0x%08x 
(err: %s) Push 0x%08x\n,
-chid, dma_get, dma_put, state, nv_dma_state_err(state),
-push);
+DMA_PUSHER - Ch %d [%s] Get 0x%08x Put 0x%08x State 
0x%08x (err: %s) Push 0x%08x\n,
+chid, client ? client-name : unk, dma_get, dma_put,
+state, nv_dma_state_err(state), push);
 
if (dma_get != dma_put)
nv_wr32(priv, 0x003244, dma_put);
diff --git a/drivers/gpu/drm/nouveau/core/engine/graph/nv50.c 
b/drivers/gpu/drm/nouveau/core/engine/graph/nv50.c
index 

[Nouveau] [Bug 37440] Infinite loop detected in fragment program

2012-12-06 Thread bugzilla-daemon
https://bugs.freedesktop.org/show_bug.cgi?id=37440

--- Comment #4 from Andrew Caudwell acaudw...@gmail.com ---
I believe this is due to a bug in mesa/program/prog_execute.c.

get_dst_register_pointer() returns a dummy register when the dest register
Index exceeds MAX_PROGRAM_TEMPS (currently set to 256). Perhaps this should be
an error or an assertion failure instead.

Raising the value of MAX_PROGRAM_TEMPS worked around the infinite loop in my
case.

I also needed to increase INST_INDEX_BITS to avoid an intermitant assertion
failure from mesa_src_reg_from_ir_src_reg(), though this may not be directly
related.

Mesa 9.1-devel using OSMesa.

-- 
You are receiving this mail because:
You are the assignee for the bug.
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau


Re: [Nouveau] [RFC PATCH] drm/nouveau: report channel owner in error messages

2012-12-06 Thread Maarten Lankhorst
Op 05-12-12 23:56, Marcin Slusarz schreef:
 Full piglit run with this patch:
 http://people.freedesktop.org/~mslusarz/chan_owners.txt

 This patch covers only a small subset of all error messages, so:
 Not-yet-signed-off-by: Marcin Slusarz marcin.slus...@gmail.com

 Comments? Ideas?

 (This commit depends on this one:
 http://people.freedesktop.org/~mslusarz/0001-drm-nouveau-split-fifo-interrupt-handler.patch
  )

I love the idea, this has been something that nouveau lacked for a long time 
and would make
error reporting a lot more useful.

~Maarten
___
Nouveau mailing list
Nouveau@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/nouveau