summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2012-02-20 09:52:37 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2012-02-20 09:52:37 +0000
commit7f0a4a5f7224003a0cd226137de5a068949a41b4 (patch)
treeeea3653ac4f69ef143feddc74cb24997d7fa29a7 /src
parent7d147c7462ba183f5316e7e8dafeca62add6f97c (diff)
sna/dri: Ensure the domain tracking is reset when releasing bo used for swaps
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src')
-rw-r--r--src/sna/sna_dri.c31
1 files changed, 19 insertions, 12 deletions
diff --git a/src/sna/sna_dri.c b/src/sna/sna_dri.c
index 0689fc5a..2a25cbdc 100644
--- a/src/sna/sna_dri.c
+++ b/src/sna/sna_dri.c
@@ -710,6 +710,14 @@ sna_dri_add_frame_event(struct sna_dri_frame_event *info)
}
static void
+sna_dri_frame_event_release_bo(struct kgem *kgem, struct kgem_bo *bo)
+{
+ bo->needs_flush = true; /* has been used externally, reset domains */
+ bo->reusable = true; /* No longer in use by an external client */
+ kgem_bo_destroy(kgem, bo);
+}
+
+static void
sna_dri_frame_event_info_free(struct sna_dri_frame_event *info)
{
DBG(("%s: del[%p] (%p, %ld)\n", __FUNCTION__,
@@ -721,18 +729,17 @@ sna_dri_frame_event_info_free(struct sna_dri_frame_event *info)
_sna_dri_destroy_buffer(info->sna, info->front);
_sna_dri_destroy_buffer(info->sna, info->back);
- if (info->old_front.bo) {
- info->old_front.bo->reusable = true;
- kgem_bo_destroy(&info->sna->kgem, info->old_front.bo);
- }
- if (info->next_front.bo) {
- info->next_front.bo->reusable = true;
- kgem_bo_destroy(&info->sna->kgem, info->next_front.bo);
- }
- if (info->cache.bo) {
- info->cache.bo->reusable = true;
- kgem_bo_destroy(&info->sna->kgem, info->cache.bo);
- }
+ if (info->old_front.bo)
+ sna_dri_frame_event_release_bo(&info->sna->kgem,
+ info->old_front.bo);
+
+ if (info->next_front.bo)
+ sna_dri_frame_event_release_bo(&info->sna->kgem,
+ info->next_front.bo);
+
+ if (info->cache.bo)
+ sna_dri_frame_event_release_bo(&info->sna->kgem,
+ info->cache.bo);
free(info);
}