Direct video memory access under X

Direct video memory access under X

Post by Marc SCHAEF » Mon, 21 Apr 1997 04:00:00



Hi,

is it possible, under X, supposing you run a local X server and
clients, to access some part of the video memory directly or
more or less directly ?  Of course, this won't work with
a distant X server that way.

The idea would be to use display hardware to display into a
X window.

Also, what would be the technical problems if someone resizes, or
moves the window ?  Will my program be informed of that, before
or after the move (knowing as a user how X works in general,
I don't think you can lock windows).

Has someone already implemented this, and if yes, how does it
compare in term of speed to direct video control, and SVGA
library ?

PS: I am absolutely wanting to trade *some* speed for X
    functionnality, this is not to (re-)start a flame about
    X slowlyness. I personnally find X absolutely adequate,
    even more if the above is more-or-less possible.

PS/2: I have worked with the Parallax board in a HP/UX environment.
      They seem to use a special X server to do the real-time
      video incrustation, so it of course can be done that way,
      but I would prefer a standard way, even if it is a little
      slower.

Thank you for any help on the subject.

 
 
 

Direct video memory access under X

Post by Wouter Scholte » Thu, 24 Apr 1997 04:00:00



> Hi,

> is it possible, under X, supposing you run a local X server and
> clients, to access some part of the video memory directly or
> more or less directly ?  Of course, this won't work with
> a distant X server that way.

Yes, DGA and Shm (shared memory)
Shm works indirectly (you tell the X server to put an image into
 the screen at given location). With DGA you can write to screen memory
as in SVGAlib.

Quote:> The idea would be to use display hardware to display into a
> X window.

Should work with DGA (full screen).

Quote:> Also, what would be the technical problems if someone resizes, or
> moves the window ?  Will my program be informed of that, before
> or after the move (knowing as a user how X works in general,
> I don't think you can lock windows).

Shm: you can lock the window size as you can with any application (in
the WM hints). DGA: the screen size must be selected by the program and
user resizes are not possible (no CTRL+ALT+ -/+).

Quote:> Has someone already implemented this, and if yes, how does it
> compare in term of speed to direct video control, and SVGA
> library ?

Shm: the requests themselves are slow (so forget about shm-putting a lot
of little areas, just do a big one that encloses all)
DGA is about as fast as SVGAlib except for colourmap changes (entire
colourmap must be reinstalled). If that's what you need too, then Shm is
faster than DGA (as I found out with my defender game).

Quote:> PS: I am absolutely wanting to trade *some* speed for X
>     functionnality, this is not to (re-)start a flame about
>     X slowlyness. I personnally find X absolutely adequate,
>     even more if the above is more-or-less possible.

DGA is not as versatile as SVGAlib as you can't switch colour depth, and
for colourmap changes you have to reinstall the entire colourmap.

Quote:> PS/2: I have worked with the Parallax board in a HP/UX environment.
>       They seem to use a special X server to do the real-time
>       video incrustation, so it of course can be done that way,
>       but I would prefer a standard way, even if it is a little
>       slower.

> Thank you for any help on the subject.

Wouter

 
 
 

1. Direct access to video memory under X

Is it possible to get direct hardware access to the VGA card? Probably I don't
need direct hardware access but rather I need to read and write directly into
the gfx memory. Any ideas how I could achieve this when X is running? I don't
mind when windows are overwritten in the course because they could be
refreshed and I would want to save the content anyway.

--
Gerhard Gruber

Fr jedes menschliche Problem gibt es immer eine einfache L?sung:
Klar, einleuchtend und falsch. (Henry Louis Mencken)

2. The need for covergence

3. Direct access to video memory

4. SuSE 6.4 firewall & ntp

5. Text mode character output through direct accessing Video RAM?

6. How do Virtual Hosting services restrict access to ftp only?

7. Direct VGA video adapter access ?

8. SoundBlaster MIDI port ---> Poof!

9. HELP: Direct Video Mem Access under X11R5 ???

10. Direct video memory acces under X - is it possible?

11. Direct access to the video card

12. Need help!!! direct memory access

13. direct memory access, gettimeofday: any GURUS out there?