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>
This commit is contained in:
parent
410316d202
commit
01ebdb4d7a
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -87,32 +87,6 @@ is_gpu(DrawablePtr drawable)
|
|||
return priv->gpu_bo && kgem_bo_is_busy(priv->gpu_bo);
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue