drm/i915/gem: Extract transient execbuf flags from i915_vma
authorChris Wilson <chris@chris-wilson.co.uk>
Tue, 3 Mar 2020 20:43:44 +0000 (20:43 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 3 Mar 2020 21:52:51 +0000 (21:52 +0000)
commit7d6236bb13352c27450f2e6639b37c884e41903f
treec817d9627a35c16bd3a1146a6df28e6e0cc9a64c
parent2920bb94e65f6fee3e644bb063011f597aed4e95
drm/i915/gem: Extract transient execbuf flags from i915_vma

For our convenience, and to avoid frequent allocations, we placed some
lists we use for execbuf inside the common i915_vma struct. As we look
to parallelise execbuf, such fields guarded by the struct_mutex BKL must
be pulled under local control. Instead of using the i915_vma as our
primary means of tracking the user's list of objects and their virtual
mappings, we use a local eb_vma with the same lists as before (just now
local not global).

This should allow us to only perform the lookup of vma used for
execution once during the execbuf ioctl, as currently we need to remove
our secrets from inside i915_vma everytime we drop the struct_mutex as
another execbuf may use the shared locations.

Once potential user visible consequence is that we can remove the
requirement that the execobj[] be unique, and only require that they do
not conflict (i.e. you cannot softpin the same object into two locations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20200303204345.1859734-2-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
drivers/gpu/drm/i915/i915_vma_types.h