[Mesa-dev] [PATCH] glx: block attempt to swapbuffer on pixmap. (v2)
Michel Dänzer
michel at daenzer.net
Wed Dec 7 02:45:29 PST 2011
On Mit, 2011-12-07 at 10:24 +0000, Dave Airlie wrote:
> From: Dave Airlie <airlied at redhat.com>
>
> This keeps track of the creation process and stores a drawable type,
> it then blocks DRI2 from getting called if the drawable is a pixmap.
>
> v2: check if we have a GLX drawable, which means we aren't a pbuffer,
> avoid doing flush at all since its meant to be a no-op.
>
> Suggested by Michel Dänzer <michel at daenzer.net>
> Signed-off-by: Dave Airlie <airlied at redhat.com>
[...]
> diff --git a/src/glx/glxcmds.c b/src/glx/glxcmds.c
> index c8ec9c2..634f0c5 100644
> --- a/src/glx/glxcmds.c
> +++ b/src/glx/glxcmds.c
> @@ -796,6 +797,11 @@ glXSwapBuffers(Display * dpy, GLXDrawable drawable)
> #if defined(GLX_DIRECT_RENDERING) && !defined(GLX_USE_APPLEGL)
> {
> __GLXDRIdrawable *pdraw = GetGLXDRIDrawable(dpy, drawable);
> + struct glx_drawable *glx_draw = GetGLXDrawable(dpy, drawable);
> +
> + /* GLX specifies a swapbuffer on a Pixmap to be a no-op. */
> + if (glx_draw && glx_draw->drawableType == GLX_PIXMAP_BIT)
> + return;
>
> if (pdraw != NULL) {
> if (gc && drawable == gc->currentDrawable) {
I think __glXSwapBuffersMscOML needs similar treatment:
glXSwapBuffersMscOML is a no-op and will always return 0 if the
specified drawable was created with a non-double-buffered
GLXFBConfig or if the specified drawable is a GLXPixmap.
Looks good otherwise, thanks!
--
Earthling Michel Dänzer | http://www.amd.com
Libre software enthusiast | Debian, X and DRI developer
More information about the mesa-dev
mailing list