diff options
author | Russell King <rmk+cubox@arm.linux.org.uk> | 2013-08-28 11:38:52 +0100 |
---|---|---|
committer | Russell King <rmk@arm.linux.org.uk> | 2013-10-29 19:21:11 +0000 |
commit | a9c9360159431d97334cf8488eb36428b409fcd1 (patch) | |
tree | a181258a71968d773905d0174527412a1267df14 | |
parent | a0f8988f4eceefd5a9d30f17de971c070acb49b0 (diff) |
Move checks out of vivante_unmap_gpu()
Move the checks to the caller for vivante_unmap_gpu(), so that all
callsites behave in the same way.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
-rw-r--r-- | src/vivante.c | 2 | ||||
-rw-r--r-- | src/vivante_utils.c | 20 |
2 files changed, 10 insertions, 12 deletions
diff --git a/src/vivante.c b/src/vivante.c index c072e73..b113942 100644 --- a/src/vivante.c +++ b/src/vivante.c @@ -82,7 +82,7 @@ void vivante_free_pixmap(PixmapPtr pixmap) if (vPix) { vivante = vivante_get_screen_priv(pixmap->drawable.pScreen); vivante_batch_wait_commit(vivante, vPix); - if (vPix->owner == GPU) + if (vPix->bo->type == DRM_ARMADA_BO_SHMEM && vPix->owner == GPU) vivante_unmap_gpu(vivante, vPix); drm_armada_bo_put(vPix->bo); /* diff --git a/src/vivante_utils.c b/src/vivante_utils.c index 04a01cc..086f0a0 100644 --- a/src/vivante_utils.c +++ b/src/vivante_utils.c @@ -90,20 +90,18 @@ PixmapPtr vivante_drawable_pixmap_deltas(DrawablePtr pDrawable, int *x, int *y) void vivante_unmap_gpu(struct vivante *vivante, struct vivante_pixmap *vPix) { struct drm_armada_bo *bo = vPix->bo; + gceSTATUS err; - if (bo->type == DRM_ARMADA_BO_SHMEM) { - gceSTATUS err; #ifdef DEBUG_MAP - dbg("Unmapping vPix %p bo %p\n", vPix, bo); + dbg("Unmapping vPix %p bo %p\n", vPix, bo); #endif - err = gcoOS_UnmapUserMemory(vivante->os, bo->ptr, bo->size, - vPix->info, vPix->handle); - if (err != gcvSTATUS_OK) - vivante_error(vivante, "gcoOS_UnmapUserMemory", err); + err = gcoOS_UnmapUserMemory(vivante->os, bo->ptr, bo->size, + vPix->info, vPix->handle); + if (err != gcvSTATUS_OK) + vivante_error(vivante, "gcoOS_UnmapUserMemory", err); - vPix->handle = -1; - vPix->info = NULL; - } + vPix->handle = -1; + vPix->info = NULL; } /* @@ -253,7 +251,7 @@ static void dump_pix(struct vivante *vivante, struct vivante_pixmap *vPix, char fn[160], n[80]; int fd; - if (vPix->owner == GPU) + if (vPix->bo->type == DRM_ARMADA_BO_SHMEM && vPix->owner == GPU) vivante_unmap_gpu(vivante, vPix); vsprintf(n, fmt, ap); |