XFlush

Hi!
I got a problem with the file:
SDL-1.2.8/src/video/x11/SDL_x11image.c

in X11_MITSHMUpdate i changed the code to:
Uint32 then, now, first=0,frames=0;

for ( i=0; i<numrects; ++i ) {
	if ( rects[i].w == 0 || rects[i].h == 0 ) { /* Clipped? */
		continue;
	}
	XShmPutImage(GFX_Display, SDL_Window, SDL_GC, SDL_Ximage,
			rects[i].x, rects[i].y,
			rects[i].x, rects[i].y, rects[i].w, rects[i].h,
								False);
}
then = SDL_GetTicks();
if ( SDL_VideoSurface->flags & SDL_ASYNCBLIT ) {
	XFlush(GFX_Display);
	blit_queued = 1;
} else {		
	XSync(GFX_Display, False);
}
now = SDL_GetTicks();
fprintf(stderr,",,,,%i ms

%2.2f\n",(now-then),(double)1000*frames/(double)(now-first));

and i get as output:
,74 ms 0.00

well i know the code is crappy, but the output is always about 80 ms
seconds… i have a athlon xp 1700 500 mb ram nvidia geforce 2 mx 4.
Opengl works very well but somehow sdl is very slow, does someone know why?
thx!
Fernando Benites–
DSL Komplett von GMX +++ Superg?nstig und stressfrei einsteigen!
AKTION “Kein Einrichtungspreis” nutzen: http://www.gmx.net/de/go/dsl

Fernando Benites wrote:

Hi!
I got a problem with the file:
SDL-1.2.8/src/video/x11/SDL_x11image.c

in X11_MITSHMUpdate i changed the code to:
Uint32 then, now, first=0,frames=0;

for ( i=0; i<numrects; ++i ) {
if ( rects[i].w == 0 || rects[i].h == 0 ) { /* Clipped? /
continue;
}
XShmPutImage(GFX_Display, SDL_Window, SDL_GC, SDL_Ximage,
rects[i].x, rects[i].y,
rects[i].x, rects[i].y, rects[i].w, rects[i].h,
False);
}
then = SDL_GetTicks();
if ( SDL_VideoSurface->flags & SDL_ASYNCBLIT ) {
XFlush(GFX_Display);
blit_queued = 1;
} else {
XSync(GFX_Display, False);
}
now = SDL_GetTicks();
fprintf(stderr,",%i ms
%2.2f\n",(now-then),(double)1000
frames/(double)(now-first));

and i get as output:
,74 ms 0.00

well i know the code is crappy, but the output is always about 80 ms
seconds… i have a athlon xp 1700 500 mb ram nvidia geforce 2 mx 4.
Opengl works very well but somehow sdl is very slow, does someone know why?

So you say that’s because of XFlush ? That would mean that you are using
ASYNCBLIT ?

Stephane

Fernando Benites wrote:

then = SDL_GetTicks();
if ( SDL_VideoSurface->flags & SDL_ASYNCBLIT ) {
XFlush(GFX_Display);
blit_queued = 1;
} else {
XSync(GFX_Display, False);
}
So you say that’s because of XFlush ? That would mean that you are using
ASYNCBLIT ?

Stephane

It doesnt matter, XSync is also so slow.
Fernando Benites–
Lassen Sie Ihren Gedanken freien Lauf… z.B. per FreeSMS
GMX bietet bis zu 100 FreeSMS/Monat: http://www.gmx.net/de/go/mail

Fernando Benites wrote:

Fernando Benites wrote:

then = SDL_GetTicks();
if ( SDL_VideoSurface->flags & SDL_ASYNCBLIT ) {
XFlush(GFX_Display);
blit_queued = 1;
} else {
XSync(GFX_Display, False);
}

So you say that’s because of XFlush ? That would mean that you are using
ASYNCBLIT ?

Stephane

It doesnt matter, XSync is also so slow.

Ok, does this happen with any SDL program or one in particular ? If it
is with a particular program, can you send a small source code ?

Also, what X version are you using (please send the output of xdpyinfo)
? On which distribution ?

Stephane

WEll… i tried to update my X… and now it isnt working…
I will reinstall, it will take some days so i can send a better diagonase…
Fernando Benites–
DSL Komplett von GMX +++ Superg?nstig und stressfrei einsteigen!
AKTION “Kein Einrichtungspreis” nutzen: http://www.gmx.net/de/go/dsl