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 <vrodic@gmail.com> # and many others
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66990
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2013-10-02 14:59:11 +01:00
parent 660e9e14bd
commit a048f436a0
1 changed files with 1 additions and 1 deletions

View File

@ -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);