Re: DMA to user space for framegrabber HOW?

Jamie Lokier (lkd@tantalophile.demon.co.uk)
Fri, 4 Jun 1999 19:01:28 +0200


Nils Rennebarth wrote:
> If I remember correctly, the solution
> was to mmap the user space buffer to kernel space and then DMA to
> that.

(1) The recommended solution was to kmalloc() a buffer in your driver an
mmap that into user space.

(2) The one you're suggestion is more flexible, but trickier one to get
right and not supported by the kernel. (The recommend solution is
supported).

> Is there example code? What if I wish to use th MIT SHM extension for X to
> transfer the data to the X framebuffer?

MIT SHM doesn't transfer the data to the X framebuffer -- it simply
makes it available in the X server's address space, so the image can be
copied only once by the X server. (Instead of going over the pipe to
the X server).

To write to the framebuffer directly you can use the XFree86-specific
XF86DGA extension.

Neither MIT SHM nor XF86DGA will play with DMA method (1) -- you must do
a user-space copy.

Method (2) can work with both MIT SHM and XF86DGA -- but then its
subject to wonderful interactions due to the device->device mappings.
It gets architecture specific -- the standard methods of getting
user-space DMA addresses don't work on memory-mapped I/O addresses.

-- Jamie

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/