summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk+cubox@arm.linux.org.uk>2013-08-28 11:38:52 +0100
committerRussell King <rmk@arm.linux.org.uk>2013-10-29 19:21:11 +0000
commita9c9360159431d97334cf8488eb36428b409fcd1 (patch)
treea181258a71968d773905d0174527412a1267df14
parenta0f8988f4eceefd5a9d30f17de971c070acb49b0 (diff)
downloadxf86-video-armada-a9c9360159431d97334cf8488eb36428b409fcd1.tar.gz
xf86-video-armada-a9c9360159431d97334cf8488eb36428b409fcd1.tar.xz
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.c2
-rw-r--r--src/vivante_utils.c20
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);