All of lore.kernel.org
 help / color / mirror / Atom feed
* [Patch] reenable fifos if we get an error while fifos disabled
@ 2007-09-30 18:46 Stephan Schmid
       [not found] ` <46FFEF22.8080205-S0/GAf8tV78@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: Stephan Schmid @ 2007-09-30 18:46 UTC (permalink / raw)
  To: Nouveau

[-- Attachment #1: Type: text/plain, Size: 524 bytes --]

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


[-- Attachment #2: patch_fifo_reenable --]
[-- Type: text/plain, Size: 1195 bytes --]

diff --git a/shared-core/nouveau_fifo.c b/shared-core/nouveau_fifo.c
index 437c84f..88a429a 100644
--- a/shared-core/nouveau_fifo.c
+++ b/shared-core/nouveau_fifo.c
@@ -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;
 	}
 


[-- Attachment #3: Type: text/plain, Size: 181 bytes --]

_______________________________________________
Nouveau mailing list
Nouveau-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org
http://lists.freedesktop.org/mailman/listinfo/nouveau

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Patch] reenable fifos if we get an error while fifos disabled
       [not found] ` <46FFEF22.8080205-S0/GAf8tV78@public.gmane.org>
@ 2007-09-30 21:30   ` matthieu castet
       [not found]     ` <47001565.2010607-GANU6spQydw@public.gmane.org>
  0 siblings, 1 reply; 3+ messages in thread
From: matthieu castet @ 2007-09-30 21:30 UTC (permalink / raw)
  To: Stephan Schmid; +Cc: Nouveau

Stephan Schmid wrote:
> 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.


> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Patch] reenable fifos if we get an error while fifos disabled
       [not found]     ` <47001565.2010607-GANU6spQydw@public.gmane.org>
@ 2007-09-30 21:33       ` matthieu castet
  0 siblings, 0 replies; 3+ messages in thread
From: matthieu castet @ 2007-09-30 21:33 UTC (permalink / raw)
  To: Stephan Schmid; +Cc: Nouveau

matthieu castet wrote:
> Stephan Schmid wrote:
>> 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.
> 
> 
>> 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.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-09-30 21:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-09-30 18:46 [Patch] reenable fifos if we get an error while fifos disabled Stephan Schmid
     [not found] ` <46FFEF22.8080205-S0/GAf8tV78@public.gmane.org>
2007-09-30 21:30   ` matthieu castet
     [not found]     ` <47001565.2010607-GANU6spQydw@public.gmane.org>
2007-09-30 21:33       ` matthieu castet

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.