Message-ID: <8D53104ECD0CD211AF4000A0C9D60AE30143A403@probe-2.acclaim-euro.net> From: Shawn Hargreaves To: djgpp AT delorie DOT com Subject: Re: mem to mem DMA transfer Date: Tue, 15 Jun 1999 10:50:56 +0100 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.0.1460.8) Content-Type: text/plain Reply-To: djgpp AT delorie DOT com 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.