]> Git Repo - linux.git/commit
drm/prime: Take a ref on the drm_dev when exporting a dma_buf
authorChris Wilson <[email protected]>
Wed, 5 Oct 2016 12:21:44 +0000 (13:21 +0100)
committerDaniel Vetter <[email protected]>
Wed, 5 Oct 2016 13:30:32 +0000 (15:30 +0200)
commita4fce9cb782ad340ee5576a38e934e5e75832dc6
tree528aa09d8be2f3fcbe72e3a8b972fc6e6711a68d
parent56a76c0123d6cb034975901c80fce2627338ef9e
drm/prime: Take a ref on the drm_dev when exporting a dma_buf

dma_buf may live a long time, longer than the last direct user of the
driver. We already hold a reference to the owner module (that prevents
the object code from disappearing), but there is no reference to the
drm_dev - so the pointers to the driver backend themselves may vanish.

v2: Resist temptation to fix the bug in armada_gem.c not setting the
correct flags on the exported dma-buf (it should pass the flags through
and not be arbitrarily setting O_RDWR).

Use a common wrapper for exporting the dmabuf and acquiring the
reference to the drm_device.

Testcase: igt/vgem_basic/unload
Suggested-by: Daniel Vetter <[email protected]>
Signed-off-by: Chris Wilson <[email protected]>
Cc: Petri Latvala <[email protected]>
Cc: Daniel Vetter <[email protected]>
Cc: [email protected]
Tested-by: Petri Latvala <[email protected]>
Reviewed-by: Christian König <[email protected]>
Signed-off-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
drivers/gpu/drm/armada/armada_gem.c
drivers/gpu/drm/drm_prime.c
drivers/gpu/drm/i915/i915_gem_dmabuf.c
drivers/gpu/drm/tegra/gem.c
drivers/gpu/drm/udl/udl_dmabuf.c
include/drm/drmP.h
This page took 0.054784 seconds and 4 git commands to generate.