OSDN Git Service

etnaviv: change get_abs_timeout(..) to use ns.
authorChristian Gmeiner <christian.gmeiner@gmail.com>
Wed, 23 Nov 2016 21:02:25 +0000 (22:02 +0100)
committerChristian Gmeiner <christian.gmeiner@gmail.com>
Thu, 24 Nov 2016 19:08:45 +0000 (20:08 +0100)
Also update all callers.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
etnaviv/etnaviv_bo.c
etnaviv/etnaviv_pipe.c
etnaviv/etnaviv_priv.h

index 833f8bd..4ad0434 100644 (file)
@@ -330,7 +330,7 @@ int etna_bo_cpu_prep(struct etna_bo *bo, uint32_t op)
                .op = op,
        };
 
-       get_abs_timeout(&req.timeout, 5000);
+       get_abs_timeout(&req.timeout, 5000000000);
 
        return drmCommandWrite(bo->dev->fd, DRM_ETNAVIV_GEM_CPU_PREP,
                        &req, sizeof(req));
index 402b71d..1157fa6 100644 (file)
@@ -43,7 +43,7 @@ int etna_pipe_wait(struct etna_pipe *pipe, uint32_t timestamp, uint32_t ms)
        if (ms == 0)
                req.flags |= ETNA_WAIT_NONBLOCK;
 
-       get_abs_timeout(&req.timeout, ms);
+       get_abs_timeout(&req.timeout, ms * 1000000);
 
        ret = drmCommandWrite(dev->fd, DRM_ETNAVIV_WAIT_FENCE, &req, sizeof(req));
        if (ret) {
index eb62ed3..feaa5ad 100644 (file)
@@ -189,13 +189,13 @@ struct etna_cmd_stream_priv {
 
 #define VOID2U64(x) ((uint64_t)(unsigned long)(x))
 
-static inline void get_abs_timeout(struct drm_etnaviv_timespec *tv, uint32_t ms)
+static inline void get_abs_timeout(struct drm_etnaviv_timespec *tv, uint64_t ns)
 {
        struct timespec t;
-       uint32_t s = ms / 1000;
+       uint32_t s = ns / 1000000000;
        clock_gettime(CLOCK_MONOTONIC, &t);
        tv->tv_sec = t.tv_sec + s;
-       tv->tv_nsec = t.tv_nsec + ((ms - (s * 1000)) * 1000000);
+       tv->tv_nsec = t.tv_nsec + ns - (s * 1000000000);
 }
 
 #endif /* ETNAVIV_PRIV_H_ */