From dfdbdf253c2893050551b88fecd6ec6cef6015d5 Mon Sep 17 00:00:00 2001 From: Russell King Date: Wed, 23 Jul 2014 11:31:20 +0100 Subject: Fix bug in vivante pixmap dumping functions The vivante pixmap functions we not restoring the mapping state of the pixmap correctly. Fix this. Signed-off-by: Russell King --- src/vivante_utils.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/vivante_utils.c b/src/vivante_utils.c index a53459a..0567c61 100644 --- a/src/vivante_utils.c +++ b/src/vivante_utils.c @@ -307,11 +307,17 @@ static void dump_pix(struct vivante *vivante, struct vivante_pixmap *vPix, { struct drm_armada_bo *bo = vPix->bo; static int idx; + unsigned owner = vPix->owner; char fn[160], n[80]; int fd; - if (vPix->bo->type == DRM_ARMADA_BO_SHMEM && vPix->owner == GPU) + if (vPix->bo->type != DRM_ARMADA_BO_SHMEM) + owner = CPU; + + if (owner == GPU) { vivante_unmap_gpu(vivante, vPix); + vPix->owner = CPU; + } vsprintf(n, fmt, ap); sprintf(fn, "/tmp/X.%04u.%s-%u.%u.%u.%u.pam", @@ -345,7 +351,7 @@ static void dump_pix(struct vivante *vivante, struct vivante_pixmap *vPix, close(fd); } - if (vPix->owner == GPU && vPix->bo->type == DRM_ARMADA_BO_SHMEM) + if (owner == GPU) vivante_map_gpu(vivante, vPix); } -- cgit v1.2.3