summaryrefslogtreecommitdiff
path: root/src/sna
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-06-12 09:26:14 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-12 09:26:14 +0100
commit93444ea673be0ac11092a13ab3354f886f4aad63 (patch)
treeb39f9e90a77f0aa74129c590cea65925c1aa4593 /src/sna
parentabbf6d6b7962650607dc3517939991de56ce8a91 (diff)
sna: Refactor USE_INPLACE debug macro
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r--src/sna/sna_accel.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index b3569bfe..773af6f4 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -2004,6 +2004,9 @@ sna_pixmap_make_cow(struct sna *sna,
static inline bool operate_inplace(struct sna_pixmap *priv, unsigned flags)
{
+ if (!USE_INPLACE)
+ return false;
+
if ((flags & MOVE_INPLACE_HINT) == 0) {
DBG(("%s: no, inplace operation not suitable\n", __FUNCTION__));
return false;
@@ -2166,8 +2169,7 @@ skip_inplace_map:
assert(priv->gpu_bo == NULL || priv->gpu_bo->proxy == NULL);
- if (USE_INPLACE &&
- operate_inplace(priv, flags) &&
+ if (operate_inplace(priv, flags) &&
pixmap_inplace(sna, pixmap, priv, flags) &&
sna_pixmap_create_mappable_gpu(pixmap, (flags & MOVE_READ) == 0)) {
void *ptr;
@@ -2623,8 +2625,7 @@ sna_drawable_move_region_to_cpu(DrawablePtr drawable,
RegionTranslate(region, dx, dy);
}
- if (USE_INPLACE &&
- operate_inplace(priv, flags) &&
+ if (operate_inplace(priv, flags) &&
region_inplace(sna, pixmap, region, priv, flags) &&
sna_pixmap_create_mappable_gpu(pixmap, false)) {
void *ptr;