Allows userspace to properly synchronize with the GPU when accessing buffers. Signed-off-by: Lucas Stach <l.stach@xxxxxxxxxxxxxx> --- drivers/staging/etnaviv/etnaviv_gem.c | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/etnaviv/etnaviv_gem.c b/drivers/staging/etnaviv/etnaviv_gem.c index 849d5cbb510c..57f3080fb632 100644 --- a/drivers/staging/etnaviv/etnaviv_gem.c +++ b/drivers/staging/etnaviv/etnaviv_gem.c @@ -467,28 +467,28 @@ void etnaviv_gem_move_to_inactive(struct drm_gem_object *obj) int etnaviv_gem_cpu_prep(struct drm_gem_object *obj, uint32_t op, struct timespec *timeout) { -/* + struct drm_device *dev = obj->dev; struct etnaviv_gem_object *etnaviv_obj = to_etnaviv_bo(obj); -*/ + int ret = 0; - /* TODO */ -#if 0 + if (is_active(etnaviv_obj)) { uint32_t fence = 0; - if (op & MSM_PREP_READ) + if (op & ETNA_PREP_READ) fence = etnaviv_obj->write_fence; - if (op & MSM_PREP_WRITE) + if (op & ETNA_PREP_WRITE) fence = max(fence, etnaviv_obj->read_fence); - if (op & MSM_PREP_NOSYNC) + if (op & ETNA_PREP_NOSYNC) timeout = NULL; - ret = etnaviv_wait_fence_interruptable(dev, fence, timeout); + ret = etnaviv_wait_fence_interruptable(dev, etnaviv_obj->gpu, + fence, timeout); } /* TODO cache maintenance */ -#endif + return ret; } -- 2.1.4 _______________________________________________ dri-devel mailing list dri-devel@xxxxxxxxxxxxxxxxxxxxx http://lists.freedesktop.org/mailman/listinfo/dri-devel