From 9c63a8a7442131a6aa3ea8823a8b1390084c256c Mon Sep 17 00:00:00 2001 From: Russell King Date: Wed, 28 Aug 2013 13:51:32 +0100 Subject: 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 --- src/vivante.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'src') 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); } } -- cgit