Mail Archives: djgpp/1999/06/15/05:57:52
Max Breganze writes:
> Do you think it's possible doing a DMA transfer from system mem
> to video mem leaving the CPU free of doing something else in the
> meanwhile?
Disclaimer: I have never implemented this myself, so this information
is entirely hearsay. But this question used to come up very frequently
on rec.games.programmer a few years ago, so I can repeat the answer
that I heard many more knowledgeable people give to it :-)
Yes, it is possible. No, it isn't useful. This is because the PC DMA
controller was never designed for anywhere near the transfer speed
and amounts of data that a modern video game needs to deal with, and
quite simply cannot shift the data fast enough to get a nice framerate.
There is no point in freeing up your CPU to work in parallel if it
will then be left idling, just waiting for a slow DMA transfer to
complete. Plus, the DMA actually slows down the CPU execution because
it is contending for the same memory access cycles, so you don't truly
get things working in parallel. Everyone who tried this said that they
got terrible framerates, and quickly went back to a normal block copy.
Now back to my own personal experience:
Some recent, high end video cards are capable of doing bus master
operations over PCI or AGP, which means they can reach out and grab
data directly from system memory. This is most often used for 3D
accelerators, both for AGP texturing and for pulling geometry commands
directly from memory, but I believe that some cards may be able to
use it for blitting onto the screen as well. There are some functions
in the VBE/AF driver API for supporting this kind of bus master blit,
but they have never been implemented, and there is no software that
supports them. I'm not sure how useful this would be in practice,
because there are some nasty implementation issues to do with getting
the source data to be at a known physical memory location, but it
is something that I would be extremely interested to play with if only
I could get my hands on a driver that implements it. This is all
theoretical, though, because there are no such drivers, and I don't
have the specs needed to write one for any of the cards that I have
access to myself.
Shawn Hargreaves.
- Raw text -