summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-01-05 23:06:17 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-01-05 23:44:13 +0000
commitfc79af7a4abf1f0ceccacf23e8467ee2872eec09 (patch)
treea7c5aa7415d26501801de1e447a99569fb0182eb
parentc16c16d2553aa9a8bf9b0b0b367715b59020a357 (diff)
sna: Only force a batch continuation if the scanout is written to
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
-rw-r--r--src/sna/kgem.c6
-rw-r--r--src/sna/kgem.h2
-rw-r--r--src/sna/sna_display.c4
3 files changed, 10 insertions, 2 deletions
diff --git a/src/sna/kgem.c b/src/sna/kgem.c
index 24a47aaf..58df9352 100644
--- a/src/sna/kgem.c
+++ b/src/sna/kgem.c
@@ -725,6 +725,7 @@ void _kgem_add_bo(struct kgem *kgem, struct kgem_bo *bo)
/* XXX is it worth working around gcc here? */
kgem->flush |= bo->flush;
kgem->sync |= bo->sync;
+ kgem->scanout |= bo->scanout;
}
static uint32_t kgem_end_batch(struct kgem *kgem)
@@ -840,7 +841,7 @@ static void __kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo)
}
assert(bo->vmap == false && bo->sync == false);
- bo->flush = false;
+ bo->scanout = bo->flush = false;
if (bo->rq) {
DBG(("%s: handle=%d -> active\n", __FUNCTION__, bo->handle));
@@ -1192,6 +1193,7 @@ void kgem_reset(struct kgem *kgem)
kgem->surface = kgem->max_batch_size;
kgem->mode = KGEM_NONE;
kgem->flush = 0;
+ kgem->scanout = 0;
kgem->next_request = __kgem_request_alloc();
@@ -1388,8 +1390,8 @@ void _kgem_submit(struct kgem *kgem)
if (kgem->wedged)
kgem_cleanup(kgem);
+ kgem->flush_now = kgem->scanout;
kgem_reset(kgem);
- kgem->flush_now = 1;
assert(kgem->next_request != NULL);
}
diff --git a/src/sna/kgem.h b/src/sna/kgem.h
index 6aeb1fe2..e5b7ccf2 100644
--- a/src/sna/kgem.h
+++ b/src/sna/kgem.h
@@ -75,6 +75,7 @@ struct kgem_bo {
uint32_t vmap : 1;
uint32_t io : 1;
uint32_t flush : 1;
+ uint32_t scanout : 1;
uint32_t sync : 1;
uint32_t purged : 1;
};
@@ -124,6 +125,7 @@ struct kgem {
uint32_t need_expire:1;
uint32_t need_purge:1;
uint32_t need_retire:1;
+ uint32_t scanout:1;
uint32_t flush_now:1;
uint32_t busy:1;
diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c
index 8e141c61..2b0dbc6b 100644
--- a/src/sna/sna_display.c
+++ b/src/sna/sna_display.c
@@ -428,6 +428,7 @@ sna_crtc_restore(struct sna *sna)
return;
assert(bo->tiling != I915_TILING_Y);
+ bo->scanout = true;
DBG(("%s: create fb %dx%d@%d/%d\n",
__FUNCTION__,
@@ -646,6 +647,7 @@ sna_crtc_set_mode_major(xf86CrtcPtr crtc, DisplayModePtr mode,
scrn->depth, scrn->bitsPerPixel));
assert(bo->tiling != I915_TILING_Y);
+ bo->scanout = true;
ret = drmModeAddFB(sna->kgem.fd,
scrn->virtualX, scrn->virtualY,
scrn->depth, scrn->bitsPerPixel,
@@ -762,6 +764,7 @@ sna_crtc_shadow_allocate(xf86CrtcPtr crtc, int width, int height)
}
assert(bo->tiling != I915_TILING_Y);
+ bo->scanout = true;
if (drmModeAddFB(sna->kgem.fd,
width, height, scrn->depth, scrn->bitsPerPixel,
bo->pitch, bo->handle,
@@ -1670,6 +1673,7 @@ sna_crtc_resize(ScrnInfoPtr scrn, int width, int height)
goto fail;
assert(bo->tiling != I915_TILING_Y);
+ bo->scanout = true;
if (drmModeAddFB(sna->kgem.fd, width, height,
scrn->depth, scrn->bitsPerPixel,
bo->pitch, bo->handle,