From fac6845820e49dbbea2a625b7bb745d8f9159b56 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Fri, 18 Jul 2014 07:14:19 +0100 Subject: [PATCH] sna/dri2: Protect compsiteext.h include with build check We shouldn't include calls to the composite extension if it has not been built. Reported-by: Ben Widawsky Signed-off-by: Chris Wilson --- src/sna/sna_dri2.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index 286be66..69496c3 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -48,8 +48,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include #include -#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,12,99,901,0) +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,12,99,901,0) && defined(COMPOSITE) #include +#define CHECK_FOR_COMPOSITOR #endif #define DBG_CAN_FLIP 1 @@ -2425,7 +2426,7 @@ get_current_msc(struct sna *sna, DrawablePtr draw, xf86CrtcPtr crtc) return draw_current_msc(draw, crtc, ret); } -#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,12,99,901,0) +#if defined(CHECK_FOR_COMPOSITOR) static Bool find(pointer value, XID id, pointer cdata) { return TRUE; @@ -2450,7 +2451,7 @@ static int use_triple_buffer(struct sna *sna, ClientPtr client, bool async) return FLIP_THROTTLE; } -#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,12,99,901,0) +#if defined(CHECK_FOR_COMPOSITOR) /* Hack: Disable triple buffering for compositors */ { struct sna_client *priv = sna_client(client); -- 2.7.4