From: <uni...@sh...> - 2006-03-06 20:28:57
|
Jesse Barnes wrote: >I'm trying to get the CyberBlade EXA driver into a bit better shape, and >that means some sort of decent host<->fb DMA support. The device >itself is apparently capable of that, but EXA has trouble since it only >has the user virtual address of the transfers it wants to make, so I >thought a DRM driver might be in order. It's also necessary for decent >VBLANK support, which will hopefully be pretty straightforward. Note >that at this point, the DRM driver won't do you any good since I >haven't checked the EXA stuff that uses it into X.Org CVS yet (and >afaik there's no DRI driver for this device either). > >Any thoughts on how the host<->fb DMA stuff should work? Basically EXA >UploadToScreen wants to hand the card a virtual address range and have >it loaded up to the card's VRAM; DownloadFromScreen wants to do the >same in reverse. Should I just add a device specific DRM_IOCTL to >accomplish this (using get_user_pages() etc.) or is there some existing >code I could leverage? > >Thanks, >Jesse > > The via driver has code that does this (via_dmablit.c) as a device-specific IOCTL. It maintains a queue of blit operations and fire them off when the previous one is completed. The user calls a sync IOCTL to verify that the operation is finished. The via-specific code is quite limited, so it should be easy to port it to other hardware but the card needs to have a descriptor-based PCI DMA engine. Note that the throughput is quite low. With EXA you get about 65-70 MB/s either direction. Limited by the PCI bus speed. If your card can do AGP->VRAM transfers in hardware the best option for upload is probably to use that functionality. Software copies to AGP can be pipelined with AGP->VRAM blits using two bounce-buffers in AGP space. You split up the transfer and copy to one buffer while you're blitting to VRAM from the other. For downloads from VRAM we will soon have an option to blit from VRAM to AGP, and then take the pages out of AGP space and read from them with full speed, but that's still under development. /Thomas |