summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/vgem
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2019-06-14 22:36:04 +0200
committerDaniel Vetter <daniel.vetter@ffwll.ch>2019-06-21 22:20:20 +0200
commit7b0cdf3e56b9b0bd05afa4904dc249c0f22dd30b (patch)
tree13c484ab59d58d7e8c3bb2b3ecf3b7c67f377fc2 /drivers/gpu/drm/vgem
parent5f6ed9879a414636405a2bd77f122881695959e4 (diff)
drm/vgem: Ditch attach trickery in the fence ioctl
It looks like this was done purely to get a consistent place to look up the reservation object pointer. With the drm_prime.c helper code now also setting gem_object->resv for imported objects we can just use that pointer directly, instead of first ensuring a dma-buf exists. v2: Note that I screwed up the patch ordering, hence why this needed a Fixes: tag - CI spotted the broken intermediate state. Fixes: 5eab998741c8 ("drm/vgem: Drop drm_gem_prime_export") Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20190614203615.12639-49-daniel.vetter@ffwll.ch
Diffstat (limited to 'drivers/gpu/drm/vgem')
-rw-r--r--drivers/gpu/drm/vgem/vgem_fence.c22
1 files changed, 1 insertions, 21 deletions
diff --git a/drivers/gpu/drm/vgem/vgem_fence.c b/drivers/gpu/drm/vgem/vgem_fence.c
index 72d43d5ec5ab..08997fdd3ccb 100644
--- a/drivers/gpu/drm/vgem/vgem_fence.c
+++ b/drivers/gpu/drm/vgem/vgem_fence.c
@@ -100,22 +100,6 @@ static struct dma_fence *vgem_fence_create(struct vgem_file *vfile,
return &fence->base;
}
-static int attach_dmabuf(struct drm_device *dev,
- struct drm_gem_object *obj)
-{
- struct dma_buf *dmabuf;
-
- if (obj->dma_buf)
- return 0;
-
- dmabuf = dev->driver->gem_prime_export(obj, 0);
- if (IS_ERR(dmabuf))
- return PTR_ERR(dmabuf);
-
- obj->dma_buf = dmabuf;
- return 0;
-}
-
/*
* vgem_fence_attach_ioctl (DRM_IOCTL_VGEM_FENCE_ATTACH):
*
@@ -157,10 +141,6 @@ int vgem_fence_attach_ioctl(struct drm_device *dev,
if (!obj)
return -ENOENT;
- ret = attach_dmabuf(dev, obj);
- if (ret)
- goto err;
-
fence = vgem_fence_create(vfile, arg->flags);
if (!fence) {
ret = -ENOMEM;
@@ -168,7 +148,7 @@ int vgem_fence_attach_ioctl(struct drm_device *dev,
}
/* Check for a conflicting fence */
- resv = obj->dma_buf->resv;
+ resv = obj->resv;
if (!reservation_object_test_signaled_rcu(resv,
arg->flags & VGEM_FENCE_WRITE)) {
ret = -EBUSY;