diff options
author | Christian Gmeiner <christian.gmeiner@gmail.com> | 2016-11-23 22:02:25 +0100 |
---|---|---|
committer | Christian Gmeiner <christian.gmeiner@gmail.com> | 2016-11-24 20:08:45 +0100 |
commit | 4f750ec756e66e1012b312dbc7f2d11fc9848ce2 (patch) | |
tree | 1c0bc986148e8774859b2743bb2417f6eb5109c9 /etnaviv | |
parent | 1924b6704aa34bb3dd044b8e1e29558c521c6902 (diff) | |
download | libdrm-4f750ec756e66e1012b312dbc7f2d11fc9848ce2.tar.gz libdrm-4f750ec756e66e1012b312dbc7f2d11fc9848ce2.tar.bz2 libdrm-4f750ec756e66e1012b312dbc7f2d11fc9848ce2.zip |
etnaviv: change get_abs_timeout(..) to use ns.
Also update all callers.
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Diffstat (limited to 'etnaviv')
-rw-r--r-- | etnaviv/etnaviv_bo.c | 2 | ||||
-rw-r--r-- | etnaviv/etnaviv_pipe.c | 2 | ||||
-rw-r--r-- | etnaviv/etnaviv_priv.h | 6 |
3 files changed, 5 insertions, 5 deletions
diff --git a/etnaviv/etnaviv_bo.c b/etnaviv/etnaviv_bo.c index 833f8bd4..4ad0434e 100644 --- a/etnaviv/etnaviv_bo.c +++ b/etnaviv/etnaviv_bo.c @@ -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)); diff --git a/etnaviv/etnaviv_pipe.c b/etnaviv/etnaviv_pipe.c index 402b71d6..1157fa6c 100644 --- a/etnaviv/etnaviv_pipe.c +++ b/etnaviv/etnaviv_pipe.c @@ -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) { diff --git a/etnaviv/etnaviv_priv.h b/etnaviv/etnaviv_priv.h index eb62ed33..feaa5ad9 100644 --- a/etnaviv/etnaviv_priv.h +++ b/etnaviv/etnaviv_priv.h @@ -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_ */ |