summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2013-02-13 17:15:46 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2013-02-13 17:17:15 +0000
commitf2a64dbdfceac985d235c4873f52013633d6cfd8 (patch)
tree699d25a99c332092da83eaa590d61404e1fc2383
parent4bf51ec7bcc7818fbee8643a88aebee0362691b2 (diff)
sna: Avoid stalling on a SHM upload when otherwise idle
Fixes regresion from commit 09ea1f4402b3bd0e411b90eb5575b3ff066d7356 Author: Chris Wilson <chris@chris-wilson.co.uk> Date: Thu Jan 10 16:26:24 2013 +0000 sna: Prefer to use the GPU for copies from SHM onto tiled destinations As the stalls on IVB 64-bit machines at least greatly offset the benefits. As those earlier measurements were made on the same IVB machine but running in 32-bit mode, I need to double-check whether or not this is another 32-bit peculiarity. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c4
-rw-r--r--src/sna/sna_accel.c10
2 files changed, 6 insertions, 8 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 9f274619..e0f804e6 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -4737,7 +4737,9 @@ void kgem_bo_sync__cpu(struct kgem *kgem, struct kgem_bo *bo)
void kgem_bo_sync__cpu_full(struct kgem *kgem, struct kgem_bo *bo, bool write)
{
assert(bo->proxy == NULL);
- kgem_bo_submit(kgem, bo);
+
+ if (write || bo->needs_flush)
+ kgem_bo_submit(kgem, bo);
if (bo->domain != DOMAIN_CPU) {
struct drm_i915_gem_set_domain set_domain;
diff --git a/src/sna/sna_accel.c b/src/sna/sna_accel.c
index 134b72fc..12f078eb 100644
--- a/src/sna/sna_accel.c
+++ b/src/sna/sna_accel.c
@@ -4138,17 +4138,14 @@ static bool use_shm_bo(struct sna *sna,
DBG(("%s: yes, complex alu=%d\n", __FUNCTION__, alu));
return true;
}
- if (bo->tiling) {
- DBG(("%s:, yes, dst tiled=%d\n", __FUNCTION__, bo->tiling));
- return true;
- }
if (__kgem_bo_is_busy(&sna->kgem, bo)) {
DBG(("%s: yes, dst is busy\n", __FUNCTION__));
return true;
}
- if (__kgem_bo_is_busy(&sna->kgem, priv->cpu_bo)) {
+ if (priv->cpu_bo->needs_flush &&
+ __kgem_bo_is_busy(&sna->kgem, priv->cpu_bo)) {
DBG(("%s: yes, src is busy\n", __FUNCTION__));
return true;
}
@@ -4378,8 +4375,7 @@ sna_copy_boxes(DrawablePtr src, DrawablePtr dst, GCPtr gc,
src_priv == NULL &&
sna->kgem.has_userptr &&
box_inplace(src_pixmap, &region->extents) &&
- ((sna->kgem.has_llc && bo->tiling && !bo->scanout) ||
- __kgem_bo_is_busy(&sna->kgem, bo))) {
+ __kgem_bo_is_busy(&sna->kgem, bo)) {
struct kgem_bo *src_bo;
bool ok = false;