sna: Only force a batch continuation if the scanout is written to
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
c16c16d255
commit
fc79af7a4a
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Reference in New Issue