Hi

I'm writing a graphics driver for a PCI based graphics card. The board is
bus master and can perform DMA transfers but does not have a GART like Ati
cards. I wrote all the 2D part (DDX driver with Xv, Xaa / Exa...) and now
I'm working on the DRI + DRM parts. For now, no DMA transfers are performed
at all and I'd like to use them first to accelerate system <-> host data
transfers for Exa (UploadToScreen, DownloadFromScreen) and Xvideo (grab
video, put image...). Looking into the source code of existing drivers, I
try to figure out how does this works and what kind of buffers I must use.
My need is to allocate a memory area which will be used as one or more
buffers. This area must be accessible in user-space (for exa, xv...), and
DMA-able in kernel space. Pages does not need to be contiguous because the
DMA engine is able to perfom chained DMA.

If I understood well, I must do something like this in user space :
    - drmScatterGatherAlloc : will allocate my DMA-able memory
    - drmAddMap (with type = DRM_SCATTER_GATHER) to add a mapping on it
    - drmAddBufs (with type = DRM_SG_BUFFER) to request buffers for DMA
transfers
    - drmMapBufs to map them in client virtual space
    - drmDMA to reserve and dispatch DMA buffers
The last command will issue an IOCTL that I must implement in the DRM driver
where the execution of the dma transfer will take place.

Is this correct ? I'm a little bit lost. I read every where that the drmDMA
should not be used and very few drivers call this function. I don't
understand why. Isn't it suitable for my needs ?

Thanks for you answers
Laurent
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
--
_______________________________________________
Dri-devel mailing list
Dri-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dri-devel

Reply via email to