drm/i915/pool: constrain pool objects by mapping type
authorMatthew Auld <matthew.auld@intel.com>
Tue, 19 Jan 2021 13:31:06 +0000 (13:31 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 19 Jan 2021 20:36:28 +0000 (20:36 +0000)
commit8f47c8c3b06fdc0d024c29ae230bdd6522de91be
tree8fa7d63f0a5b5edcc29fd2fb1e0ec7f7054b5769
parente2f4367a475be1db09276112dd5306a932dba2d2
drm/i915/pool: constrain pool objects by mapping type

In a few places we always end up mapping the pool object with the FORCE
constraint(to prevent hitting -EBUSY) which will destroy the cached
mapping if it has a different type. As a simple first step, make the
mapping type part of the pool interface, where the behaviour is to only
give out pool objects which match the requested mapping type.

Suggested-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: https://patchwork.freedesktop.org/patch/msgid/20210119133106.66294-4-matthew.auld@intel.com
drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c
drivers/gpu/drm/i915/gem/i915_gem_object_blt.c
drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.c
drivers/gpu/drm/i915/gt/intel_gt_buffer_pool.h
drivers/gpu/drm/i915/gt/intel_gt_buffer_pool_types.h
drivers/gpu/drm/i915/i915_cmd_parser.c