From d1bf75f155f87d3a14d647316a0ba1f40d3957a6 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 1 Jun 2015 08:56:43 +0000 Subject: [PATCH] sna: Compilation fixes for stable distros Signed-off-by: Chris Wilson --- src/sna/kgem.c | 3 ++- src/sna/sna_display.c | 16 ++++++++++++++-- src/sna/sna_dri2.c | 28 +++++++++++++++++----------- 3 files changed, 33 insertions(+), 14 deletions(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index c3b848df..0d21f318 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -140,6 +140,7 @@ search_snoop_cache(struct kgem *kgem, unsigned int num_pages, unsigned flags); #define LOCAL_I915_PARAM_HAS_WT 27 #define LOCAL_I915_PARAM_MMAP_VERSION 30 +#define LOCAL_I915_EXEC_BLT (2<<0) #define LOCAL_I915_EXEC_IS_PINNED (1<<10) #define LOCAL_I915_EXEC_NO_RELOC (1<<11) #define LOCAL_I915_EXEC_HANDLE_LUT (1<<12) @@ -1399,7 +1400,7 @@ static bool test_can_blt_y(struct kgem *kgem) memset(&execbuf, 0, sizeof(execbuf)); execbuf.buffers_ptr = (uintptr_t)&object; execbuf.buffer_count = 1; - execbuf.flags = I915_EXEC_BLT; + execbuf.flags = LOCAL_I915_EXEC_BLT; ret = do_ioctl(kgem->fd, DRM_IOCTL_I915_GEM_EXECBUFFER2, diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index 6ef07a97..b3131000 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -5216,11 +5216,23 @@ static inline void sigio_unblock(int was_blocked) } #endif +static void enable_fb_access(ScrnInfoPtr scrn, int state) +{ + scrn->EnableDisableFBAccess( +#ifdef XF86_HAS_SCRN_CONV + scrn, +#else + scrn->scrnIndex, +#endif + state); +} + + static void __restore_swcursor(ScrnInfoPtr scrn) { DBG(("%s: attempting to restore SW cursor\n", __FUNCTION__)); - scrn->EnableDisableFBAccess(scrn, FALSE); - scrn->EnableDisableFBAccess(scrn, TRUE); + enable_fb_access(scrn, FALSE); + enable_fb_access(scrn, TRUE); RemoveBlockAndWakeupHandlers((BlockHandlerProcPtr)__restore_swcursor, (WakeupHandlerProcPtr)NoopDDA, diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index 3611270c..cc01ba63 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -155,6 +155,20 @@ struct sna_dri2_event { static void sna_dri2_flip_event(struct sna_dri2_event *flip); inline static DRI2BufferPtr dri2_window_get_front(WindowPtr win); +static struct kgem_bo * +__sna_dri2_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region, + DRI2BufferPtr src, DRI2BufferPtr dst, + unsigned flags); + +inline static void +__sna_dri2_copy_event(struct sna_dri2_event *info, unsigned flags) +{ + info->bo = __sna_dri2_copy_region(info->sna, info->draw, NULL, + info->back, info->front, + flags); + info->front->flags = info->back->flags; +} + static int front_pitch(DrawablePtr draw) { DRI2BufferPtr buffer; @@ -314,6 +328,7 @@ inline static DRI2BufferPtr dri2_window_get_front(WindowPtr win) } #else inline static void *dri2_window_get_front(WindowPtr win) { return NULL; } +#define APPLY_DAMAGE 0 #endif #if DRI2INFOREC_VERSION < 6 @@ -537,7 +552,7 @@ sna_dri2_create_buffer(DrawablePtr draw, if (draw->type != DRAWABLE_PIXMAP) buffer = dri2_window_get_front((WindowPtr)draw); if (buffer == NULL) - buffer = sna_pixmap_get_buffer(pixmap); + buffer = (DRI2Buffer2Ptr)sna_pixmap_get_buffer(pixmap); if (buffer) { private = get_private(buffer); @@ -1231,15 +1246,6 @@ __sna_dri2_copy_region(struct sna *sna, DrawablePtr draw, RegionPtr region, return bo; } -inline static void -__sna_dri2_copy_event(struct sna_dri2_event *info, unsigned flags) -{ - info->bo = __sna_dri2_copy_region(info->sna, info->draw, NULL, - info->back, info->front, - flags); - info->front->flags = info->back->flags; -} - static void sna_dri2_copy_region(DrawablePtr draw, RegionPtr region, @@ -1727,7 +1733,7 @@ can_flip(struct sna * sna, if (sna_pixmap_get_buffer(pixmap) != front) { DBG(("%s: no, DRI2 drawable is no longer attached (old name=%d, new name=%d) to pixmap=%ld\n", __FUNCTION__, front->name, - sna_pixmap_get_buffer(pixmap) ? ((DRI2BufferPtr)sna_pixmap_get_buffer(pixmap))->name : 0, + sna_pixmap_get_buffer(pixmap) ? sna_pixmap_get_buffer(pixmap)->name : 0, pixmap->drawable.serialNumber)); return false; }