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 <ben@bwidawsk.net>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2014-07-18 07:14:19 +01:00
parent 923e098f5f
commit fac6845820
1 changed files with 4 additions and 3 deletions

View File

@ -48,8 +48,9 @@ USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <xf86drm.h>
#include <i915_drm.h>
#include <dri2.h>
#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 <compositeext.h>
#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);