]> git.baikalelectronics.ru Git - kernel.git/commit
drm/i915/ttm: Use TTM for system memory
authorThomas Hellström <thomas.hellstrom@linux.intel.com>
Thu, 24 Jun 2021 08:42:40 +0000 (10:42 +0200)
committerMatthew Auld <matthew.auld@intel.com>
Thu, 24 Jun 2021 17:51:01 +0000 (18:51 +0100)
commita52e55bb90af6626562d0bfca4948140a6c5edd8
tree5285d5b9836b7d6476a6855fd38cf0d15a7a571a
parentfe320471aa0480b02b0cfc6aa83169000e4d0850
drm/i915/ttm: Use TTM for system memory

For discrete, use TTM for both cached and WC system memory. That means
we currently rely on the TTM memory accounting / shrinker. For cached
system memory we should consider remaining shmem-backed, which can be
implemented from our ttm_tt_populate callback. We can then also reuse our
own very elaborate shrinker for that memory.

If an object is evicted to a gem allowable region, we will now consider
the object migrated, and we flip the gem region and move the object to a
different region list. Since we are now changing gem regions, we can't
any longer rely on the CONTIGUOUS flag being set based on the region
min page size, so remove that flag update. If we want to reintroduce it,
we need to put it in the mutable flags.

Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Matthew Auld <matthew.auld@intel.com>
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20210624084240.270219-4-thomas.hellstrom@linux.intel.com
drivers/gpu/drm/i915/gem/i915_gem_region.c
drivers/gpu/drm/i915/gem/i915_gem_shmem.c
drivers/gpu/drm/i915/gem/i915_gem_ttm.c
drivers/gpu/drm/i915/i915_drv.h
drivers/gpu/drm/i915/intel_memory_region.c
drivers/gpu/drm/i915/intel_memory_region.h