drm: Take ownership of the dmabuf->obj when exporting

Currently the reference for the dmabuf->obj is incremented for the
dmabuf in drm_gem_prime_handle_to_fd() (at the high level userspace
interface), but is released in drm_gem_dmabuf_release() (the lowlevel
handler). Improve the symmetry of the dmabuf->obj ownership by acquiring
the reference in drm_gem_dmabuf_export(). This makes it easier to use
the prime functions directly.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
[danvet: Update kerneldoc.]
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: http://patchwork.freedesktop.org/patch/msgid/20161207214527.22533-1-chris@chris-wilson.co.uk
This commit is contained in:
Chris Wilson
2016-12-07 21:45:27 +00:00
committed by Daniel Vetter
szülő f3f4c4d68a
commit 72a93e8dd5
2 fájl változott, egészen pontosan 7 új sor hozzáadva és 6 régi sor törölve

Fájl megtekintése

@@ -126,7 +126,6 @@ static int attach_dmabuf(struct drm_device *dev,
return PTR_ERR(dmabuf);
obj->dma_buf = dmabuf;
drm_gem_object_reference(obj);
return 0;
}