summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--driver/xf86-video-intel/src/compat-api.h10
-rw-r--r--driver/xf86-video-intel/src/sna/fb/fbpict.c12
-rw-r--r--driver/xf86-video-intel/src/sna/sna_accel.c17
-rw-r--r--driver/xf86-video-intel/src/sna/sna_composite.c16
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);
}