[PATCH RFC 094/111] staging: etnaviv: plug in fence waiting in cpu_prepare
Lucas Stach
l.stach at pengutronix.de
Thu Apr 2 08:30:36 PDT 2015
Allows userspace to properly synchronize with the GPU when accessing
buffers.
Signed-off-by: Lucas Stach <l.stach at pengutronix.de>
---
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
More information about the dri-devel
mailing list