assert(!bo->purged);
assert(list_is_empty(&bo->list));
assert(bo->proxy == NULL);
+ assert_tiling(kgem, bo);
if (bo->map__cpu)
return MAP(bo->map__cpu);
{
DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle));
assert(!bo->scanout);
+ assert_tiling(kgem, bo);
+
kgem_bo_submit(kgem, bo);
/* SHM pixmaps use proxies for subpage offsets */
{
DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle));
assert(!bo->scanout || !write);
+ assert_tiling(kgem, bo);
if (write || bo->needs_flush)
kgem_bo_submit(kgem, bo);
DBG(("%s: handle=%d\n", __FUNCTION__, bo->handle));
assert(bo->refcnt);
assert(bo->proxy == NULL);
+ assert_tiling(kgem, bo);
kgem_bo_submit(kgem, bo);
int16_t dst_x, int16_t dst_y,
uint16_t width, uint16_t height)
{
+ assert(kgem->memcpy_to_tiled_x);
+ assert(src_x >= 0 && src_y >= 0);
+ assert(dst_x >= 0 && dst_y >= 0);
+ assert(8*src_stride >= (src_x+width) * bpp);
+ assert(8*dst_stride >= (dst_x+width) * bpp);
return kgem->memcpy_to_tiled_x(src, dst, bpp,
src_stride, dst_stride,
src_x, src_y,
int16_t dst_x, int16_t dst_y,
uint16_t width, uint16_t height)
{
+ assert(kgem->memcpy_from_tiled_x);
+ assert(src_x >= 0 && src_y >= 0);
+ assert(dst_x >= 0 && dst_y >= 0);
+ assert(8*src_stride >= (src_x+width) * bpp);
+ assert(8*dst_stride >= (dst_x+width) * bpp);
return kgem->memcpy_from_tiled_x(src, dst, bpp,
src_stride, dst_stride,
src_x, src_y,
return false;
if (priv->gpu_bo->tiling) {
+ int bpp = priv->pixmap->drawable.bitsPerPixel;
+ void *dst = priv->pixmap->devPrivate.ptr;
+ int dst_pitch = priv->pixmap->devKind;
+
DBG(("%s: download through a tiled CPU map\n", __FUNCTION__));
do {
DBG(("%s: box (%d, %d), (%d, %d)\n",
__FUNCTION__, box->x1, box->y1, box->x2, box->y2));
- memcpy_from_tiled_x(&sna->kgem, src,
- priv->pixmap->devPrivate.ptr,
- priv->pixmap->drawable.bitsPerPixel,
- priv->gpu_bo->pitch,
- priv->pixmap->devKind,
+ memcpy_from_tiled_x(&sna->kgem, src, dst, bpp,
+ priv->gpu_bo->pitch, dst_pitch,
box->x1, box->y1,
box->x1, box->y1,
box->x2 - box->x1, box->y2 - box->y1);
box++;
} while (--n);
} else {
+ int bpp = priv->pixmap->drawable.bitsPerPixel;
+ void *dst = priv->pixmap->devPrivate.ptr;
+ int dst_pitch = priv->pixmap->devKind;
+
DBG(("%s: download through a linear CPU map\n", __FUNCTION__));
do {
DBG(("%s: box (%d, %d), (%d, %d)\n",
__FUNCTION__, box->x1, box->y1, box->x2, box->y2));
- memcpy_blt(src,
- priv->pixmap->devPrivate.ptr,
- priv->pixmap->drawable.bitsPerPixel,
- priv->gpu_bo->pitch,
- priv->pixmap->devKind,
+ memcpy_blt(src, dst, bpp,
+ priv->gpu_bo->pitch, dst_pitch,
box->x1, box->y1,
box->x1, box->y1,
box->x2 - box->x1, box->y2 - box->y1);
get_drawable_deltas(drawable, pixmap, &dx, &dy);
x += dx + drawable->x;
y += dy + drawable->y;
+ assert(region->extents.x1 >= x);
+ assert(region->extents.y1 >= y);
+ assert(region->extents.x2 <= x + w);
+ assert(region->extents.y2 <= y + h);
if (try_upload__fast(pixmap, region, x, y, w, h, bits, stride))
return true;