diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-20 11:07:55 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-20 11:09:29 +0100 |
commit | 74f998136bac441d782faf779616af6f7bdcadad (patch) | |
tree | 44da09e7122575e737ae5ac6302bde931555b9ab /src | |
parent | a05643eb670e91ab102465df799301def88faaf9 (diff) |
sna: Avoid migrating the BLT composite src to the GPU if the dst is not
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_blt.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/sna/sna_blt.c b/src/sna/sna_blt.c index 99671a9f..750d749b 100644 --- a/src/sna/sna_blt.c +++ b/src/sna/sna_blt.c @@ -1641,6 +1641,15 @@ prepare_blt_put(struct sna *sna, return true; } +static bool source_is_gpu(PixmapPtr pixmap, const BoxRec *box) +{ + struct sna_pixmap *priv = sna_pixmap(pixmap); + if (priv == NULL) + return false; + return sna_damage_contains_box(priv->gpu_damage, + box) != PIXMAN_REGION_OUT; +} + #define alphaless(format) PICT_FORMAT(PICT_FORMAT_BPP(format), \ PICT_FORMAT_TYPE(format), \ 0, \ @@ -1839,7 +1848,9 @@ clear: src_box.y1 = y; src_box.x2 = x + width; src_box.y2 = y + height; - bo = __sna_render_pixmap_bo(sna, src_pixmap, &src_box, true); + bo = NULL; + if (tmp->dst.bo || source_is_gpu(src_pixmap, &src_box)) + bo = __sna_render_pixmap_bo(sna, src_pixmap, &src_box, true); if (bo) { if (!tmp->dst.bo) tmp->dst.bo = sna_drawable_use_bo(dst->pDrawable, |