[Nouveau] Interrupt setting

Shinpei KATO shinpei at il.is.s.u-tokyo.ac.jp
Sat Mar 13 07:52:21 PST 2010


Dear Luca,

> > Ok, I think I was misunderstanding.
> > This means we have to tell a GPU by sending another command to increment a
> fence
> > value.
> > Finally I believe I am correct ;-)
> 
> It actually sets an arbitrary value. The relevant code is in nouveau_fence.c:
>         BEGIN_RING(chan, NvSubSw, USE_REFCNT ? 0x0050 : 0x0150, 1);
>         OUT_RING(chan, fence->sequence);
> 
> The current sequence number is read with (in the same file):
> sequence = nvchan_rd32(chan, 0x48);
> 
> (on Riva TNT/TNT2, USE_REFCNT is false, and we trigger an interrupt
> for each fence completion so we can emulate that in software)

Sorry that I did not carefully read the code; I just remembered the code doing:
	fence->sequence = ++chan->fence.sequence
This means the fence # is incremented, but does not mean the fence # executed by
a GPU is always sequential.
I should have precisely mentioned this.

> > On the other hand, this means that, for now in Nouveau, we dont have a way
> to
> > tell a GPU to notify us of a completion of a DMA transfer.
> > Maybe an interrupt from a GPU (PGRAPH_BUFFER_NOTIFY or something) is needed
> for
> > this.
> > I understand this notification is not necessary now, because DMA
transactions
> > are managed by ring buffers.
> 
> Not sure what you mean.
> In theory, once the FIFO processes the next command, all transfers
> done by the previous one should be completed.
> Note that simple DMA data copies are done with FIFO commands too (with
> m2mf aka MEMORY_TO_MEMORY_FORMAT).
> Also, all the commands before it have obviously already been fetched
> from the FIFO.

Ok, I still may be misunderstanding.
I thought that, in nouveau_gem_ioctl_pushbuf(), you transfer the buffers to a
GPU by nv50_dma_push() in case of NV50.
My assumption is that each pushbuf may include more than one command; i.e., one
pushbuf procedure may include both DMA data copy and object drawing (I used a
term "GPU operation" for drawing).
Since you create one fence object for each pushbuf, I thought that we can
synchronize only with last the command.
Not sure if my assumption is correct...

Best,
- Shinpei



More information about the Nouveau mailing list