From 33b92471a7b97c4f3ebf722e8551f37e167a445c Mon Sep 17 00:00:00 2001 From: Chia-I Wu Date: Thu, 25 Feb 2010 21:16:56 +0800 Subject: st/egl: Reduce validation round-trips in ximage backend. ximage_surface_validate is called several times per frame. This commit adds the client and server stamps to reduce the round-trips to the server. The idea is to bump the server stamp when flush_frontbuffer or swap_buffers is called, and to skip the round-trip when the client stamp is equal to the server stamp. This makes sure the client APIs get the new buffers when a new frame is started while skipping all round-trips during the drawing. To make this work, egl_g3d_validate_context is no longer called after swap_buffers. --- src/gallium/state_trackers/egl/common/egl_g3d.c | 20 +------------------- 1 file changed, 1 insertion(+), 19 deletions(-) (limited to 'src/gallium/state_trackers/egl/common/egl_g3d.c') diff --git a/src/gallium/state_trackers/egl/common/egl_g3d.c b/src/gallium/state_trackers/egl/common/egl_g3d.c index 13a7487ea8..086e644e21 100644 --- a/src/gallium/state_trackers/egl/common/egl_g3d.c +++ b/src/gallium/state_trackers/egl/common/egl_g3d.c @@ -931,25 +931,7 @@ egl_g3d_swap_buffers(_EGLDriver *drv, _EGLDisplay *dpy, _EGLSurface *surf) if (gctx) gctx->stapi->st_notify_swapbuffers(gctx->draw.st_fb); - /* - * We drew on the back buffer, unless there was no back buffer. - * In that case, we drew on the front buffer. Either case, we call - * swap_buffers. - */ - if (!gsurf->native->swap_buffers(gsurf->native)) - return EGL_FALSE; - - if (gctx) { - struct egl_g3d_config *gconf = egl_g3d_config(gsurf->base.Config); - - /* force validation if the swap method is not copy */ - if (gconf->native->mode.swapMethod != GLX_SWAP_COPY_OML) { - gctx->force_validate = EGL_TRUE; - egl_g3d_validate_context(dpy, &gctx->base); - } - } - - return EGL_TRUE; + return gsurf->native->swap_buffers(gsurf->native); } /** -- cgit v1.2.3