diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-07-18 10:31:18 +0100 |
---|---|---|
committer | Daniel Vetter <daniel.vetter@ffwll.ch> | 2016-07-19 08:31:49 +0200 |
commit | bf0901731ddf68e8c6d52d7fc0841fe3d4f66847 (patch) | |
tree | 418b7305193076fcfc9812e11844e8d9f40f422c /drivers/gpu/drm/vgem | |
parent | a026df4c5fa6bae8eb03b58be720b911494e3da5 (diff) | |
download | linux-stable-bf0901731ddf68e8c6d52d7fc0841fe3d4f66847.tar.gz linux-stable-bf0901731ddf68e8c6d52d7fc0841fe3d4f66847.tar.bz2 linux-stable-bf0901731ddf68e8c6d52d7fc0841fe3d4f66847.zip |
drm/vgem: Remember to offset relative timeouts to mod_timer() by jiffies
mod_timer() takes an absolute jiffie value, not a relative timeout and
quietly fixup the missed ret=0 otherwise gcc just always returns that
the fence timed out.
Testcase: igt/vgem_basic/fence
Fixes: 407779848445 ("drm/vgem: Attach sw fences to exported vGEM dma-buf")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/1468834278-26716-1-git-send-email-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/vgem')
-rw-r--r-- | drivers/gpu/drm/vgem/vgem_fence.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c index e77b52208699..892417ba2622 100644 --- a/drivers/gpu/drm/vgem/vgem_fence.c +++ b/drivers/gpu/drm/vgem/vgem_fence.c @@ -107,7 +107,7 @@ static struct fence *vgem_fence_create(struct vgem_file *vfile, setup_timer(&fence->timer, vgem_fence_timeout, (unsigned long)fence); /* We force the fence to expire within 10s to prevent driver hangs */ - mod_timer(&fence->timer, VGEM_FENCE_TIMEOUT); + mod_timer(&fence->timer, jiffies + VGEM_FENCE_TIMEOUT); return &fence->base; } @@ -240,7 +240,7 @@ int vgem_fence_signal_ioctl(struct drm_device *dev, struct vgem_file *vfile = file->driver_priv; struct drm_vgem_fence_signal *arg = data; struct fence *fence; - int ret; + int ret = 0; if (arg->flags) return -EINVAL; |