diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-20 15:33:26 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2012-08-20 16:06:13 +0100 |
commit | 01ebdb4d7a8bb751167153554f9122d996e4ea91 (patch) | |
tree | e8aad71fc2ff239996452845be90d6f553b13969 | |
parent | 410316d20299b9ed3447d1d897f904af786ed097 (diff) |
sna: Remove confusing is_cpu()
The only real user now has its own heuristics, so convert the remaining
users over to !is_gpu().
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r-- | src/sna/gen2_render.c | 3 | ||||
-rw-r--r-- | src/sna/gen3_render.c | 2 | ||||
-rw-r--r-- | src/sna/gen4_render.c | 4 | ||||
-rw-r--r-- | src/sna/gen5_render.c | 5 | ||||
-rw-r--r-- | src/sna/sna_render_inline.h | 26 |
5 files changed, 7 insertions, 33 deletions
diff --git a/src/sna/gen2_render.c b/src/sna/gen2_render.c index 31859b45..fea1791d 100644 --- a/src/sna/gen2_render.c +++ b/src/sna/gen2_render.c @@ -1479,7 +1479,8 @@ try_blt(struct sna *sna, src->pDrawable->width, src->pDrawable->height)); return true; } - return is_cpu(src->pDrawable); + + return !is_gpu(src->pDrawable); } static bool diff --git a/src/sna/gen3_render.c b/src/sna/gen3_render.c index 48f104e4..72a25759 100644 --- a/src/sna/gen3_render.c +++ b/src/sna/gen3_render.c @@ -2428,7 +2428,7 @@ source_use_blt(struct sna *sna, PicturePtr picture) if (too_large(picture->pDrawable->width, picture->pDrawable->height)) return true; - return is_cpu(picture->pDrawable) || is_dirty(picture->pDrawable); + return !is_gpu(picture->pDrawable); } static bool diff --git a/src/sna/gen4_render.c b/src/sna/gen4_render.c index a56ef797..d72a2fd7 100644 --- a/src/sna/gen4_render.c +++ b/src/sna/gen4_render.c @@ -1996,7 +1996,7 @@ picture_is_cpu(PicturePtr picture) if (!picture->pDrawable) return false; - return is_cpu(picture->pDrawable) || is_dirty(picture->pDrawable); + return !is_gpu(picture->pDrawable); } static inline bool prefer_blt(struct sna *sna) @@ -2063,7 +2063,7 @@ untransformed(PicturePtr p) static bool need_upload(PicturePtr p) { - return p->pDrawable && untransformed(p) && is_cpu(p->pDrawable); + return p->pDrawable && untransformed(p) && !is_gpu(p->pDrawable); } static bool diff --git a/src/sna/gen5_render.c b/src/sna/gen5_render.c index 71e77a47..9b976c82 100644 --- a/src/sna/gen5_render.c +++ b/src/sna/gen5_render.c @@ -2012,8 +2012,7 @@ picture_is_cpu(PicturePtr picture) if (!picture->pDrawable) return false; - - return is_cpu(picture->pDrawable) || is_dirty(picture->pDrawable); + return !is_gpu(picture->pDrawable); } static bool @@ -2073,7 +2072,7 @@ untransformed(PicturePtr p) static bool need_upload(PicturePtr p) { - return p->pDrawable && untransformed(p) && is_cpu(p->pDrawable); + return p->pDrawable && untransformed(p) && !is_gpu(p->pDrawable); } static bool diff --git a/src/sna/sna_render_inline.h b/src/sna/sna_render_inline.h index 3849a880..64f8a46f 100644 --- a/src/sna/sna_render_inline.h +++ b/src/sna/sna_render_inline.h @@ -88,32 +88,6 @@ is_gpu(DrawablePtr drawable) } static inline bool -is_cpu(DrawablePtr drawable) -{ - struct sna_pixmap *priv = sna_pixmap_from_drawable(drawable); - if (priv == NULL || priv->clear) - return true; - - if (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo)) - return false; - - if (DAMAGE_IS_ALL(priv->cpu_damage)) - return true; - - if (priv->gpu_damage && kgem_bo_is_busy(priv->gpu_bo)) - return false; - - return true; -} - -static inline bool -is_dirty(DrawablePtr drawable) -{ - struct sna_pixmap *priv = sna_pixmap_from_drawable(drawable); - return priv == NULL || kgem_bo_is_dirty(priv->gpu_bo); -} - -static inline bool too_small(struct sna_pixmap *priv) { assert(priv); |