diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-07-06 18:30:47 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-07-06 22:54:02 +0100 |
commit | 1fbf47ec1bed888c1b7c8dcbeb01d8e067727c82 (patch) | |
tree | d265fd26a5cfd2409f534d8a1745e8f67c9771e0 /src | |
parent | 5aaab9ea0310d48bb1a1ca20308d1c9721a9de3f (diff) |
sna: Tune inplace hints for CPU operations with GPU targets
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/sna_accel.c | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c index da1ca409..f99df541 100644 --- a/src/sna/sna_accel.c +++ b/src/sna/sna_accel.c @@ -1446,10 +1446,16 @@ static inline bool pixmap_inplace(struct sna *sna, if (wedged(sna) && !priv->pinned) return false; + if (priv->gpu_damage && + (priv->clear || (flags & MOVE_READ) == 0) && + kgem_bo_is_busy(priv->gpu_bo)) + return false; + if (priv->mapped) return has_coherent_map(sna, priv->gpu_bo, flags); - if (flags & MOVE_READ && priv->cpu_damage) + if (flags & MOVE_READ && + (priv->cpu || priv->cpu_damage || priv->gpu_damage == NULL)) return false; return (pixmap->devKind * pixmap->drawable.height >> 12) > @@ -2160,14 +2166,14 @@ static inline bool region_inplace(struct sna *sna, if (wedged(sna) && !priv->pinned) return false; - if ((priv->cpu || flags & MOVE_READ) && - region_overlaps_damage(region, priv->cpu_damage, 0, 0)) { - DBG(("%s: no, uncovered CPU damage pending\n", __FUNCTION__)); + if (priv->gpu_damage && + (priv->clear || (flags & MOVE_READ) == 0) && + kgem_bo_is_busy(priv->gpu_bo)) return false; - } - if (priv->cpu) { - DBG(("%s: no, preferring last action of CPU\n", __FUNCTION__)); + if (flags & MOVE_READ && + (priv->cpu || region_overlaps_damage(region, priv->cpu_damage, 0, 0))) { + DBG(("%s: no, uncovered CPU damage pending\n", __FUNCTION__)); return false; } |