I am writing an application that needs to read the contents of the video
screen very fast (30-40 times per second would be great). XGetImage,
Composite, and XRender are all way too slow.

I think that reading the desktop directly from video memory would be the
fastest possible way to do that, but how is it done? I've read postings
and articles that talk about using mmap() to get the video display mapped
into user space, but everything I've read is very short on details.

How do I get direct read access to the X11 desktop? Source code examples
for getting it setup would be greatly appreciated.