From a048f436a0210d076fc844404bf56b8b7fcb4b7b Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Wed, 2 Oct 2013 14:59:11 +0100 Subject: [PATCH] sna: Only delete unused io buffers Before deleting the io buffer, we need to check that it is not active. Currently we check that it is not pending use in the current batch, but we also need to double check that it does not have outstanding use by the GPU. Failing to do so could mean overwriting the data prior to it being read by the GPU, a very small race but often hit! Reported-by: Vedran Rodic # and many others Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66990 Signed-off-by: Chris Wilson --- src/sna/kgem.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sna/kgem.c b/src/sna/kgem.c index 81ca65ef..eb511493 100644 --- a/src/sna/kgem.c +++ b/src/sna/kgem.c @@ -4568,7 +4568,7 @@ void _kgem_bo_destroy(struct kgem *kgem, struct kgem_bo *bo) if (bo->proxy) { _list_del(&bo->vma); _list_del(&bo->request); - if (bo->io && bo->exec == NULL) + if (bo->io && bo->exec == NULL && bo->domain == DOMAIN_CPU) _kgem_bo_delete_buffer(kgem, bo); kgem_bo_unref(kgem, bo->proxy); kgem_bo_binding_free(kgem, bo);