summaryrefslogtreecommitdiff
path: root/src/sna/sna.h
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-07-12 20:32:14 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2012-07-12 22:13:50 +0100
commitfd15ce65ab8ce5cf571e37daa7db1ee245616cd4 (patch)
treef11e12dfc92451016b14b82fe4b87bd18129d645 /src/sna/sna.h
parent22be9988b933f33fc5247a9abc3b00a7f2e4a202 (diff)
sna: Fix build without DRI2
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna.h')
-rw-r--r--src/sna/sna.h14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h
index d4f6dec2..abb010ce 100644
--- a/src/sna/sna.h
+++ b/src/sna/sna.h
@@ -58,11 +58,13 @@ SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#include <xf86drmMode.h>
#include "../compat-api.h"
-#define _XF86DRI_SERVER_
#include <drm.h>
-#include <dri2.h>
#include <i915_drm.h>
+#ifdef HAVE_DRI2_H
+#include <dri2.h>
+#endif
+
#if HAVE_UDEV
#include <libudev.h>
#endif
@@ -338,11 +340,19 @@ extern xf86CrtcPtr sna_covering_crtc(ScrnInfoPtr scrn,
extern bool sna_wait_for_scanline(struct sna *sna, PixmapPtr pixmap,
xf86CrtcPtr crtc, const BoxRec *clip);
+#if HAVE_DRI2_H
Bool sna_dri_open(struct sna *sna, ScreenPtr pScreen);
void sna_dri_page_flip_handler(struct sna *sna, struct drm_event_vblank *event);
void sna_dri_vblank_handler(struct sna *sna, struct drm_event_vblank *event);
void sna_dri_destroy_window(WindowPtr win);
void sna_dri_close(struct sna *sna, ScreenPtr pScreen);
+#else
+static inline bool sna_dri_open(struct sna *sna, ScreenPtr pScreen) { return false; }
+static inline void sna_dri_page_flip_handler(struct sna *sna, struct drm_event_vblank *event) { }
+static inline void sna_dri_vblank_handler(struct sna *sna, struct drm_event_vblank *event) { }
+static inline void sna_dri_destroy_window(WindowPtr win) { }
+static inline void sna_dri_close(struct sna *sna, ScreenPtr pScreen) { }
+#endif
extern bool sna_crtc_on(xf86CrtcPtr crtc);
int sna_crtc_to_pipe(xf86CrtcPtr crtc);