drm/i915: Allow multiple user handles to the same VM
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 25 Apr 2019 05:43:33 +0000 (06:43 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 25 Apr 2019 06:33:57 +0000 (07:33 +0100)
commit1f2b4a7edbc3b89c27f661b81a699095d922467c
treea24cfaed0007b1a51fc5b7c6cca7c24488892d5a
parent8f2a1057d6ec217aefb8bf0de6996294452a2577
drm/i915: Allow multiple user handles to the same VM

It was noted that we made the same mistake for VM_ID as for object
handles, whereby we ensured that we only allocated a single handle for
one ppgtt. This has the unfortunate consequence for userspace that they
need to reference count the handles to avoid destroying an active ID. If
we allow multiple handles to the same ppgtt, userspace can freely
unreference any handle they own without fear of destroying the same
handle in use elsewhere.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190425054333.27299-1-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_context.c
drivers/gpu/drm/i915/i915_gem_gtt.h