EXA "nv" vs AGP writes

Lars Knoll lars at trolltech.com
Fri Oct 7 00:33:31 PDT 2005


Hi Ben,

On Friday 07 October 2005 08:57, Benjamin Herrenschmidt wrote:
> Hi Lars !
>
> I've been testing/hacking a bit your NV patch (or rather Ajax' modified
> version of it) on a 5200FX in an iMac G5. I've run into various trouble
> with AGP so I started with disabling all the hooks that touch it
> (UploadToScreen and DownloadFromScreen typically) and I've left
> composite disabled for now.
>
> Then, I've been trying to get AGP working with UTS. I added some timeout
> code to the function that waits for a notifier to complete since the
> server was systematically locking up looping in there waiting for ever
> for completion.
>
> I noticed that if timeout after a little while, it actually works. That
> is, my pixmap was properly blitted to the framebuffer. That tend to show
> that transfers AGP -> fb seem to work, but for some reason, the notifier
> wasn't getting updated (it stayed all 0xffffffff's, I verified all 32
> bytes).
>
> I've then changed the notifier by putting it in the framebuffer instead
> of AGP memory (at the top of the FB, just after the command ring). And
> miracle  ... it actually worked.
>
> So it seems that writes to AGP memory don't work on this machine. Well,
> I know some Apple chipsets don't support it indeed, but I expected that
> one to work since it looks like the Darwin driver does not set the
> "CantWrite" flag bit on this one. Oh well...
>
> I then tried getting DFS to work, but it always timesout, wherever the
> notifier is. That tend to confirm my idea that something is wrong with
> writes to AGP memory.

Yes, this very much sounds like writes to AGP are simply not working.

> Now, I'm not sure if hte problem is with my host chipset, or if some
> magic bit in the nvidia chip need to be tweaked at this point. I think
> however that it might be useful to implement a fallback mecanism using
> PCI SG DMA instead with kernel help. I'm currently working on some DRM
> bits to do that on radeon which I'll publish as soon as I get something
> working.

Sounds good. We will need PCI DMA transfers as well for PCIe cards, so it 
would be good to implement it anyways. 

If you look into the code in nv_dma.c, NVDmaCreateDMAObject should be able to 
create DMA objects that can control PCI transfers to continous blocks of main 
memory. Scatter/gather can apparently also be done, by changing the DMA 
object. We currently use a linear page table in there. One can change the 
flag to nonlinear, and then you should be ok, if you add a list of physical 
pages afterwards (instead of the one entry for the base address we currently 
have). I have never tested this, but this is my current guess on how it 
works.

If this works, we could probably also move the notifier objects to main 
memory.

It would also be interesting to get some timing measurements to see the speed 
difference between PCI and AGP transfers. PCI transfers should be a bit 
slower, but they have the advantage that can go to cached memory and we can 
probably avoid the second memcpy I currently do when using AGP.

Cheers,
Lars



More information about the xorg mailing list