diff options
author | Russell King <rmk+cubox@arm.linux.org.uk> | 2013-08-28 13:51:32 +0100 |
---|---|---|
committer | Russell King <rmk@arm.linux.org.uk> | 2013-10-29 19:21:12 +0000 |
commit | 9c63a8a7442131a6aa3ea8823a8b1390084c256c (patch) | |
tree | 4c485d1c0e0f8ffa4cb919396682df718e532860 | |
parent | 3b30840ff060b04e03d6d97c1305bdb81e07da36 (diff) |
Cleanup pixmap freeing
This makes it slightly more sane; as bos mapped via dmabuf are
refcounted, the order doesn't really matter, but it's nicer to
do it this way.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r-- | src/vivante.c | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/vivante.c b/src/vivante.c index 8ec42fe..210d5f8 100644 --- a/src/vivante.c +++ b/src/vivante.c @@ -91,14 +91,10 @@ void vivante_free_pixmap(PixmapPtr pixmap) vivante_batch_wait_commit(vivante, vPix); if (vPix->bo->type == DRM_ARMADA_BO_SHMEM && vPix->owner == GPU) vivante_unmap_gpu(vivante, vPix); - drm_armada_bo_put(vPix->bo); - /* - * Those vPix which still have a handle have been mapped - * to the GPU, and have to be unmapped. - */ - if (vPix->handle != -1) + if (vPix->bo->type != DRM_ARMADA_BO_SHMEM) vivante_unmap_from_gpu(vivante, vPix->info, vPix->handle); + drm_armada_bo_put(vPix->bo); free(vPix); } } |