Video card with DMA support

Hello,

I?m using SDL_Overlay surfaces in Windows ( SDL v1.2.5 ) because I need to
display a lot of images ( up to 400 fps)
with the lowest CPU resources . My problem is that I need read my overlay
surfaces
sometimes because I need to realize the compresion of the images allocated
in the surfaces. I observed that
the videomemory is very slow in comparasion to the system memory in mode
read . Because I need also a fast access in read mode to the buffers, I
allocated the Overlay surfaces in SYSTEM memory. For this, I modified the
SDL source
code ( the file \src\video\windx5\SDL_dx5yuv.c) in the function that create
the surface CreateYUVSurface() :

#ifdef USE_DIRECTX_OVERLAY
ddsd.ddsCaps.dwCaps = (DDSCAPS_OVERLAY|DDSCAPS_SYSTEMMEMORY);
#else
ddsd.ddsCaps.dwCaps = (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY);
#endif

in sustitution of DDSCAPS_VIDEOMEMORY.

Now I have a fast access to the buffers but my problem it?s that with this
modification, the
SDL_DisplayYUVOverlay(lpSDLOverlay,&dst) function spend a
lot of CPU resources.

I read that some video cards support DMA and my question is :
Do you known any video card that support DMA for reading from system memory
without spend CPU resources ?
or do you know another form to realize the process of display with the
lowest CPU resources and simultaneously
fast read access to the buffers.

Thanks you very much !!!

Best Regards,

Jorge.

On 29-Apr-2003, jorge Scati wrote:>

I read that some video cards support DMA and my question is :
Do you known any video card that support DMA for reading from system memory
without spend CPU resources ?
or do you know another form to realize the process of display with the
lowest CPU resources and simultaneously
fast read access to the buffers.

Well, if the “fast read access” you’re talking about is reading from video
memory, this is impossible. Its always slow.

Also, anything PCI and AGP the dma question wont apply to. All PCI/AGP cards
can initate their own memory transfers, and all of them do. (PCI/AGP cards have
their own personal dma channel all to themselves. Its not shared or limited in
number like isa dma is.)

Also, when you make software yuv buffers, yuv is converted to rgb in software.
That eats cpu like mad, and always will. I suggest, if you have to read the
yuv overlay, make two. A hardware one you blit, a software one you read from,
however I am not sure if SDL can create yuv surfaces based on the
SDL_SWSURFACE and SDL_HWSURFACE surface option mnemonics.–
Patrick “Diablo-D3” McFarland || unknown at panax.com
"Computer games don’t affect kids; I mean if Pac-Man affected us as kids, we’d
all be running around in darkened rooms, munching magic pills and listening to
repetitive electronic music." – Kristian Wilson, Nintendo, Inc, 1989

[…]

Also, anything PCI and AGP the dma question wont apply to. All
PCI/AGP cards can initate their own memory transfers, and all of
them do. (PCI/AGP cards have their own personal dma channel all to
themselves. Its not shared or limited in number like isa dma is.)

Well, except that we have some broken platforms and/or drivers where
DMA can’t be used at all, or only with OpenGL. That might be worth
keeping in mind, if portability is a priority.

//David Olofson - Programmer, Composer, Open Source Advocate

.- The Return of Audiality! --------------------------------.
| Free/Open Source Audio Engine for use in Games or Studio. |
| RT and off-line synth. Scripting. Sample accurate timing. |
`-----------------------------------> http://audiality.org -’
http://olofson.nethttp://www.reologica.se —On Tuesday 29 April 2003 12.15, Patrick McFarland wrote:

jorge Scati wrote:

Hello,

I?m using SDL_Overlay surfaces in Windows ( SDL v1.2.5 ) because I
need to display a lot of images ( up to 400 fps)
with the lowest CPU resources . My problem is that I need read my
overlay surfaces
sometimes because I need to realize the compresion of the images
allocated in the surfaces. I observed that
the videomemory is very slow in comparasion to the system memory in
mode read . Because I need also a fast access in read mode to the
buffers, I allocated the Overlay surfaces in SYSTEM memory. For this,
I modified the SDL source
code ( the file \src\video\windx5\SDL_dx5yuv.c) in the function that
create the surface CreateYUVSurface() :

#ifdef USE_DIRECTX_OVERLAY
ddsd.ddsCaps.dwCaps = (DDSCAPS_OVERLAY|DDSCAPS_SYSTEMMEMORY);
#else
ddsd.ddsCaps.dwCaps = (DDSCAPS_OFFSCREENPLAIN|DDSCAPS_SYSTEMMEMORY);
#endif

in sustitution of DDSCAPS_VIDEOMEMORY.

Now I have a fast access to the buffers but my problem it?s that with
this modification, the SDL_DisplayYUVOverlay(lpSDLOverlay,&dst)
function spend a
lot of CPU resources.
I read that some video cards support DMA and my question is :
Do you known any video card that support DMA for reading from system
memory without spend CPU resources ?

DMA doesn’t use any cpu resources, by definition. So your question
doesn’t make much sense to me.
For a given bus speed (PCI, agp, agp 2x, agp4x…) most cards will
behave the same speed-wise when they use DMA. So there is really no
"better" card.

I think that by changing the surface from video memory to system memory,
you effectively disabled dma. Which explains that it uses up lots of cpu.

or do you know another form to realize the process of display with
the lowest CPU resources and simultaneously
fast read access to the buffers.

Well, you should access your surface before sending it to the card,
that is before sending it as an overlay.
The rule of thumb is always to minimize communications on the bus.

Stephane