Blit H/W acceleration

hi all,

I am sorry if I am repeating this question but i cann’t get it straight after having a look at the archive.

I am interested to know that for hardware accelerated blitting (SDL_BlitSurface() ), should the src and dst surfaces be also in video mem (SDL_HWSURFACE) for best performance. if i have SDL_SWSURFACE won’t their be a performance overhead of system mem to video mem transfer in each blit. keeping in mind that both the surfaces are updated/written into very frquently. and there is no reading from niether of them.

currently i’ve SDL_SWSURFACE and i’m donot think that the blitting is hardware accelerated. when i analyzed the performance of my program with Intel VTune, it showed largest clocks per instruction value in case of SDL_Blit and SDL_FillRect (which i guess is called from within SDL_Blit). btw, the system specs are:

  • Intel P4 1.6GHz
  • 256 MB RDRAM
  • nVidia GeForce 2 MX200
  • RH Linux 7.3

so i believe that much time is consumed blitting is done in system mem. btw, i’ve also enabled RLE for the color keyed surface. please correct me if i’m wrong.

about direct hardware access for improving performance, i also want to know that how do i enable the DGA driver. can anyone suggest me a howto or tutorial? please, i cann’t find good stuff through GOOGLE.
and i tried the dga utility it gave this output

  • bank size 66912256
  • Framebuffer write speed: 142528K/s
  • Framebuffer read speed: 8231K/s

I hope to hear a good advice soon.

regards,
sandra

hi all,

I am sorry if I am repeating this question but i cann’t get it straight
after having a look at the archive.

I am interested to know that for hardware accelerated blitting
(SDL_BlitSurface() ), should the src and dst surfaces be also in video mem
(SDL_HWSURFACE) for best performance. if i have SDL_SWSURFACE won’t their
be a performance overhead of system mem to video mem transfer in each
blit. keeping in mind that both the surfaces are updated/written into very
frquently. and there is no reading from niether of them. >

Go to the SDL sources and run testvidinfo. Under linux you wont get
accelerated blits in any case unless you use dga (according to FAQ) or
maybe OpenGL in a true 3D accel card.
As far as I remember, David Olofson explained here (several times I think)
that unaccelerated SW to HW blits are slow, so, its recomended to have SW
surfaces unless you have SW to HW accel.On Fri, 23 Aug 2002, Sandra wrote:


Roger D. Vargas | El sistema se apagara en 5 segundos.
ICQ: 117641572 | Salvese el que pueda!
Linux User: 180787 |

I am interested to know that for hardware accelerated blitting
(SDL_BlitSurface() ), should the src and dst surfaces be also in video
mem (SDL_HWSURFACE) for best performance. if i have SDL_SWSURFACE
won’t their be a performance overhead of system mem to video mem
transfer in each blit. keeping in mind that both the surfaces are
updated/written into very frquently. and there is no reading from
niether of them.

If everything is in hardware surfaces, surface to surface blitting is
fast, but touching those surfaces (the “pixels” field) is SLOW.

Going to the screen (usually) can take advantage of hardware-accelerated
blits, based on your platform/drivers, etc.

–ryan.

In addition to the suggestions here, check out the FAQ:
http://www.libsdl.org/faq.php?action=listentries&category=2

See ya,
-Sam Lantinga, Software Engineer, Blizzard Entertainment

I am interested to know that for hardware accelerated blitting
(SDL_BlitSurface() ), should the src and dst surfaces be also in video
mem (SDL_HWSURFACE) for best performance. if i have SDL_SWSURFACE
won’t their be a performance overhead of system mem to video mem
transfer in each blit. keeping in mind that both the surfaces are
updated/written into very frquently. and there is no reading from
niether of them.

If the source surface is updated/written to frequently, you do not want
your backbuffer in video card RAM, but rather in system RAM. Writes to
main system memory are between 20-50X faster than writes to even the
fastest of AGP boards. The protocol overhead of the bus (plus the lack of
speed compared to main system memory) is MUCH larger than it is to system
memory, plus you don’t have the L1/L2 caches giving you any speed
advantages.

about direct hardware access for improving performance, i also want to
know that how do i enable the DGA driver. can anyone suggest me a
howto or tutorial? please, i cann’t find good stuff through GOOGLE.
and i tried the dga utility it gave this output

I don’t know what a “DGA” driver is, but IIRC, SDL will use the fastest
native blit. Also, when you do a blit from system memory to AGP, the
transfer is not processor assisted (it’s done by hardware) in a burst
fashion.

FWIW, My emulator uses an in memory backbuffer. I’m not blitting entire
screens, but rather I’m blitting only deltas that change from frame to
frame (drops system requirements, runs faster, etc…). But even then, the
difference is 30-50% better with a software backbuffer.

–>Neil-------------------------------------------------------------------------------
Neil Bradley What are burger lovers saying
Synthcom Systems, Inc. about the new BK Back Porch Griller?
ICQ #29402898 “It tastes like it came off the back porch.” - Me