From 4f62e0956893fe43594ba516a152a6c03a555dfe Mon Sep 17 00:00:00 2001 From: Russell King Date: Thu, 20 Mar 2014 17:57:38 +0000 Subject: Move owner checking into vivante_map_gpu() Move the pixmap owner checking into vivante_map_gpu(), which is where the ownership is switched. This helps to keep all that logic localised. Signed-off-by: Russell King --- src/vivante_accel.c | 2 +- src/vivante_utils.c | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vivante_accel.c b/src/vivante_accel.c index 9999d72..1afbda4 100644 --- a/src/vivante_accel.c +++ b/src/vivante_accel.c @@ -304,7 +304,7 @@ gal_prepare_gpu(struct vivante *vivante, struct vivante_pixmap *vPix, vivante_batch_wait(vivante, vPix); #endif - if (vPix->owner != GPU && !vivante_map_gpu(vivante, vPix)) + if (!vivante_map_gpu(vivante, vPix)) return FALSE; /* diff --git a/src/vivante_utils.c b/src/vivante_utils.c index 0a42a35..bae3221 100644 --- a/src/vivante_utils.c +++ b/src/vivante_utils.c @@ -165,6 +165,9 @@ Bool vivante_map_gpu(struct vivante *vivante, struct vivante_pixmap *vPix) assert(vPix->in_use == 0); #endif + if (vPix->owner == GPU) + return TRUE; + if (bo->type == DRM_ARMADA_BO_SHMEM) { gceSTATUS err; gctUINT32 addr; -- cgit