diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-05-14 09:00:08 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-05-14 16:18:42 +0100 |
commit | f71447998cc8e22570cd5641bcf008cb68e9f4a3 (patch) | |
tree | 6a07f97f2c3add006018f389788ae5fa4aa0190d /src/sna/sna_dri2.c | |
parent | 3c95efe5f7989d95153f527eb7d2946d3bbc2af1 (diff) |
sna/dri2: Refactor open-coded __kgem_bo_is_busy
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_dri2.c')
-rw-r--r-- | src/sna/sna_dri2.c | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/sna/sna_dri2.c b/src/sna/sna_dri2.c index ca9251ae..59877e92 100644 --- a/src/sna/sna_dri2.c +++ b/src/sna/sna_dri2.c @@ -2553,22 +2553,15 @@ static inline bool rq_is_busy(struct kgem *kgem, struct kgem_bo *bo) if (bo == NULL) return false; - DBG(("%s: handle=%d, domain: %d exec? %d, rq? %d\n", __FUNCTION__, - bo->handle, bo->domain, bo->exec != NULL, bo->rq != NULL)); - assert(bo->refcnt); - - if (bo->exec) - return true; - - if (bo->rq == NULL) - return false; - - return __kgem_busy(kgem, bo->handle); + return __kgem_bo_is_busy(kgem, bo); } static bool sna_dri2_blit_complete(struct sna_dri2_event *info) { - if (rq_is_busy(&info->sna->kgem, info->bo)) { + if (!info->bo) + return true; + + if (__kgem_bo_is_busy(&info->sna->kgem, info->bo)) { DBG(("%s: vsync'ed blit is still busy, postponing\n", __FUNCTION__)); if (sna_next_vblank(info)) @@ -2578,10 +2571,9 @@ static bool sna_dri2_blit_complete(struct sna_dri2_event *info) } DBG(("%s: blit finished\n", __FUNCTION__)); - if (info->bo) { - kgem_bo_destroy(&info->sna->kgem, info->bo); - info->bo = NULL; - } + kgem_bo_destroy(&info->sna->kgem, info->bo); + info->bo = NULL; + return true; } |