Accelerated Blitting under X11 for GeForce 3?

Hi all,

I’m toying around with SDL 1.2.5 under Linux x86, XFree86 4.2.0 and a
GeForce 3 card (NVidia driver 3121). Mostly I’m blitting 8 bit deep
Surfaces around. Having no problems with my GFX-card in any kind of game
(RT2, Heretic, F.A.K.K 2, HoMM3), I honestly thought that everything was
accelerated. However, as I was blitting more and more data (at
800x600/16bpp) the programme was becoming slower and slower, so I finlly
checked the Driver name and acceration status: X11 and nothing
accelrated.
So I

  • did have a look at the recent SDL Mailing archive (January and
    december) - no clues found
  • Had a look at the Linux faq at libsdl.org. The tip there was to
    enable DGA, which I did and the game crashed after seemingly having
    problems with double buffering. Only power reset helped :frowning:
  • I had a look at nvidia.com whether I would find some feature list
    regarding the Linux drivers (forums and readmes) - no luck.
  • Some googling only offered advice on how to enable DGA (which doesn’t
    apply to Suse 8.1, as DGA seems to be activated by default) and the
    XFree log says DGA is enabled
    So what can I do now? Does NVidia DGA support suck? Mustn’t I use double
    buffering in that case? Or is there any other way to enable hardware
    blitting? If not, then how do get games like RT2 or Homm3 a decent
    framerates without acceleration (I was aiming at 25 fps)?

Thanks for any hints or tips and don’t hesitate to ask, if you need
further information…

Bettina

P.S: My system is a P4 1800Mhz, 512 MB, Geforce 3, Suse Linux 8.1 (glibc
2.2.5, gcc 3.2), Kernel 2.4.19, SDL 1,2,5

Hi,

Temporary Solution (May work - Or I guess you’ve already tried
this):

Login as root, set an enviornment variable
SDL_VIDEODRIVER=dga.
Run program

More permanent solutions:

  1. SDL can use other libraries such as SVGALIB, GGI etc as
    drivers, so you can install these libraries and then recompile
    SDL with the support enabled. See SDL website www.libsdl.org for
    detailed info on this. There is an SDL tutorial - I think it
    gives some information on this.

  2. Use SDL with openGL. That way if you have installed nvidia
    driver, your code will run very fast. But you will now have to
    use openGL stuff, and usual SDL Blitting functions should be
    avoided.

Games like FAKK2 use openGL.

hth,
PallavOn 15 Jan 2003, Bettina Rathmann wrote:

Hi all,

(RT2, Heretic, F.A.K.K 2, HoMM3), I honestly thought that everything was
accelerated. However, as I was blitting more and more data (at
800x600/16bpp) the programme was becoming slower and slower, so I finlly
checked the Driver name and acceration status: X11 and nothing
accelrated.
So I

  • did have a look at the recent SDL Mailing archive (January and
    december) - no clues found

Thanks for any hints or tips and don’t hesitate to ask, if you need
further information…

Bettina

regards,
Pallav.


In case of fire, stand in the hall and shout “Fire!”
– The Kidner Report


| |
|Pallav Nawani |
|Sasken Communication Technologies Ltd. |
|Domlur, Bangalore. |
|_______________________________________________________________|

All those games are 3D games afaik, and have nothing to do with 2D blitting.
And make sure you are running the most recent, and correct nvidia drivers.On 15-Jan-2003, Bettina Rathmann wrote:

I’m toying around with SDL 1.2.5 under Linux x86, XFree86 4.2.0 and a
GeForce 3 card (NVidia driver 3121). Mostly I’m blitting 8 bit deep
Surfaces around. Having no problems with my GFX-card in any kind of game
(RT2, Heretic, F.A.K.K 2, HoMM3), I honestly thought that everything was
accelerated. However, as I was blitting more and more data (at
800x600/16bpp) the programme was becoming slower and slower, so I finlly
checked the Driver name and acceration status: X11 and nothing
accelrated.


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
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030115/8d43824c/attachment.pgp

All those games are 3D games afaik, and have nothing to do with 2D blitting.
And make sure you are running the most recent, and correct nvidia drivers.
Although nvidia claims that its drivers provide both 2d/3d acceleration,
you wont get accelerated blits. I have the latest drivers.On Wed, 15 Jan 2003, Patrick McFarland wrote:
On 15-Jan-2003, Bettina Rathmann wrote:


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

You will get accelerated blits with the latest drivers if you’re using
DGA or the XRender extension to do 2d operations.

DGA is blazingly fast and works great under the latest NVidia drivers.On Wed, 2003-01-15 at 12:54, Roger D. Vargas wrote:

Although nvidia claims that its drivers provide both 2d/3d acceleration,
you wont get accelerated blits. I have the latest drivers.

You will get accelerated blits with the latest drivers if you’re using
DGA or the XRender extension to do 2d operations.

DGA is blazingly fast and works great under the latest NVidia drivers.
DGA requires root privileges.On 15 Jan 2003, Shawn wrote:


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

That is the fault of the X architecture. Not the drivers.On Wed, 2003-01-15 at 15:22, Roger D. Vargas wrote:

On 15 Jan 2003, Shawn wrote:

You will get accelerated blits with the latest drivers if you’re using
DGA or the XRender extension to do 2d operations.

DGA is blazingly fast and works great under the latest NVidia drivers.
DGA requires root privileges.

You will get accelerated blits with the latest drivers if you’re using
DGA or the XRender extension to do 2d operations.

DGA is blazingly fast and works great under the latest NVidia drivers.
DGA requires root privileges.

That is the fault of the X architecture. Not the drivers.

Correct me if I am wrong, but itsn’t this due to the fact that
linux dosen’t allow you to access hardware directly? My
understanding is that DGA gives direct access to framebuffer, and
you can’t do this unless you have root access.

SVGALIB also requires (SUID) root access (for a brief time
only)and GGI has a component in kernel itself (KGI) to allow
direct access to video hardware.On 15 Jan 2003, Shawn wrote:

On Wed, 2003-01-15 at 15:22, Roger D. Vargas wrote:

On 15 Jan 2003, Shawn wrote:


SDL mailing list
SDL at libsdl.org
http://www.libsdl.org/mailman/listinfo/sdl

regards,
Pallav.


In case of fire, stand in the hall and shout “Fire!”
– The Kidner Report


| |
|Pallav Nawani |
|Sasken Communication Technologies Ltd. |
|Domlur, Bangalore. |
|_______________________________________________________________|

Its not X’s fault, but the kernel’s. You need access to /dev/mem (which should
always be root permissions only) to use DGA, or anything else that needs to
map video memory. (Including X itself.) What you should be asking yourself, is
why doesnt X “piggyback” DGA, and have it wrap DGA access calls so it can only
access mapped video memory via /dev/mem, instead of everything (which is a
security risk.)On 16-Jan-2003, Pallav Nawani wrote:

Correct me if I am wrong, but itsn’t this due to the fact that
linux dosen’t allow you to access hardware directly? My
understanding is that DGA gives direct access to framebuffer, and
you can’t do this unless you have root access.

SVGALIB also requires (SUID) root access (for a brief time
only)and GGI has a component in kernel itself (KGI) to allow
direct access to video hardware.


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
-------------- next part --------------
A non-text attachment was scrubbed…
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20030116/a74eb9ee/attachment.pgp

Pallav Nawani wrote:

  1. Use SDL with openGL. That way if you have installed nvidia
    driver, your code will run very fast. But you will now have to
    use openGL stuff, and usual SDL Blitting functions should be
    avoided.

i thought, the whole point of using glSDL is to map sdl blittings to gl
transparently. so one could get gl hardware support without gl knoledge.

please correct me, if i’m wrong.

clemens

I haven’t seen How glSDL works, but I guess that is the way it
should be. You can use OpenGL with SDL without using glSDL.
Using SDL for mouse/keyboard/sound etc, and OpenGL for graphics.
In that case, OpenGL will pretty much take over the video
subsystem (At least that’s what the SDL docs say).

regards,
Pallav.On Thu, 16 Jan 2003, Clemens Kirchgatterer wrote:

Pallav Nawani wrote:

  1. Use SDL with openGL. That way if you have installed nvidia
    driver, your code will run very fast. But you will now have to
    use openGL stuff, and usual SDL Blitting functions should be
    avoided.
    i thought, the whole point of using glSDL is to map sdl blittings to gl
    transparently. so one could get gl hardware support without gl knoledge.
    please correct me, if i’m wrong.

In case of fire, stand in the hall and shout “Fire!”
– The Kidner Report


| |
|Pallav Nawani |
|Sasken Communication Technologies Ltd. |
|Domlur, Bangalore. |
|_______________________________________________________________|

No quite - Railroad Tycoon and Heroes of Might and Magic are 2d
(tilebased?). The latest 2d driver from NVidia 41xx is very slow in 2d
drawing under certain circumstances and has stability issues (as I read
on the NVidia boards), so I decided to not install it. I#M using the
release before the current one, which is stable (exceotion see below)

I am not aiming for the fastest possible blitting ever - I just want to
enable hardware blitting which should speed up blitting a bit :o)

I did set the Videodriver to dga, SDL_GetVideoInfo() says hardware
acceleration is available and the game crashes, sometimes shortly after
SDL_Init() sometimes later when using SDL_Flip() and doublebuffering.
The crash is complete - only power off/ on will help.

Note that the code may not be the most brilliant piece of programming
but does run abolutely stable when not using DGA. So any idea on what to
do what be very helpful.

BTW: My OpenGL setup works perfectly fine - but it would be some work to
change everything from SDL to OpenGL and I don’t want to use OpenGL but
SDL :o)

Oh and I got this error, when my programme didn’t crash immediately after
start and when I could stop it normally:

X Error of failed request: XF86DGANoDirectVideoMode
Major opcode of failed request: 136 (XFree86-DGA)
Minor opcode of failed request: 13 (XDGASetMode)
Serial number of failed request: 13
Current serial number in output stream: 13

Thanks for all the help so far
BettinaAm Mit, 2003-01-15 um 18.31 schrieb Patrick McFarland:

On 15-Jan-2003, Bettina Rathmann wrote:

I’m toying around with SDL 1.2.5 under Linux x86, XFree86 4.2.0 and a
GeForce 3 card (NVidia driver 3121). Mostly I’m blitting 8 bit deep
Surfaces around. Having no problems with my GFX-card in any kind of game
(RT2, Heretic, F.A.K.K 2, HoMM3), I honestly thought that everything was
accelerated. However, as I was blitting more and more data (at
800x600/16bpp) the programme was becoming slower and slower, so I finlly
checked the Driver name and acceration status: X11 and nothing
accelrated.

All those games are 3D games afaik, and have nothing to do with 2D blitting.
And make sure you are running the most recent, and correct nvidia drivers.