xf86-video-intel: 2 commits - src/sna/gen6_common.h src/sna/sna_accel.c
Chris Wilson
ickle at kemper.freedesktop.org
Sat Mar 14 02:49:16 PDT 2015
src/sna/gen6_common.h | 9 ++++++---
src/sna/sna_accel.c | 20 ++++++++++++++++----
2 files changed, 22 insertions(+), 7 deletions(-)
New commits:
commit 9d0d78230aaf8863a96d75e8b57bb62e51121b8a
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Mar 13 23:07:59 2015 +0000
sna: Skip inplace operation to a busy clear GPU bo
Since clearing is a relatively trivial operation, allow us to do the
clear to a CPU bo rather than block on the GPU.
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 2713dde..eda4c33 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -527,10 +527,10 @@ sna_pixmap_alloc_cpu(struct sna *sna,
DBG(("%s: allocating CPU buffer (%dx%d)\n", __FUNCTION__,
pixmap->drawable.width, pixmap->drawable.height));
- hint = 0;
- if ((flags & MOVE_ASYNC_HINT) == 0 &&
- ((flags & MOVE_READ) == 0 || (priv->gpu_damage && !priv->clear && !sna->kgem.has_llc)))
- hint = CREATE_CPU_MAP | CREATE_INACTIVE | CREATE_NO_THROTTLE;
+ hint = CREATE_CPU_MAP | CREATE_INACTIVE | CREATE_NO_THROTTLE;
+ if ((flags & MOVE_ASYNC_HINT) ||
+ (priv->gpu_damage && !priv->clear && kgem_bo_is_busy(priv->gpu_bo) && sna->kgem.can_blt_cpu))
+ hint = 0;
priv->cpu_bo = kgem_create_cpu_2d(&sna->kgem,
pixmap->drawable.width,
@@ -1582,6 +1582,16 @@ static inline bool pixmap_inplace(struct sna *sna,
return false;
if (priv->gpu_bo && kgem_bo_is_busy(priv->gpu_bo)) {
+ if (priv->clear) {
+ DBG(("%s: no, clear GPU bo is busy\n", __FUNCTION__));
+ return false;
+ }
+
+ if (flags & MOVE_ASYNC_HINT) {
+ DBG(("%s: no, async hint and GPU bo is busy\n", __FUNCTION__));
+ return false;
+ }
+
if ((flags & (MOVE_WRITE | MOVE_READ)) == (MOVE_WRITE | MOVE_READ)) {
DBG(("%s: no, GPU bo is busy\n", __FUNCTION__));
return false;
@@ -2274,6 +2284,7 @@ skip_inplace_map:
(flags & MOVE_WRITE ? (void *)priv->gpu_bo : (void *)priv->gpu_damage) && priv->cpu_damage == NULL &&
priv->gpu_bo->tiling == I915_TILING_NONE &&
(flags & MOVE_READ || kgem_bo_can_map__cpu(&sna->kgem, priv->gpu_bo, flags & MOVE_WRITE)) &&
+ (!priv->clear || !kgem_bo_is_busy(priv->gpu_bo)) &&
((flags & (MOVE_WRITE | MOVE_ASYNC_HINT)) == 0 ||
(!priv->cow && !priv->move_to_gpu && !__kgem_bo_is_busy(&sna->kgem, priv->gpu_bo)))) {
void *ptr;
@@ -2337,6 +2348,7 @@ skip_inplace_map:
pixmap->devKind, pixmap->devKind * pixmap->drawable.height));
if (priv->cpu_bo) {
+ kgem_bo_undo(&sna->kgem, priv->cpu_bo);
if ((flags & MOVE_ASYNC_HINT || priv->cpu_bo->exec) &&
sna->kgem.can_blt_cpu &&
sna->render.fill_one(sna,
commit d8dd2b88a1f2bca63a2a6f42af035fd9fb1f685f
Author: Chris Wilson <chris at chris-wilson.co.uk>
Date: Fri Mar 13 22:27:31 2015 +0000
sna/gen6+: Demote BLT ring switching priority if semaphores are disabled
Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
diff --git a/src/sna/gen6_common.h b/src/sna/gen6_common.h
index bfdd66f..409bab3 100644
--- a/src/sna/gen6_common.h
+++ b/src/sna/gen6_common.h
@@ -106,12 +106,15 @@ static int prefer_blt_bo(struct sna *sna,
inline static bool force_blt_ring(struct sna *sna)
{
- if (sna->flags & SNA_POWERSAVE)
- return true;
-
if (sna->kgem.mode == KGEM_RENDER)
return false;
+ if (NO_RING_SWITCH(sna))
+ return sna->kgem.ring == KGEM_BLT;
+
+ if (sna->flags & SNA_POWERSAVE)
+ return true;
+
if (sna->render_state.gt < 2)
return true;
More information about the xorg-commit
mailing list