OSDN Git Service

drm/i915/gem: Drop local vma->vm_file reference
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 1 Jan 2020 14:10:07 +0000 (14:10 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 1 Jan 2020 14:49:26 +0000 (14:49 +0000)
commitf17b898009d8c979340ff9b68bee1232f00d1d42
tree5ca78ead9b34be0c91a2c402fc46008f65e7bd08
parent1cd21a7c5679015352e8a6f46813aced51d71bb8
drm/i915/gem: Drop local vma->vm_file reference

We use the global device inode, shared amongst all files, and not the
user's device filp to provide the backing storage for the mmap. The
vma->vm_file provides a redundant reference that breaks existing
expected behaviour that closing the user's device fd will release the
resources bound to it, if a mmap persists. (Even without the
vma->vm_file, the mmap will persist past the user's fd as the storage is
bound to the device, i.e. our reference is on the object not file.)

Fixes: cc662126b413 ("drm/i915: Introduce DRM_I915_GEM_MMAP_OFFSET")
Closes: https://gitlab.freedesktop.org/drm/intel/issues/919
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Acked-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200101141007.755429-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/i915_gem_mman.c
drivers/gpu/drm/i915/i915_drv.h