DGA replacements (was Re: [forum] XFree86 5.0 TODO)

Billy Biggs forum@XFree86.Org
Tue, 25 Mar 2003 13:59:01 -0600


Mark Vojkovich (mvojkovi@XFree86.Org):

> I believe direct framebuffer access by clients to be unsafe.  Part of
> this is because it can never have exclusive access to this hardware.
> The server can VT switch away and you'll be writing over the
> framebuffer of another server.

  This is true in the case of the DGA implementation, but something like
DRI could be used to avoid this.

> At least in the case of NVIDIA hardware, there is critical state
> stored in the framebuffer and you can hang the system.  Additionally,
> there are implementation issues on various operating systems requiring
> clients to have root permissions.  While that can probably be worked
> around at the OS level, it doesn't change that fact that there are
> problems with arbitration of this shared resource that become
> difficult to solve when you are relying on any-old-client to work with
> it.  OpenGL direct rendering allows clients to touch the hardware
> directly - sortof.  There is an arbitration architecture in place that
> is outside of the client's view and the applications itself doesn't
> see this hardware.  It goes through a trusted library.  OpenGL apps
> themselves aren't given pointers to hardware.  So there's a big
> difference between OpenGL and DGA.

  Some of the video projects have been working on direct rendering for
video applications (vidix, *_vid drivers, etc).  The APIs are through
kernel modules which control access, allowing locking of the
framebuffer, and can negotiate DMA transfers (only for radeon so far?).
These applications can definitely be sped up if they can write directly
to the framebuffer, the mplayer mailing lists can speak to this.  In my
case, I read video from a capture card and write to a system buffer
which gets uploaded by XVideo, but if I could process during my write to
video RAM, my speed would be greatly improved (doing two things at once,
better cache usage, etc).  I can provide numbers if you like, comparing
with the mga_vid kernel module which provides an 'unsafe' pointer to
video memory. :)

  Currently, this direct rendering stuff is in conflict with X, and bad
things can happen.  I agree that the DGA extension should go, but I
strongly believe that functionality could be safely added within the DRI
infrastructure to allow clients to write directly to video RAM for
cards where DMA transfers aren't available or don't make sense.

-- 
Billy Biggs
vektor@dumbterm.net