diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2014-04-28 07:53:13 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2014-04-28 08:38:58 +0100 |
commit | 534a0e6433a37c95f7181f7ce9046a4e7c82532d (patch) | |
tree | cdf594a89b9d7da8b3bd9d908d0dc3a03c4ed774 /src/sna/sna_render.c | |
parent | 11cc397cb1cded40f7ab43c1add3fd00b97c6bdc (diff) |
sna: Factor in destination sizes for choosing intermediate tiling bo size
When tiling, factor in the destination usage of the aperture in case
that reduces the available aperture for the intermediate bo.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_render.c')
-rw-r--r-- | src/sna/sna_render.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/sna/sna_render.c b/src/sna/sna_render.c index 73dcf45b..b67bd26c 100644 --- a/src/sna/sna_render.c +++ b/src/sna/sna_render.c @@ -708,7 +708,7 @@ static int sna_render_picture_downsample(struct sna *sna, struct sna_pixmap *priv; pixman_transform_t t; PixmapPtr tmp; - int width, height, size; + int width, height, size, max_size; int sx, sy, sw, sh; int error, ret = 0; BoxRec box, b; @@ -818,8 +818,12 @@ fixup: ValidatePicture(tmp_src); /* Use a small size to accommodate enlargement through tile alignment */ + max_size = sna_max_tile_copy_size(sna, sna_pixmap(pixmap)->gpu_bo, priv->gpu_bo); + if (max_size == 0) + goto cleanup_dst; + size = sna->render.max_3d_size - 4096 / pixmap->drawable.bitsPerPixel; - while (size * size * 4 > sna->kgem.max_copy_tile_size) + while (size * size * 4 > max_size) size /= 2; sw = size / sx - 2 * sx; |