diff options
author | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2015-08-23 17:53:52 +0000 |
---|---|---|
committer | Matthieu Herrb <matthieu@cvs.openbsd.org> | 2015-08-23 17:53:52 +0000 |
commit | 2f67b97355b80e57c3c19ba22ea040fad60377a8 (patch) | |
tree | a76fae15637ccd76827e9bdaba61590996c8d8b4 /driver | |
parent | 8c4d201788a744e7d997ad3f9f1ecd2675e22230 (diff) |
Merge upstream commit to support xserver 1.17
Diffstat (limited to 'driver')
-rw-r--r-- | driver/xf86-video-intel/src/compat-api.h | 10 | ||||
-rw-r--r-- | driver/xf86-video-intel/src/sna/fb/fbpict.c | 12 | ||||
-rw-r--r-- | driver/xf86-video-intel/src/sna/sna_accel.c | 17 | ||||
-rw-r--r-- | driver/xf86-video-intel/src/sna/sna_composite.c | 16 |
4 files changed, 49 insertions, 6 deletions
diff --git a/driver/xf86-video-intel/src/compat-api.h b/driver/xf86-video-intel/src/compat-api.h index 46a755b93..966a1345b 100644 --- a/driver/xf86-video-intel/src/compat-api.h +++ b/driver/xf86-video-intel/src/compat-api.h @@ -213,4 +213,14 @@ static inline void FreePixmap(PixmapPtr pixmap) #endif +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,16,99,1,0) +#include <mi.h> +#define miHandleExposures(pSrcDrawable, pDstDrawable, \ + pGC, srcx, srcy, width, height, \ + dstx, dsty, plane) \ + miHandleExposures(pSrcDrawable, pDstDrawable, \ + pGC, srcx, srcy, width, height, \ + dstx, dsty) +#endif + #endif diff --git a/driver/xf86-video-intel/src/sna/fb/fbpict.c b/driver/xf86-video-intel/src/sna/fb/fbpict.c index 906a5f316..abe223f31 100644 --- a/driver/xf86-video-intel/src/sna/fb/fbpict.c +++ b/driver/xf86-video-intel/src/sna/fb/fbpict.c @@ -156,6 +156,16 @@ create_conical_gradient_image(PictGradient * gradient) gradient->nstops); } +static inline bool +picture_has_clip(PicturePtr p) +{ +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,16,99,1,0) + return p->clientClip; +#else + return p->clientClipType != CT_NONE; +#endif +} + static pixman_image_t * create_bits_picture(PicturePtr pict, Bool has_clip, int *xoff, int *yoff) { @@ -180,7 +190,7 @@ create_bits_picture(PicturePtr pict, Bool has_clip, int *xoff, int *yoff) * only set the clip region for pictures with drawables */ if (has_clip) { - if (pict->clientClipType != CT_NONE) + if (picture_has_clip(pict)) pixman_image_set_has_client_clip(image, TRUE); if (*xoff || *yoff) diff --git a/driver/xf86-video-intel/src/sna/sna_accel.c b/driver/xf86-video-intel/src/sna/sna_accel.c index 7df522bdd..534b6487f 100644 --- a/driver/xf86-video-intel/src/sna/sna_accel.c +++ b/driver/xf86-video-intel/src/sna/sna_accel.c @@ -4338,6 +4338,7 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc, sgc->priv = gc->pCompositeClip; gc->pCompositeClip = region; +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0) if (gc->clientClipType == CT_PIXMAP) { PixmapPtr clip = gc->clientClip; gc->clientClip = region_from_bitmap(gc->pScreen, clip); @@ -4346,6 +4347,9 @@ static bool must_check sna_gc_move_to_cpu(GCPtr gc, changes |= GCClipMask; } else changes &= ~GCClipMask; +#else + changes &= ~GCClipMask; +#endif if (changes || drawable->serialNumber != (sgc->serial & DRAWABLE_SERIAL_BITS)) { long tmp = gc->serialNumber; @@ -6805,6 +6809,15 @@ static inline bool box_equal(const BoxRec *a, const BoxRec *b) return *(const uint64_t *)a == *(const uint64_t *)b; } +static inline bool has_clip(GCPtr gc) +{ +#if XORG_VERSION_CURRENT < XORG_VERSION_NUMERIC(1,16,99,901,0) + return gc->clientClipType != CT_NONE; +#else + return gc->clientClip != NULL; +#endif +} + static RegionPtr sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc, int sx, int sy, @@ -6891,7 +6904,7 @@ sna_do_copy(DrawablePtr src, DrawablePtr dst, GCPtr gc, /* Compute source clip region */ if (src->type == DRAWABLE_PIXMAP) { - if (src == dst && gc->clientClipType == CT_NONE) { + if (src == dst && !has_clip(gc)) { DBG(("%s: pixmap -- using gc clip\n", __FUNCTION__)); clip = gc->pCompositeClip; } else { @@ -16567,7 +16580,7 @@ sna_validate_gc(GCPtr gc, unsigned long changes, DrawablePtr drawable) if (changes & (GCClipMask|GCSubwindowMode) || drawable->serialNumber != (gc->serialNumber & DRAWABLE_SERIAL_BITS) || - (gc->clientClipType != CT_NONE && (changes & (GCClipXOrigin | GCClipYOrigin)))) { + (has_clip(gc) && (changes & (GCClipXOrigin | GCClipYOrigin)))) { DBG(("%s: recomputing clip\n", __FUNCTION__)); miComputeCompositeClip(gc, drawable); DBG(("%s: composite clip=%dx[(%d, %d), (%d, %d)] [%p]\n", diff --git a/driver/xf86-video-intel/src/sna/sna_composite.c b/driver/xf86-video-intel/src/sna/sna_composite.c index c76258cbf..3753afa9b 100644 --- a/driver/xf86-video-intel/src/sna/sna_composite.c +++ b/driver/xf86-video-intel/src/sna/sna_composite.c @@ -122,11 +122,21 @@ clip_to_dst(pixman_region16_t *region, } static inline bool +picture_has_clip(PicturePtr p) +{ +#if XORG_VERSION_CURRENT >= XORG_VERSION_NUMERIC(1,16,99,1,0) + return p->clientClip; +#else + return p->clientClipType != CT_NONE; +#endif +} + +static inline bool clip_to_src(RegionPtr region, PicturePtr p, int dx, int dy) { bool result; - if (p->clientClipType == CT_NONE) + if (!picture_has_clip(p)) return true; pixman_region_translate(p->clientClip, @@ -220,7 +230,7 @@ sna_compute_composite_region(RegionPtr region, __FUNCTION__, src->pDrawable ? src->pDrawable->width : 0, src->pDrawable ? src->pDrawable->height : 0, - src->clientClipType, + picture_has_clip(src), region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2)); @@ -287,7 +297,7 @@ trim_extents(BoxPtr extents, const PicturePtr p, int dx, int dy) static void _trim_source_extents(BoxPtr extents, const PicturePtr p, int dx, int dy) { - if (p->clientClipType != CT_NONE) + if (picture_has_clip(p)) trim_extents(extents, p, dx, dy); } |