mirror of
https://github.com/X11Libre/xf86-video-intel.git
synced 2026-03-24 01:24:12 +00:00
sna: Refine decision whether to use the GPU or render inplace
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
@@ -1948,8 +1948,7 @@ sna_glyphs(CARD8 op,
|
||||
goto fallback;
|
||||
}
|
||||
|
||||
if ((too_small(priv) || DAMAGE_IS_ALL(priv->cpu_damage)) &&
|
||||
!picture_is_gpu(sna, src, 0)) {
|
||||
if (!is_gpu_dst(priv) && !picture_is_gpu(sna, src, 0)) {
|
||||
DBG(("%s: fallback -- too small (%dx%d)\n",
|
||||
__FUNCTION__, dst->pDrawable->width, dst->pDrawable->height));
|
||||
goto fallback;
|
||||
@@ -2278,8 +2277,7 @@ sna_glyphs__shared(CARD8 op,
|
||||
goto fallback;
|
||||
}
|
||||
|
||||
if ((too_small(priv) || DAMAGE_IS_ALL(priv->cpu_damage)) &&
|
||||
!picture_is_gpu(sna, src, 0)) {
|
||||
if (!is_gpu_dst(priv) && !picture_is_gpu(sna, src, 0)) {
|
||||
DBG(("%s: fallback -- too small (%dx%d)\n",
|
||||
__FUNCTION__, dst->pDrawable->width, dst->pDrawable->height));
|
||||
goto fallback;
|
||||
|
||||
@@ -92,6 +92,9 @@ is_gpu(struct sna *sna, DrawablePtr drawable, unsigned prefer)
|
||||
if (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo))
|
||||
return true;
|
||||
|
||||
if (DAMAGE_IS_ALL(priv->cpu_damage))
|
||||
return false;
|
||||
|
||||
return priv->gpu_bo && kgem_bo_is_busy(priv->gpu_bo);
|
||||
}
|
||||
|
||||
@@ -109,6 +112,26 @@ too_small(struct sna_pixmap *priv)
|
||||
return (priv->create & KGEM_CAN_CREATE_GPU) == 0;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
is_gpu_dst(struct sna_pixmap *priv)
|
||||
{
|
||||
assert(priv);
|
||||
|
||||
if (too_small(priv))
|
||||
return false;
|
||||
|
||||
if (priv->gpu_bo && kgem_bo_is_busy(priv->gpu_bo))
|
||||
return true;
|
||||
|
||||
if (priv->cpu_bo && kgem_bo_is_busy(priv->cpu_bo))
|
||||
return true;
|
||||
|
||||
if (DAMAGE_IS_ALL(priv->cpu_damage))
|
||||
return false;
|
||||
|
||||
return priv->gpu_damage == NULL && priv->cpu;
|
||||
}
|
||||
|
||||
static inline bool
|
||||
unattached(DrawablePtr drawable)
|
||||
{
|
||||
|
||||
@@ -595,12 +595,10 @@ sna_composite_trapezoids(CARD8 op,
|
||||
}
|
||||
|
||||
if (FORCE_FALLBACK == 0 &&
|
||||
(too_small(priv) || DAMAGE_IS_ALL(priv->cpu_damage)) &&
|
||||
!picture_is_gpu(sna, src, 0) && untransformed(src)) {
|
||||
DBG(("%s: force fallbacks -- (too small, %dx%d? %d || all-cpu? %d) && (src-is-cpu? %d && untransformed? %d)\n",
|
||||
!is_gpu_dst(priv) && !picture_is_gpu(sna, src, 0) && untransformed(src)) {
|
||||
DBG(("%s: force fallbacks -- (!gpu dst, %dx%d? %d) && (src-is-cpu? %d && untransformed? %d)\n",
|
||||
__FUNCTION__, dst->pDrawable->width, dst->pDrawable->height,
|
||||
too_small(priv), (int)DAMAGE_IS_ALL(priv->cpu_damage),
|
||||
!picture_is_gpu(sna, src, 0), untransformed(src)));
|
||||
!is_gpu_dst(priv), !picture_is_gpu(sna, src, 0), untransformed(src)));
|
||||
|
||||
force_fallback:
|
||||
force_fallback = true;
|
||||
|
||||
Reference in New Issue
Block a user