summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRussell King <rmk@arm.linux.org.uk>2014-07-23 11:31:20 +0100
committerRussell King <rmk@arm.linux.org.uk>2014-07-23 11:33:22 +0100
commitdfdbdf253c2893050551b88fecd6ec6cef6015d5 (patch)
tree7d3e2f27a7dd1e9972e9b1dd115bfebe1642e7dd
parentfbbbe515431f253e1790bc5c8c6dfe44c6a07165 (diff)
downloadxf86-video-armada-dfdbdf253c2893050551b88fecd6ec6cef6015d5.tar.gz
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 <rmk@arm.linux.org.uk>
-rw-r--r--src/vivante_utils.c10
1 files 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);
}