summaryrefslogtreecommitdiff
path: root/src/vivante_accel.c
diff options
context:
space:
mode:
authorRussell King <rmk+cubox@arm.linux.org.uk>2013-08-28 11:15:25 +0100
committerRussell King <rmk@arm.linux.org.uk>2013-10-29 19:21:10 +0000
commita0f8988f4eceefd5a9d30f17de971c070acb49b0 (patch)
tree5dc442af8605dce3ab1e4b8e5f3fd589c8de76af /src/vivante_accel.c
parentebf342580709fc974f6be49edb59bfd82af54111 (diff)
Only call vivante_map_gpu() if the pixmap isn't already mapped to the GPU.
Signed-off-by: Russell King <rmk@arm.linux.org.uk>
Diffstat (limited to 'src/vivante_accel.c')
-rw-r--r--src/vivante_accel.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/vivante_accel.c b/src/vivante_accel.c
index bbfd934..f86a35f 100644
--- a/src/vivante_accel.c
+++ b/src/vivante_accel.c
@@ -277,9 +277,15 @@ gal_prepare_gpu(struct vivante *vivante, struct vivante_pixmap *vPix,
vivante_batch_wait(vivante, vPix);
- if (!vivante_map_gpu(vivante, vPix))
+ if (vPix->owner != GPU && !vivante_map_gpu(vivante, vPix))
return FALSE;
+ /*
+ * This should never happen - if it does, and we proceeed, we will
+ * take the machine out, so assert and kill ourselves instead.
+ */
+ assert(vPix->handle != 0 && vPix->handle != -1);
+
switch (id) {
case GPU2D_Target:
err = gco2D_SetTarget(vivante->e2d, vPix->handle, vPix->pitch,