diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2013-10-02 14:59:11 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2013-10-02 15:04:20 +0100 |
commit | a048f436a0210d076fc844404bf56b8b7fcb4b7b (patch) | |
tree | 7e6946177e7b7091ecb112fb0b861caed9eb68dc /src | |
parent | 660e9e14bd49fad75dd2fd73c285e035e2672da4 (diff) |
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>
Diffstat (limited to 'src')
-rw-r--r-- | src/sna/kgem.c | 2 |
1 files changed, 1 insertions, 1 deletions
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); |