[PATCH RFC 094/111] staging: etnaviv: plug in fence waiting in cpu_prepare
Christian Gmeiner
christian.gmeiner at gmail.com
Sun Apr 5 11:51:17 PDT 2015
2015-04-02 17:30 GMT+02:00 Lucas Stach <l.stach at pengutronix.de>:
> 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
>
looks like a part from
https://github.com/austriancoder/linux/commit/0c347857d7eff27834bd82d5485c97c3b16339ce
--
Christian Gmeiner, MSc
https://soundcloud.com/christian-gmeiner
More information about the dri-devel
mailing list