diff -Nru xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/.lastcommit xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/.lastcommit --- xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/.lastcommit 2013-07-18 14:07:28.000000000 +0000 +++ xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/.lastcommit 2013-07-19 17:05:49.000000000 +0000 @@ -1 +1 @@ -commit 6c8b15d321044d4a81cb187cc5e1ac094eb82367 +commit e386ba86ea487a2db62d80a0e60f176e052d6406 diff -Nru xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/ChangeLog xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/ChangeLog --- xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/ChangeLog 2013-07-18 14:07:41.000000000 +0000 +++ xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/ChangeLog 2013-07-19 17:06:02.000000000 +0000 @@ -1,9 +1,179 @@ -commit 5bbac0921b2109738583a0c0ecb27eddb5b14314 +commit 08bda99c6bc5fe785f4bd226a655bea7cec1a967 Author: Robert Hooker -Date: Thu Jul 18 10:07:28 2013 -0400 +Date: Fri Jul 19 13:05:49 2013 -0400 Add debian tree from origin/ubuntu +commit e386ba86ea487a2db62d80a0e60f176e052d6406 +Author: Chris Wilson +Date: Fri Jul 19 15:22:08 2013 +0100 + + sna: Perform an explicit check against the region extents + + RegionNotEmpty() is only valid if we only use the Region API, and as we + mix direct operations on the region extents, we need to also do our own + final check. + + Signed-off-by: Chris Wilson + +commit de472d95affcad0f87685782d29a41fa2a0cada6 +Author: Chris Wilson +Date: Fri Jul 19 15:13:50 2013 +0100 + + sna: Check for bpp>=8 before attempting to use memcpy_blt fastpath + + Fixes regression in + commit 6921abd81017c9ed7f3b2413784068fbc609a0ea + Author: Chris Wilson + Date: Thu Jul 18 16:21:27 2013 +0100 + + sna: Add a fast path for the most common fallback for CPU-CPU blits + + Signed-off-by: Chris Wilson + +commit 4aa0288f16f03723a7aaa30967809d10fdb15a27 +Author: Chris Wilson +Date: Fri Jul 19 14:10:02 2013 +0100 + + sna: Return true from get_drawable_deltas() if the pixmap is offset + + Signed-off-by: Chris Wilson + +commit 6921abd81017c9ed7f3b2413784068fbc609a0ea +Author: Chris Wilson +Date: Thu Jul 18 16:21:27 2013 +0100 + + sna: Add a fast path for the most common fallback for CPU-CPU blits + + This path will mostly be upload for individual glyph uploads, for which + the malloc overhead is significant. + + Signed-off-by: Chris Wilson + +commit 4da830864983ffe482388e4e4cfee02d106c895e +Author: Chris Wilson +Date: Thu Jul 18 15:05:04 2013 +0100 + + sna: Remove the duplicated pimxap migration for the composite fb path + + Signed-off-by: Chris Wilson + +commit 0d56f0eb84cc80fa5497c06a7967650aa20ebe51 +Author: Chris Wilson +Date: Thu Jul 18 14:49:41 2013 +0100 + + sna: DBG controls to turn off unwinding partial bo + + Signed-off-by: Chris Wilson + +commit 494f4bdcb00dc54f84e503b49fd85c8965f7f9ed +Author: Chris Wilson +Date: Thu Jul 18 14:19:16 2013 +0100 + + sna: Allow operation inplace when wedged + + There are times, such as rendering into the scanout, where continuing to + use the GTT is preferrable even when wedged. + + Signed-off-by: Chris Wilson + +commit fb058de4e617d7e5058674859993ec635a8d779e +Author: Chris Wilson +Date: Thu Jul 18 13:37:12 2013 +0100 + + sna: Treat a source with a CPU bo as being attached. + + Signed-off-by: Chris Wilson + +commit 4723a730f4dc2d007577f43fe232c49b305c2695 +Author: Chris Wilson +Date: Thu Jul 18 13:26:36 2013 +0100 + + sna: Discard overwritten operations before doing a BLT composite + + Signed-off-by: Chris Wilson + +commit b2f32373815e166fc6dceb477139ff2ef27db0ba +Author: Chris Wilson +Date: Thu Jul 18 12:33:10 2013 +0100 + + sna: Tidy a few DBG regarding cached uploads + + Signed-off-by: Chris Wilson + +commit 1b37a167d9caa7868427cb88b2480f3b64e96cc9 +Author: Chris Wilson +Date: Thu Jul 18 10:51:42 2013 +0100 + + sna: Only IGNORE_CPU for blt composite operations if the size is known + + Some operations we do not know the true extents and so check the whole + drawable when considering placement. In this case, the drawing may only + partially cover the drawable and so we can not simply ignore existing CPU + damage. + + Signed-off-by: Chris Wilson + +commit 2d62f7c483a999c24c744c0d257c8524f6fd5d32 +Author: Chris Wilson +Date: Thu Jul 18 22:00:24 2013 +0100 + + sna: Also do exposure checking after source clipping in sna_do_copy + + Hopefully a final regression from: + + commit 07926bfe507071a3d46a2ec13bb86a36bc225761 + Author: Chris Wilson + Date: Thu Jul 11 15:28:55 2013 +0100 + + sna: Remove the temporary region allocation from sna_do_copy + + References: https://bugs.freedesktop.org/show_bug.cgi?id=67055 + Signed-off-by: Chris Wilson + +commit 2c8c4626908987e1bb5b16c49bc16dabac7d89dc +Author: Chris Wilson +Date: Fri Jul 19 11:55:09 2013 +0100 + + sna/dri: Return early is the DRI2CopyRegion is not attached to the GPU + + This can happen if the DRI client passes in a stale DRI2Drawable - that + is the Drawable now references a new Pixmap which the client has not run + DRI2GetBuffers against. + + Signed-off-by: Chris Wilson + +commit e5036fb15983a1d3547eaab381c18b3edf4310b4 +Author: Chris Wilson +Date: Fri Jul 19 11:51:40 2013 +0100 + + sna/dri: Reject invalid DRI2Drawables if STRICT_BLIT is defined + + Simply reject any attempts to copy using stale references (i.e. the + DRI2Drawable has changed structure but the client hasn't yet noticed). + + Signed-off-by: Chris Wilson + +commit a45714c9a5ba5cd35fbbee2a49f540fe9164cdfd +Author: Chris Wilson +Date: Fri Jul 19 11:21:28 2013 +0100 + + sna/dri: Rearrange some more DBG to come before its assertion + + Again, useful to know what the assertion fails with. + + Signed-off-by: Chris Wilson + +commit e9831b50b58c36af3d2dd196b3abbfaa8e9a22c6 +Author: Chris Wilson +Date: Fri Jul 19 10:59:03 2013 +0100 + + sna/dri: Expose the refcnts in DBG before we hit the assertions + + Useful to try and explain some failures. + + Signed-off-by: Chris Wilson + commit 6c8b15d321044d4a81cb187cc5e1ac094eb82367 Author: Chris Wilson Date: Wed Jul 17 20:58:33 2013 +0100 diff -Nru xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/debian/changelog xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/debian/changelog --- xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/debian/changelog 2013-07-19 17:24:25.000000000 +0000 +++ xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/debian/changelog 2013-07-19 17:24:25.000000000 +0000 @@ -1,11 +1,19 @@ -xserver-xorg-video-intel (2:2.21.12+git20130718.6c8b15d3-0ubuntu0sarvatt~quantal) quantal; urgency=medium +xserver-xorg-video-intel (2:2.21.12+git20130719.e386ba86-0ubuntu0sarvatt~quantal) quantal; urgency=medium - * Checkout from git 20130718 (master branch) up to commit - 6c8b15d321044d4a81cb187cc5e1ac094eb82367 + * Checkout from git 20130719 (master branch) up to commit + e386ba86ea487a2db62d80a0e60f176e052d6406 * Only added debian/ tree from origin/ubuntu * hook: Refresh 0002-Update-manpage-for-new-accelmethod-option.patch - -- Robert Hooker Thu, 18 Jul 2013 10:07:41 -0400 + -- Robert Hooker Fri, 19 Jul 2013 13:06:02 -0400 + +xserver-xorg-video-intel (2:2.21.12-1ubuntu1) UNRELEASED; urgency=low + + * Merge from unreleased debian git (LP: #1198409, #1173557, #1199746, #1200766) + Remaining changes: + - Use SNA by default. + + -- Maarten Lankhorst Thu, 18 Jul 2013 13:51:58 +0200 xserver-xorg-video-intel (2:2.21.12-1) UNRELEASED; urgency=low diff -Nru xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/kgem.c xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/kgem.c --- xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/kgem.c 2013-07-18 14:07:28.000000000 +0000 +++ xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/kgem.c 2013-07-19 17:05:49.000000000 +0000 @@ -2631,6 +2631,7 @@ bo->gpu_dirty = false; if (bo->needs_flush && __kgem_busy(kgem, bo->handle)) { + assert(bo->domain == DOMAIN_GPU || bo->domain == DOMAIN_NONE); list_add(&bo->request, &kgem->flushing); bo->rq = (void *)kgem; } else diff -Nru xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna.h xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna.h --- xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna.h 2013-07-18 14:07:28.000000000 +0000 +++ xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna.h 2013-07-19 17:05:49.000000000 +0000 @@ -408,17 +408,18 @@ void sna_debug_flush(struct sna *sna); -static inline void +static inline bool get_drawable_deltas(DrawablePtr drawable, PixmapPtr pixmap, int16_t *x, int16_t *y) { #ifdef COMPOSITE if (drawable->type == DRAWABLE_WINDOW) { *x = -pixmap->screen_x; *y = -pixmap->screen_y; - return; + return pixmap->screen_x | pixmap->screen_y; } #endif *x = *y = 0; + return false; } static inline int diff -Nru xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_accel.c xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_accel.c --- xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_accel.c 2013-07-18 14:07:28.000000000 +0000 +++ xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_accel.c 2013-07-19 17:05:49.000000000 +0000 @@ -69,6 +69,7 @@ #define USE_USERPTR_UPLOADS 1 #define USE_USERPTR_DOWNLOADS 1 #define USE_COW 1 +#define UNDO 1 #define MIGRATE_ALL 0 #define DBG_NO_CPU_UPLOAD 0 @@ -1471,10 +1472,10 @@ unsigned create; if (wedged(sna)) - return false; + goto done; if ((priv->create & KGEM_CAN_CREATE_GTT) == 0) - return false; + goto done; assert_pixmap_damage(pixmap); @@ -1482,7 +1483,7 @@ (!kgem_bo_is_mappable(&sna->kgem, priv->gpu_bo) || __kgem_bo_is_busy(&sna->kgem, priv->gpu_bo))) { if (priv->pinned) - return false; + goto done; DBG(("%s: discard busy GPU bo\n", __FUNCTION__)); sna_pixmap_free_gpu(sna, priv); @@ -1508,6 +1509,7 @@ sna_pixmap_choose_tiling(pixmap, DEFAULT_TILING), create); +done: return priv->gpu_bo && kgem_bo_is_mappable(&sna->kgem, priv->gpu_bo); } @@ -1832,7 +1834,7 @@ assert(priv->gpu_damage == NULL || priv->gpu_bo); - if ((flags & MOVE_READ) == 0) { + if ((flags & MOVE_READ) == 0 && UNDO) { if (priv->gpu_bo) kgem_bo_undo(&sna->kgem, priv->gpu_bo); if (priv->cpu_bo) @@ -1909,7 +1911,7 @@ if (USE_INPLACE && operate_inplace(priv, flags) && pixmap_inplace(sna, pixmap, priv, flags) && - sna_pixmap_create_mappable_gpu(pixmap, (flags & MOVE_READ) == 0)) { + sna_pixmap_create_mappable_gpu(pixmap, (flags & MOVE_READ) == 0)) { DBG(("%s: try to operate inplace (GTT)\n", __FUNCTION__)); assert(priv->cow == NULL || (flags & MOVE_WRITE) == 0); assert((flags & MOVE_READ) == 0 || priv->cpu_damage == NULL); @@ -1922,6 +1924,7 @@ if (priv->mapped) { assert(has_coherent_map(sna, priv->gpu_bo, flags)); pixmap->devKind = priv->gpu_bo->pitch; + if (flags & MOVE_WRITE) { assert(priv->gpu_bo->proxy == NULL); sna_damage_all(&priv->gpu_damage, @@ -2172,7 +2175,9 @@ return false; if (flags & MOVE_READ && - (priv->cpu || region_overlaps_damage(region, priv->cpu_damage, 0, 0))) { + (priv->cpu || + priv->gpu_damage == NULL || + region_overlaps_damage(region, priv->cpu_damage, 0, 0))) { DBG(("%s: no, uncovered CPU damage pending\n", __FUNCTION__)); return false; } @@ -2283,13 +2288,20 @@ flags & MOVE_WRITE) return _sna_pixmap_move_to_cpu(pixmap, flags); - get_drawable_deltas(drawable, pixmap, &dx, &dy); - DBG(("%s: delta=(%d, %d)\n", __FUNCTION__, dx, dy)); - if (dx | dy) + if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { + DBG(("%s: delta=(%d, %d)\n", __FUNCTION__, dx, dy)); RegionTranslate(region, dx, dy); + } if (region_subsumes_drawable(region, &pixmap->drawable)) { - DBG(("%s: region subsumes drawable\n", __FUNCTION__)); + DBG(("%s: region (%d, %d), (%d, %d) subsumes pixmap (%dx%d)\n", + __FUNCTION__, + region->extents.x1, + region->extents.y1, + region->extents.x2, + region->extents.y2, + pixmap->drawable.width, + pixmap->drawable.height)); if (dx | dy) RegionTranslate(region, -dx, -dy); return _sna_pixmap_move_to_cpu(pixmap, flags); @@ -2298,7 +2310,7 @@ if (USE_INPLACE && operate_inplace(priv, flags) && region_inplace(sna, pixmap, region, priv, flags) && - sna_pixmap_create_mappable_gpu(pixmap, false)) { + sna_pixmap_create_mappable_gpu(pixmap, false)) { DBG(("%s: try to operate inplace\n", __FUNCTION__)); assert(priv->cow == NULL || (flags & MOVE_WRITE) == 0); /* XXX only sync for writes? */ @@ -3095,13 +3107,13 @@ if (flags & IGNORE_CPU) { if (priv->gpu_damage) { - get_drawable_deltas(drawable, pixmap, &dx, &dy); - region.extents = *box; - region.extents.x1 += dx; - region.extents.x2 += dx; - region.extents.y1 += dy; - region.extents.y2 += dy; + if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { + region.extents.x1 += dx; + region.extents.x2 += dx; + region.extents.y1 += dy; + region.extents.y2 += dy; + } region.data = NULL; if (region_subsumes_damage(®ion, priv->gpu_damage)) @@ -3211,13 +3223,13 @@ } } } else if (priv->cpu_damage) { - get_drawable_deltas(drawable, pixmap, &dx, &dy); - region.extents = *box; - region.extents.x1 += dx; - region.extents.x2 += dx; - region.extents.y1 += dy; - region.extents.y2 += dy; + if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { + region.extents.x1 += dx; + region.extents.x2 += dx; + region.extents.y1 += dy; + region.extents.y2 += dy; + } region.data = NULL; sna_damage_subtract(&priv->cpu_damage, ®ion); @@ -3238,13 +3250,15 @@ goto done; } - get_drawable_deltas(drawable, pixmap, &dx, &dy); region.extents = *box; - region.extents.x1 += dx; - region.extents.x2 += dx; - region.extents.y1 += dy; - region.extents.y2 += dy; + if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { + region.extents.x1 += dx; + region.extents.x2 += dx; + region.extents.y1 += dy; + region.extents.y2 += dy; + } + region.data = NULL; DBG(("%s extents (%d, %d), (%d, %d)\n", __FUNCTION__, region.extents.x1, region.extents.y1, @@ -3345,13 +3359,13 @@ if (!USE_CPU_BO || priv->cpu_bo == NULL) { cpu_fail: if ((flags & FORCE_GPU) && priv->gpu_bo) { - get_drawable_deltas(drawable, pixmap, &dx, &dy); - region.extents = *box; - region.extents.x1 += dx; - region.extents.x2 += dx; - region.extents.y1 += dy; - region.extents.y2 += dy; + if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { + region.extents.x1 += dx; + region.extents.x2 += dx; + region.extents.y1 += dy; + region.extents.y2 += dy; + } region.data = NULL; goto move_to_gpu; @@ -3370,13 +3384,14 @@ return NULL; } - get_drawable_deltas(drawable, pixmap, &dx, &dy); region.extents = *box; - region.extents.x1 += dx; - region.extents.x2 += dx; - region.extents.y1 += dy; - region.extents.y2 += dy; + if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { + region.extents.x1 += dx; + region.extents.x2 += dx; + region.extents.y1 += dy; + region.extents.y2 += dy; + } region.data = NULL; /* Both CPU and GPU are busy, prefer to use the GPU */ @@ -3560,7 +3575,7 @@ assert(priv->gpu_damage == NULL || priv->gpu_bo); - if ((flags & MOVE_READ) == 0) { + if ((flags & MOVE_READ) == 0 && UNDO) { if (priv->gpu_bo) kgem_bo_undo(&sna->kgem, priv->gpu_bo); if (priv->cpu_bo) @@ -4726,9 +4741,8 @@ dx, dy, alu, pixmap->drawable.width, pixmap->drawable.height)); - get_drawable_deltas(src, pixmap, &tx, &ty); - dx += tx; - dy += ty; + if (get_drawable_deltas(src, pixmap, &tx, &ty)) + dx += tx, dy += ty; if (dst != src) get_drawable_deltas(dst, pixmap, &tx, &ty); @@ -4931,8 +4945,8 @@ bpp = dst_pixmap->drawable.bitsPerPixel; - get_drawable_deltas(dst, dst_pixmap, &dst_dx, &dst_dy); - RegionTranslate(region, dst_dx, dst_dy); + if (get_drawable_deltas(dst, dst_pixmap, &dst_dx, &dst_dy)) + RegionTranslate(region, dst_dx, dst_dy); get_drawable_deltas(src, src_pixmap, &src_dx, &src_dy); src_dx += dx - dst_dx; src_dy += dy - dst_dy; @@ -4999,7 +5013,7 @@ DBG(("%s: applying src clear [%08x] to dst\n", __FUNCTION__, src_priv->clear_color)); if (n == 1) { - if (replaces) + if (replaces && UNDO) kgem_bo_undo(&sna->kgem, bo); if (!sna->render.fill_one(sna, @@ -5052,7 +5066,7 @@ sna_pixmap_move_to_gpu(src_pixmap, MOVE_READ | MOVE_ASYNC_HINT)) { DBG(("%s: move whole src_pixmap to GPU and copy\n", __FUNCTION__)); - if (replaces) + if (replaces && UNDO) kgem_bo_undo(&sna->kgem, bo); if (replaces && @@ -5104,7 +5118,7 @@ MOVE_READ | MOVE_ASYNC_HINT)) goto fallback; - if (replaces) + if (replaces && UNDO) kgem_bo_undo(&sna->kgem, bo); if (!sna->render.copy_boxes(sna, alu, @@ -5140,7 +5154,7 @@ if (!ret) goto fallback; - if (replaces) + if (replaces && UNDO) kgem_bo_undo(&sna->kgem, bo); if (src_priv->shm) { @@ -5464,7 +5478,7 @@ { RegionPtr clip; RegionRec region; - bool expose; + BoxRec src_extents; DBG(("%s: src=(%d, %d), dst=(%d, %d), size=(%dx%d)\n", __FUNCTION__, sx, sy, dx, dy, width, height)); @@ -5506,6 +5520,8 @@ region.extents.y1 = clamp(region.extents.y1, sy - dy); region.extents.y2 = clamp(region.extents.y2, sy - dy); + src_extents = region.extents; + /* Compute source clip region */ clip = NULL; if (src == dst && gc->clientClipType == CT_NONE) { @@ -5540,33 +5556,24 @@ } if (clip == NULL) { DBG(("%s: fast source clip against extents\n", __FUNCTION__)); - expose = true; - if (region.extents.x1 < src->x) { + if (region.extents.x1 < src->x) region.extents.x1 = src->x; - expose = false; - } - if (region.extents.y1 < src->y) { + if (region.extents.y1 < src->y) region.extents.y1 = src->y; - expose = false; - } - if (region.extents.x2 > src->x + (int) src->width) { + if (region.extents.x2 > src->x + (int) src->width) region.extents.x2 = src->x + (int) src->width; - expose = false; - } - if (region.extents.y2 > src->y + (int) src->height) { + if (region.extents.y2 > src->y + (int) src->height) region.extents.y2 = src->y + (int) src->height; - expose = false; - } - if (box_empty(®ion.extents)) - return NULL; - } else { - expose = false; + } else RegionIntersect(®ion, ®ion, clip); - } DBG(("%s: src extents (%d, %d), (%d, %d) x %ld\n", __FUNCTION__, region.extents.x1, region.extents.y1, region.extents.x2, region.extents.y2, (long)RegionNumRects(®ion))); + if ((clip == NULL || clip->data == NULL) && + *(uint64_t *)&src_extents == *(uint64_t *)®ion.extents) + *(uint64_t *)&src_extents = 0; + RegionTranslate(®ion, dx-sx, dy-sy); if (gc->pCompositeClip->data) RegionIntersect(®ion, ®ion, gc->pCompositeClip); @@ -5575,13 +5582,13 @@ region.extents.x2, region.extents.y2, (long)RegionNumRects(®ion))); - if (RegionNotEmpty(®ion)) + if (!box_empty(®ion.extents)) copy(src, dst, gc, ®ion, sx-dx, sy-dy, bitPlane, closure); RegionUninit(®ion); /* Pixmap sources generate a NoExposed (we return NULL to do this) */ clip = NULL; - if (!expose && gc->fExpose) + if (gc->fExpose && *(uint64_t *)&src_extents != 0) clip = miHandleExposures(src, dst, gc, sx - src->x, sy - src->y, width, height, @@ -6897,9 +6904,8 @@ if (n == 0) return; - get_drawable_deltas(source, src_pixmap, &dx, &dy); - sx += dx; - sy += dy; + if (get_drawable_deltas(source, src_pixmap, &dx, &dy)) + sx += dx, sy += dy; get_drawable_deltas(drawable, dst_pixmap, &dx, &dy); assert_pixmap_contains_boxes(dst_pixmap, box, n, dx, dy); @@ -10141,9 +10147,10 @@ r.x2 = bound(r.x1, rect->width); r.y2 = bound(r.y1, rect->height); if (box_intersect(&r, &gc->pCompositeClip->extents)) { - get_drawable_deltas(drawable, pixmap, &dx, &dy); - r.x1 += dx; r.y1 += dy; - r.x2 += dx; r.y2 += dy; + if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) { + r.x1 += dx; r.y1 += dy; + r.x2 += dx; r.y2 += dy; + } if (sna->render.fill_one(sna, pixmap, bo, pixel, r.x1, r.y1, r.x2, r.y2, gc->alu)) { @@ -12614,10 +12621,10 @@ region.data = NULL; - get_drawable_deltas(draw, pixmap, &dx, &dy); - DBG(("%s: delta=(%d, %d)\n", __FUNCTION__, dx, dy)); - if (dx | dy) + if (get_drawable_deltas(draw, pixmap, &dx, &dy)) { + DBG(("%s: delta=(%d, %d)\n", __FUNCTION__, dx, dy)); RegionTranslate(®ion, dx, dy); + } if (priv->cpu_damage && (flags & 2) == 0) { if (region_subsumes_damage(®ion, priv->cpu_damage)) { @@ -12665,7 +12672,7 @@ DBG(("%s: not using GPU, hint=%x\n", __FUNCTION__, hint)); goto fallback; } - if (hint & REPLACES && (flags & 2) == 0) + if (hint & REPLACES && (flags & 2) == 0 && UNDO) kgem_bo_undo(&sna->kgem, bo); if (gc_is_solid(gc, &color)) { @@ -14019,8 +14026,8 @@ } } - get_drawable_deltas(drawable, pixmap, &dx, &dy); - RegionTranslate(region, dx, dy); + if (get_drawable_deltas(drawable, pixmap, &dx, &dy)) + RegionTranslate(region, dx, dy); assert_pixmap_contains_box(pixmap, RegionExtents(region)); if (damage) diff -Nru xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_blt.c xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_blt.c --- xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_blt.c 2013-07-18 14:07:28.000000000 +0000 +++ xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_blt.c 2013-07-19 17:05:49.000000000 +0000 @@ -1953,13 +1953,6 @@ return true; } -#define alphaless(format) PICT_FORMAT(PICT_FORMAT_BPP(format), \ - PICT_FORMAT_TYPE(format), \ - 0, \ - PICT_FORMAT_R(format), \ - PICT_FORMAT_G(format), \ - PICT_FORMAT_B(format)) - static bool is_clear(PixmapPtr pixmap) { @@ -2031,10 +2024,12 @@ hint = 0; if (can_render(sna)) { hint |= PREFER_GPU; - if (sna_pixmap(tmp->dst.pixmap)->gpu_bo) - hint |= FORCE_GPU; - if (dst->pCompositeClip->data == NULL) + if (dst->pCompositeClip->data == NULL && (width | height)) { hint |= IGNORE_CPU; + if (width == tmp->dst.pixmap->drawable.width && + height == tmp->dst.pixmap->drawable.height) + hint |= REPLACES; + } } tmp->dst.bo = sna_drawable_use_bo(dst->pDrawable, hint, &dst_box, &tmp->damage); @@ -2053,7 +2048,9 @@ if (!sna_drawable_move_region_to_cpu(dst->pDrawable, ®ion, MOVE_INPLACE_HINT | MOVE_WRITE)) return false; - } + } else if (hint & REPLACES) + kgem_bo_undo(&sna->kgem, tmp->dst.bo); + return prepare_blt_clear(sna, tmp); } @@ -2081,10 +2078,11 @@ hint = 0; if (can_render(sna)) { hint |= PREFER_GPU; - if (sna_pixmap(tmp->dst.pixmap)->gpu_bo) - hint |= FORCE_GPU; - if (dst->pCompositeClip->data == NULL) + if (dst->pCompositeClip->data == NULL && (width | height)) hint |= IGNORE_CPU; + if (width == tmp->dst.pixmap->drawable.width && + height == tmp->dst.pixmap->drawable.height) + hint |= REPLACES; } tmp->dst.bo = sna_drawable_use_bo(dst->pDrawable, hint, &dst_box, &tmp->damage); @@ -2103,7 +2101,8 @@ if (!sna_drawable_move_region_to_cpu(dst->pDrawable, ®ion, MOVE_INPLACE_HINT | MOVE_WRITE)) return false; - } + } else if (hint & REPLACES) + kgem_bo_undo(&sna->kgem, tmp->dst.bo); return prepare_blt_fill(sna, tmp, color); } @@ -2232,14 +2231,21 @@ hint = 0; if (bo || can_render(sna)) { hint |= PREFER_GPU; - if (dst->pCompositeClip->data == NULL) + if (dst->pCompositeClip->data == NULL && (width | height)) { hint |= IGNORE_CPU; + if (width == tmp->dst.pixmap->drawable.width && + height == tmp->dst.pixmap->drawable.height) + hint |= REPLACES; + } if (bo) hint |= FORCE_GPU; } tmp->dst.bo = sna_drawable_use_bo(dst->pDrawable, hint, &dst_box, &tmp->damage); + if (hint & REPLACES) + kgem_bo_undo(&sna->kgem, tmp->dst.bo); + ret = false; if (bo) { if (!tmp->dst.bo) { diff -Nru xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_composite.c xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_composite.c --- xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_composite.c 2013-07-18 14:07:28.000000000 +0000 +++ xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_composite.c 2013-07-19 17:05:49.000000000 +0000 @@ -216,10 +216,13 @@ pixman_region_fini (region); return FALSE; } - DBG(("%s: clip against src: (%d, %d), (%d, %d)\n", - __FUNCTION__, - region->extents.x1, region->extents.y1, - region->extents.x2, region->extents.y2)); + DBG(("%s: clip against src (%dx%d clip=%d): (%d, %d), (%d, %d)\n", + __FUNCTION__, + src->pDrawable ? src->pDrawable->width : 0, + src->pDrawable ? src->pDrawable->height : 0, + src->clientClipType, + region->extents.x1, region->extents.y1, + region->extents.x2, region->extents.y2)); if (src->alphaMap) { if (!clip_to_src(region, src->alphaMap, @@ -458,17 +461,26 @@ PicturePtr mask, PicturePtr dst, RegionPtr region, - INT16 src_x, INT16 src_y, - INT16 mask_x, INT16 mask_y, - INT16 dst_x, INT16 dst_y, + INT16 src_x, INT16 src_y, + INT16 msk_x, INT16 msk_y, + INT16 dst_x, INT16 dst_y, CARD16 width, CARD16 height) { pixman_image_t *src_image, *mask_image, *dest_image; int src_xoff, src_yoff; int msk_xoff, msk_yoff; int dst_xoff, dst_yoff; + int16_t tx, ty; unsigned flags; + DBG(("%s -- op=%d, fallback dst=(%d, %d)+(%d, %d), size=(%d, %d): region=((%d,%d), (%d, %d))\n", + __FUNCTION__, op, + dst_x, dst_y, + dst->pDrawable->x, dst->pDrawable->y, + width, height, + region->extents.x1, region->extents.y1, + region->extents.x2, region->extents.y2)); + DBG(("%s: fallback -- move dst to cpu\n", __FUNCTION__)); if (op <= PictOpSrc && !dst->alphaMap) flags = MOVE_WRITE | MOVE_INPLACE_HINT; @@ -504,22 +516,59 @@ return; } - DBG(("%s: fallback -- fbComposite\n", __FUNCTION__)); - validate_source(src); if (mask) validate_source(mask); + if (mask == NULL && + src->pDrawable && + dst->pDrawable->bitsPerPixel >= 8 && + src->filter != PictFilterConvolution && + (op == PictOpSrc || (op == PictOpOver && !PICT_FORMAT_A(src->format))) && + (dst->format == src->format || dst->format == alphaless(src->format)) && + sna_transform_is_integer_translation(src->transform, &tx, &ty) && + region->extents.x1 + src_x + tx >= 0 && + region->extents.y1 + src_y + ty >= 0 && + region->extents.x2 + src_x + tx <= src->pDrawable->width && + region->extents.x2 + src_y + ty <= src->pDrawable->height) { + PixmapPtr dst_pixmap = get_drawable_pixmap(dst->pDrawable); + PixmapPtr src_pixmap = get_drawable_pixmap(src->pDrawable); + int nbox = RegionNumRects(region); + BoxPtr box = RegionRects(region); + + src_x += tx; src_y += ty; + + if (get_drawable_deltas(src->pDrawable, src_pixmap, &tx, &ty)) + src_x += tx, src_y += ty; + + if (get_drawable_deltas(dst->pDrawable, dst_pixmap, &tx, &ty)) + dst_x += tx, dst_y += ty; + + do { + memcpy_blt(src_pixmap->devPrivate.ptr, + dst_pixmap->devPrivate.ptr, + dst_pixmap->drawable.bitsPerPixel, + src_pixmap->devKind, + dst_pixmap->devKind, + box->x1 + src_x, box->y1 + src_y, + box->x1 + dst_x, box->y1 + dst_y, + box->x2 - box->x1, box->y2 - box->y1); + box++; + } while (--nbox); + + return; + } + src_image = image_from_pict(src, FALSE, &src_xoff, &src_yoff); mask_image = image_from_pict(mask, FALSE, &msk_xoff, &msk_yoff); dest_image = image_from_pict(dst, TRUE, &dst_xoff, &dst_yoff); if (src_image && dest_image && !(mask && !mask_image)) sna_image_composite(op, src_image, mask_image, dest_image, - src_x + src_xoff, src_y + src_yoff, - mask_x + msk_xoff, mask_y + msk_yoff, - dst_x + dst_xoff, dst_y + dst_yoff, - width, height); + src_x + src_xoff, src_y + src_yoff, + msk_x + msk_xoff, msk_y + msk_yoff, + dst_x + dst_xoff, dst_y + dst_yoff, + width, height); free_pixman_pict(src, src_image); free_pixman_pict(mask, mask_image); @@ -540,7 +589,6 @@ struct sna *sna = to_sna_from_pixmap(pixmap); struct sna_pixmap *priv; struct sna_composite_op tmp; - unsigned flags; RegionRec region; int dx, dy; @@ -619,8 +667,7 @@ if (op <= PictOpSrc && priv->cpu_damage) { int16_t x, y; - get_drawable_deltas(dst->pDrawable, pixmap, &x, &y); - if (x|y) + if (get_drawable_deltas(dst->pDrawable, pixmap, &x, &y)) pixman_region_translate(®ion, x, y); sna_damage_subtract(&priv->cpu_damage, ®ion); @@ -658,46 +705,6 @@ goto out; fallback: - DBG(("%s -- fallback dst=(%d, %d)+(%d, %d), size=(%d, %d): region=((%d,%d), (%d, %d))\n", - __FUNCTION__, - dst_x, dst_y, - dst->pDrawable->x, dst->pDrawable->y, - width, height, - region.extents.x1, region.extents.y1, - region.extents.x2, region.extents.y2)); - if (op <= PictOpSrc && !dst->alphaMap) - flags = MOVE_WRITE | MOVE_INPLACE_HINT; - else - flags = MOVE_WRITE | MOVE_READ; - DBG(("%s: fallback -- move dst to cpu\n", __FUNCTION__)); - if (!sna_drawable_move_region_to_cpu(dst->pDrawable, ®ion, flags)) - goto out; - if (dst->alphaMap && - !sna_drawable_move_to_cpu(dst->alphaMap->pDrawable, flags)) - goto out; - if (src->pDrawable) { - DBG(("%s: fallback -- move src to cpu\n", __FUNCTION__)); - if (!sna_drawable_move_to_cpu(src->pDrawable, - MOVE_READ)) - goto out; - - if (src->alphaMap && - !sna_drawable_move_to_cpu(src->alphaMap->pDrawable, - MOVE_READ)) - goto out; - } - if (mask && mask->pDrawable) { - DBG(("%s: fallback -- move mask to cpu\n", __FUNCTION__)); - if (!sna_drawable_move_to_cpu(mask->pDrawable, - MOVE_READ)) - goto out; - - if (mask->alphaMap && - !sna_drawable_move_to_cpu(mask->alphaMap->pDrawable, - MOVE_READ)) - goto out; - } - DBG(("%s: fallback -- fbComposite\n", __FUNCTION__)); sna_composite_fb(op, src, mask, dst, ®ion, src_x, src_y, @@ -881,8 +888,8 @@ (long)RegionNumRects(®ion))); pixmap = get_drawable_pixmap(dst->pDrawable); - get_drawable_deltas(dst->pDrawable, pixmap, &dst_x, &dst_y); - pixman_region_translate(®ion, dst_x, dst_y); + if (get_drawable_deltas(dst->pDrawable, pixmap, &dst_x, &dst_y)) + pixman_region_translate(®ion, dst_x, dst_y); DBG(("%s: pixmap +(%d, %d) extents (%d, %d),(%d, %d)\n", __FUNCTION__, dst_x, dst_y, diff -Nru xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_display.c xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_display.c --- xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_display.c 2013-07-18 14:07:28.000000000 +0000 +++ xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_display.c 2013-07-19 17:05:49.000000000 +0000 @@ -3570,7 +3570,7 @@ DBG(("%s: crtc=%d, valid?=%d, fb attached?=%d, expected=%d\n", __FUNCTION__, mode.crtc_id, mode.mode_valid, - mode.fb_id, fb_id, expected)); + mode.fb_id, expected)); if (mode.fb_id != expected) sna_crtc_disable(crtc); @@ -3779,7 +3779,7 @@ __FUNCTION__, sna_crtc->id, sna_crtc->pipe, region->extents.x1, region->extents.y1, region->extents.x2, region->extents.y2, - REGION_NUM_RECTS(region))); + (long)RegionNumRects(region))); assert(!wedged(sna)); diff -Nru xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_dri.c xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_dri.c --- xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_dri.c 2013-07-18 14:07:28.000000000 +0000 +++ xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_dri.c 2013-07-19 17:05:49.000000000 +0000 @@ -60,6 +60,8 @@ #define COLOR_PREFER_TILING_Y 0 +#define STRICT_BLIT 1 + enum frame_event_type { DRI2_SWAP, DRI2_SWAP_WAIT, @@ -215,6 +217,11 @@ if (buffer == NULL) return; + DBG(("%s: pixmap=%ld, old handle=%d, new handle=%d\n", __FUNCTION__, + pixmap->drawable.serialNumber, + get_private(buffer)->bo->handle, + sna_pixmap(pixmap)->gpu_bo->handle)); + private = get_private(buffer); assert(private->pixmap == pixmap); @@ -247,8 +254,10 @@ uint32_t size; int bpp; - DBG(("%s(attachment=%d, format=%d, drawable=%dx%d)\n", - __FUNCTION__, attachment, format, draw->width, draw->height)); + DBG(("%s pixmap=%ld, (attachment=%d, format=%d, drawable=%dx%d)\n", + __FUNCTION__, + get_drawable_pixmap(draw)->drawable.serialNumber, + attachment, format, draw->width, draw->height)); pixmap = NULL; size = (uint32_t)draw->height << 16 | draw->width; @@ -902,7 +911,7 @@ if (draw->type == DRAWABLE_PIXMAP) return true; -#if 0 +#ifdef STRICT_BLIT if (get_private(dst)->pixmap != get_drawable_pixmap(draw)) { DBG(("%s: reject as dst pixmap=%ld, but expecting pixmap=%ld\n", __FUNCTION__, @@ -919,8 +928,13 @@ clip = &((WindowPtr)draw)->clipList; w = clip->extents.x2 - draw->x; h = clip->extents.y2 - draw->y; - if ((w|h) < 0) + if ((w|h) <= 0) { + DBG(("%s: reject, outside clip (%d, %d), (%d, %d)\n", + __func__, + clip->extents.x1, clip->extents.y1, + clip->extents.x2, clip->extents.y2)); return false; + } s = get_private(dst)->size; if ((s>>16) < h || (s&0xffff) < w) { @@ -951,11 +965,19 @@ void (*copy)(struct sna *, DrawablePtr, RegionPtr, struct kgem_bo *, struct kgem_bo *, bool) = sna_dri_copy; - DBG(("%s: pixmap=%ld, src=%u, dst=%u\n", + DBG(("%s: pixmap=%ld, src=%u (refs=%d/%d, flush=%d, attach=%d) , dst=%u (refs=%d/%d, flush=%d, attach=%d)\n", __FUNCTION__, pixmap->drawable.serialNumber, get_private(src_buffer)->bo->handle, - get_private(dst_buffer)->bo->handle)); + get_private(src_buffer)->refcnt, + get_private(src_buffer)->bo->refcnt, + get_private(src_buffer)->bo->flush, + src_buffer->attachment, + get_private(dst_buffer)->bo->handle, + get_private(dst_buffer)->refcnt, + get_private(dst_buffer)->bo->refcnt, + get_private(dst_buffer)->bo->flush, + dst_buffer->attachment)); assert(get_private(src_buffer)->refcnt); assert(get_private(dst_buffer)->refcnt); @@ -969,29 +991,38 @@ if (!can_blit(sna, draw, dst_buffer, src_buffer)) return; + dst = get_private(dst_buffer)->bo; if (dst_buffer->attachment == DRI2BufferFrontLeft) { - dst = sna_pixmap_get_bo(pixmap); copy = (void *)sna_dri_copy_to_front; - } else - dst = get_private(dst_buffer)->bo; +#ifndef STRICT_BLIT + dst = sna_pixmap_get_bo(pixmap); + if (dst == NULL) + return; +#endif + } + + DBG(("%s: dst -- attachment=%d, name=%d, handle=%d [screen=%d]\n", + __FUNCTION__, + dst_buffer->attachment, dst_buffer->name, dst ? dst->handle : 0, + sna_pixmap_get_bo(sna->front)->handle)); + assert(dst != NULL); + src = get_private(src_buffer)->bo; if (src_buffer->attachment == DRI2BufferFrontLeft) { - src = sna_pixmap_get_bo(pixmap); assert(copy == sna_dri_copy); copy = sna_dri_copy_from_front; - } else - src = get_private(src_buffer)->bo; - - assert(dst != NULL); - assert(src != NULL); +#ifndef STRICT_BLIT + src = sna_pixmap_get_bo(pixmap); + if (src == NULL) + return; +#endif + } - DBG(("%s: dst -- attachment=%d, name=%d, handle=%d [screen=%d]\n", - __FUNCTION__, - dst_buffer->attachment, dst_buffer->name, dst->handle, - sna_pixmap_get_bo(sna->front)->handle)); DBG(("%s: src -- attachment=%d, name=%d, handle=%d\n", __FUNCTION__, - src_buffer->attachment, src_buffer->name, src->handle)); + src_buffer->attachment, src_buffer->name, src ? src->handle : 0)); + assert(src != NULL); + DBG(("%s: region (%d, %d), (%d, %d) x %d\n", __FUNCTION__, region->extents.x1, region->extents.y1, @@ -2051,6 +2082,18 @@ enum frame_event_type swap_type = DRI2_SWAP; CARD64 current_msc; + DBG(("%s: pixmap=%ld, back=%u (refs=%d/%d, flush=%d) , fron=%u (refs=%d/%d, flush=%d)\n", + __FUNCTION__, + get_drawable_pixmap(draw)->drawable.serialNumber, + get_private(back)->bo->handle, + get_private(back)->refcnt, + get_private(back)->bo->refcnt, + get_private(back)->bo->flush, + get_private(front)->bo->handle, + get_private(front)->refcnt, + get_private(front)->bo->refcnt, + get_private(front)->bo->flush)); + DBG(("%s(target_msc=%llu, divisor=%llu, remainder=%llu)\n", __FUNCTION__, (long long)*target_msc, diff -Nru xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_render.c xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_render.c --- xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_render.c 2013-07-18 14:07:28.000000000 +0000 +++ xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_render.c 2013-07-19 17:05:49.000000000 +0000 @@ -553,8 +553,11 @@ pixmap->usage_hint == 0 && channel->width == pixmap->drawable.width && channel->height == pixmap->drawable.height) { + DBG(("%s: adding upload cache to pixmap=%ld\n", + __FUNCTION__, pixmap->drawable.serialNumber)); assert(priv->gpu_damage == NULL); assert(priv->gpu_bo == NULL); + assert(bo->proxy != NULL); kgem_proxy_bo_attach(bo, &priv->gpu_bo); } } @@ -1210,8 +1213,11 @@ if (priv != NULL && bo != NULL && box.x2 - box.x1 == pixmap->drawable.width && box.y2 - box.y1 == pixmap->drawable.height) { + DBG(("%s: adding upload cache to pixmap=%ld\n", + __FUNCTION__, pixmap->drawable.serialNumber)); assert(priv->gpu_damage == NULL); assert(priv->gpu_bo == NULL); + assert(bo->proxy != NULL); kgem_proxy_bo_attach(bo, &priv->gpu_bo); } } diff -Nru xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_render.h xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_render.h --- xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_render.h 2013-07-18 14:07:28.000000000 +0000 +++ xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_render.h 2013-07-19 17:05:49.000000000 +0000 @@ -775,4 +775,11 @@ return was_active; } +#define alphaless(format) PICT_FORMAT(PICT_FORMAT_BPP(format), \ + PICT_FORMAT_TYPE(format), \ + 0, \ + PICT_FORMAT_R(format), \ + PICT_FORMAT_G(format), \ + PICT_FORMAT_B(format)) + #endif /* SNA_RENDER_H */ diff -Nru xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_render_inline.h xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_render_inline.h --- xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_render_inline.h 2013-05-29 15:53:40.000000000 +0000 +++ xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_render_inline.h 2013-07-19 17:05:49.000000000 +0000 @@ -105,7 +105,7 @@ unattached(DrawablePtr drawable) { struct sna_pixmap *priv = sna_pixmap_from_drawable(drawable); - return priv == NULL || (priv->gpu_damage == NULL && priv->cpu_damage); + return priv == NULL || (priv->gpu_damage == NULL && priv->cpu_damage && !priv->cpu_bo); } static inline bool diff -Nru xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_trapezoids.c xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_trapezoids.c --- xserver-xorg-video-intel-2.21.12+git20130718.6c8b15d3/src/sna/sna_trapezoids.c 2013-07-18 14:07:28.000000000 +0000 +++ xserver-xorg-video-intel-2.21.12+git20130719.e386ba86/src/sna/sna_trapezoids.c 2013-07-19 17:05:49.000000000 +0000 @@ -5402,10 +5402,10 @@ unbounded_pass: pixmap = get_drawable_pixmap(dst->pDrawable); - get_drawable_deltas(dst->pDrawable, pixmap, &dx, &dy); ptr = pixmap->devPrivate.ptr; - ptr += dy * pixmap->devKind + dx * pixmap->drawable.bitsPerPixel / 8; + if (get_drawable_deltas(dst->pDrawable, pixmap, &dx, &dy)) + ptr += dy * pixmap->devKind + dx * pixmap->drawable.bitsPerPixel / 8; inplace.fill.data = (uint32_t *)ptr; inplace.fill.stride = pixmap->devKind / sizeof(uint32_t); inplace.fill.bpp = pixmap->drawable.bitsPerPixel; @@ -5633,10 +5633,10 @@ PixmapPtr pixmap; pixmap = get_drawable_pixmap(thread->dst->pDrawable); - get_drawable_deltas(thread->dst->pDrawable, pixmap, &dst_x, &dst_y); inplace.ptr = pixmap->devPrivate.ptr; - inplace.ptr += dst_y * pixmap->devKind + dst_x * 4; + if (get_drawable_deltas(thread->dst->pDrawable, pixmap, &dst_x, &dst_y)) + inplace.ptr += dst_y * pixmap->devKind + dst_x * 4; inplace.stride = pixmap->devKind; inplace.color = thread->color; @@ -5824,10 +5824,10 @@ int16_t dst_x, dst_y; pixmap = get_drawable_pixmap(dst->pDrawable); - get_drawable_deltas(dst->pDrawable, pixmap, &dst_x, &dst_y); inplace.ptr = pixmap->devPrivate.ptr; - inplace.ptr += dst_y * pixmap->devKind + dst_x * 4; + if (get_drawable_deltas(dst->pDrawable, pixmap, &dst_x, &dst_y)) + inplace.ptr += dst_y * pixmap->devKind + dst_x * 4; inplace.stride = pixmap->devKind; inplace.color = color; @@ -6151,10 +6151,10 @@ dx = dst->pDrawable->x * FAST_SAMPLES_X; dy = dst->pDrawable->y * FAST_SAMPLES_Y; - get_drawable_deltas(dst->pDrawable, pixmap, &dst_x, &dst_y); inplace.ptr = pixmap->devPrivate.ptr; - inplace.ptr += dst_y * pixmap->devKind + dst_x; + if (get_drawable_deltas(dst->pDrawable, pixmap, &dst_x, &dst_y)) + inplace.ptr += dst_y * pixmap->devKind + dst_x; inplace.stride = pixmap->devKind; inplace.opacity = color >> 24;