[PATCH] GLX/DRI2: Fix build against Mesa 7.7.
Kristian Høgsberg
krh at bitplanet.net
Tue Mar 23 06:56:41 PDT 2010
2010/3/22 Michel Dänzer <michel at daenzer.net>:
> From: Michel Dänzer <daenzer at vmware.com>
>
> Seems to work as well...
>
> Signed-off-by: Michel Dänzer <daenzer at vmware.com>
> ---
> configure.ac | 2 +-
> glx/glxdri2.c | 9 +++++----
> 2 files changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index d379b3a..3aeedd3 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -777,7 +777,7 @@ REQUIRED_LIBS="xfont xau [pixman-1 >= 0.15.20]"
> dnl List of libraries that require a specific version
> LIBAPPLEWM="applewm >= 1.4"
> LIBDMX="dmx >= 1.0.99.1"
> -LIBDRI="dri >= 7.8.0"
> +LIBDRI="dri >= 7.7.0"
> LIBDRM="libdrm >= 2.3.0"
> LIBGL="gl >= 7.1.0"
> LIBXEXT="xext >= 1.0.99.4"
> diff --git a/glx/glxdri2.c b/glx/glxdri2.c
> index edd29b0..863bd8a 100644
> --- a/glx/glxdri2.c
> +++ b/glx/glxdri2.c
> @@ -213,19 +213,20 @@ __glXdriSwapEvent(ClientPtr client, void *data, int type, CARD64 ust,
> static GLboolean
> __glXDRIdrawableSwapBuffers(ClientPtr client, __GLXdrawable *drawable)
> {
> + CARD64 unused;
> +#if __DRI2_FLUSH_VERSION >= 2
> __GLXDRIdrawable *priv = (__GLXDRIdrawable *) drawable;
> __GLXDRIscreen *screen = priv->screen;
> - CARD64 unused;
>
> -#if __DRI2_FLUSH_VERSION >= 3
> if (screen->flush) {
> +#if __DRI2_FLUSH_VERSION >= 3
> (*screen->flush->flush)(priv->driDrawable);
> (*screen->flush->invalidate)(priv->driDrawable);
> - }
> #else
> - if (screen->flush)
> (*screen->flush->flushInvalidate)(priv->driDrawable);
> #endif
> + }
> +#endif /* __DRI2_FLUSH_VERSION >= 2 */
>
> if (DRI2SwapBuffers(client, drawable->pDraw, 0, 0, 0, &unused,
> __glXdriSwapEvent, drawable->pDraw) != Success)
No, we can only use DRI2SwapBuffers if we can invalidate the drawable
buffers. The fallback for 7.7 is to just flush and use
DRi2CopyRegion. And the flushInvalidate case should just be dropped
it was only on git master between 7.7 and 7.8 for a while, never
released.
Kristian
More information about the xorg-devel
mailing list