Commit 93adc0c2 authored by Daniel Vetter's avatar Daniel Vetter

drm/xen: Simplify fb_create

The current code is a pretty good wtf moment, since we drop the
reference before we use it. It's not a big deal, because a) we only
use the pointer, so doesn't blow up and the real reason b) fb->obj[0]
already holds a full reference for us.

Might as well take the real pointer ins't of complicated games that
baffle.
Reviewed-by: default avatarOleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@intel.com>
Cc: Oleksandr Andrushchenko <oleksandr_andrushchenko@epam.com>
Cc: xen-devel@lists.xenproject.org
Link: https://patchwork.freedesktop.org/patch/msgid/20191115092120.4445-7-daniel.vetter@ffwll.ch
parent 931e691c
...@@ -63,14 +63,7 @@ fb_create(struct drm_device *dev, struct drm_file *filp, ...@@ -63,14 +63,7 @@ fb_create(struct drm_device *dev, struct drm_file *filp,
if (IS_ERR_OR_NULL(fb)) if (IS_ERR_OR_NULL(fb))
return fb; return fb;
gem_obj = drm_gem_object_lookup(filp, mode_cmd->handles[0]); gem_obj = fb->obj[0];
if (!gem_obj) {
DRM_ERROR("Failed to lookup GEM object\n");
ret = -ENOENT;
goto fail;
}
drm_gem_object_put_unlocked(gem_obj);
ret = xen_drm_front_fb_attach(drm_info->front_info, ret = xen_drm_front_fb_attach(drm_info->front_info,
xen_drm_front_dbuf_to_cookie(gem_obj), xen_drm_front_dbuf_to_cookie(gem_obj),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment