Skip to contentSkip to conversation

reenable fifos if we get an error while fifos disabled

PATCH In review Stephan Schmid 2 participants 3 messages Sep 30, 2007 2 messages not in the archive

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 reenable fifos if we get an error while fifos disabled

Hello,
while playing around with multiple fifo contexts I got fifo hangs when opening glxgears nr.3.
The reason is that in drm/linux_core/nouveau_fifo.c l.342 engine->graph.create_context() returns -ENOMEM (I dont know why but I think this problems also appears with other errors). But the real problem is that then nouveau_fifo alloc() returns without reenabling fifo execution, so all fifos hang. With this patch glxgears nr.3 only prints scary messages and falls back to software rendering.

Greetings
Stephan Schmid

shared-core/nouveau_fifo.c +20 -0
index 437c84f..88a429a 100644
@@ -342,6 +342,16 @@ nouveau_fifo_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
 	ret = engine->graph.create_context(chan);
 	if (ret) {
 		nouveau_fifo_free(chan);
+
+		NV_WRITE(NV04_PFIFO_CACHE1_DMA_PUSH,
+		NV_READ(NV04_PFIFO_CACHE1_DMA_PUSH) | 1);
+		NV_WRITE(NV03_PFIFO_CACHE1_PUSH0, 0x00000001);
+		NV_WRITE(NV04_PFIFO_CACHE1_PULL0, 0x00000001);
+		NV_WRITE(NV04_PFIFO_CACHE1_PULL1, 0x00000001);
+
+		/* reenable the fifo caches */
+		NV_WRITE(NV03_PFIFO_CACHES, 1);
+
 		return ret;
 	}
 
@@ -349,6 +359,16 @@ nouveau_fifo_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
 	ret = engine->fifo.create_context(chan);
 	if (ret) {
 		nouveau_fifo_free(chan);
+
+		NV_WRITE(NV04_PFIFO_CACHE1_DMA_PUSH,
+		NV_READ(NV04_PFIFO_CACHE1_DMA_PUSH) | 1);
+		NV_WRITE(NV03_PFIFO_CACHE1_PUSH0, 0x00000001);
+		NV_WRITE(NV04_PFIFO_CACHE1_PULL0, 0x00000001);
+		NV_WRITE(NV04_PFIFO_CACHE1_PULL1, 0x00000001);
+
+		/* reenable the fifo caches */
+		NV_WRITE(NV03_PFIFO_CACHES, 1);
+
 		return ret;
 	}
 

_______________________________________________
Nouveau mailing list [email protected]
http://lists.freedesktop.org/mailman/listinfo/nouveau

A message that is not in the archive (sent off-list or not yet received): 46FFEF22.8080205-S0/[email protected]

#2 lore raw
Quoted 6 lines · Stephan Schmid

Hello,
while playing around with multiple fifo contexts I got fifo hangs when opening glxgears nr.3.
The reason is that in drm/linux_core/nouveau_fifo.c l.342 engine->graph.create_context() returns -ENOMEM (I dont know why but I think this problems also appears with other errors).

May be because of hash collision. I got similar failure, but I didn't take time to investigate.

Quoted 3 lines

But the real problem is that then nouveau_fifo alloc() returns without reenabling fifo execution, so all fifos hang. With this patch glxgears nr.3 only prints scary messages and falls back to software rendering.

Great.
May be using a goto to jump at the end, could avoid code duplication.

Matthieu

A message that is not in the archive (sent off-list or not yet received): [email protected]

#4 lore raw
Quoted 11 lines · matthieu castet
Quoted 6 lines · Stephan Schmid

Hello,
while playing around with multiple fifo contexts I got fifo hangs when opening glxgears nr.3.
The reason is that in drm/linux_core/nouveau_fifo.c l.342 engine->graph.create_context() returns -ENOMEM (I dont know why but I think this problems also appears with other errors).

May be because of hash collision. I got similar failure, but I didn't take time to investigate.

Quoted 6 lines
Quoted 3 lines

But the real problem is that then nouveau_fifo alloc() returns without reenabling fifo execution, so all fifos hang. With this patch glxgears nr.3 only prints scary messages and falls back to software rendering.

Great.
May be using a goto to jump at the end, could avoid code duplication.

Also note that in current git, nouveau_fifo_free disable and reenable fifo execution.
So it should make the problem disappears.