From: Daniel Vetter Date: Wed, 30 Mar 2016 09:40:49 +0000 (+0200) Subject: drm/vgem: Simplify dumb_map X-Git-Url: http://git.cdn.openwrt.org/?a=commitdiff_plain;h=e34274fd2aa84fb4b609e26af18507449e8feaca;p=openwrt%2Fstaging%2Fblogic.git drm/vgem: Simplify dumb_map The offset manager already checks for existing offsets internally, while holding suitable locks. We can drop this check. v2: Fix title (Emil). Reviewed-by: Emil Velikov Signed-off-by: Daniel Vetter Link: http://patchwork.freedesktop.org/patch/msgid/1459330852-27668-11-git-send-email-daniel.vetter@ffwll.ch --- diff --git a/drivers/gpu/drm/vgem/vgem_drv.c b/drivers/gpu/drm/vgem/vgem_drv.c index c503a840fd88..f3ee1c41da1e 100644 --- a/drivers/gpu/drm/vgem/vgem_drv.c +++ b/drivers/gpu/drm/vgem/vgem_drv.c @@ -208,11 +208,9 @@ int vgem_gem_dumb_map(struct drm_file *file, struct drm_device *dev, goto unlock; } - if (!drm_vma_node_has_offset(&obj->vma_node)) { - ret = drm_gem_create_mmap_offset(obj); - if (ret) - goto unref; - } + ret = drm_gem_create_mmap_offset(obj); + if (ret) + goto unref; BUG_ON(!obj->filp);