diff options
-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); |