sna: Tweak is_cpu/is_gpu heuristics
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
c682c1a376
commit
d1b808fd72
|
|
@ -75,26 +75,34 @@ is_gpu(DrawablePtr drawable)
|
|||
if (priv == NULL || priv->clear)
|
||||
return false;
|
||||
|
||||
if (DAMAGE_IS_ALL(priv->gpu_damage) ||
|
||||
(priv->gpu_bo && kgem_bo_is_busy(priv->gpu_bo) && !priv->gpu_bo->proxy))
|
||||
if (priv->cpu_damage == NULL)
|
||||
return true;
|
||||
|
||||
return priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo);
|
||||
if (priv->gpu_damage && !priv->gpu_bo->proxy)
|
||||
return true;
|
||||
|
||||
if (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo))
|
||||
return true;
|
||||
|
||||
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->gpu_bo == NULL || priv->clear)
|
||||
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;
|
||||
|
||||
if (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue