diff options
author | Matthew Auld <matthew.auld@intel.com> | 2021-10-18 10:10:54 +0100 |
---|---|---|
committer | Matthew Auld <matthew.auld@intel.com> | 2021-10-22 13:19:29 +0100 |
commit | 2eda4fc6d005b51271642ebfae4ac00e15618a23 (patch) | |
tree | 6d8839d6bec6ffb3e41f70f1758393b7f13d6a20 /drivers/gpu/drm | |
parent | drm/i915/ttm: move shrinker management into adjust_lru (diff) | |
download | linux-dev-2eda4fc6d005b51271642ebfae4ac00e15618a23.tar.xz linux-dev-2eda4fc6d005b51271642ebfae4ac00e15618a23.zip |
drm/i915/ttm: use cached system pages when evicting lmem
This should let us do an accelerated copy directly to the shmem pages
when temporarily moving lmem-only objects, where the i915-gem shrinker
can later kick in to swap out the pages, if needed.
Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20211018091055.1998191-7-matthew.auld@intel.com
Diffstat (limited to 'drivers/gpu/drm')
-rw-r--r-- | drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c index 8de1031a2c6e..d37581d9194c 100644 --- a/drivers/gpu/drm/i915/gem/i915_gem_ttm.c +++ b/drivers/gpu/drm/i915/gem/i915_gem_ttm.c @@ -134,11 +134,11 @@ static enum ttm_caching i915_ttm_select_tt_caching(const struct drm_i915_gem_object *obj) { /* - * Objects only allowed in system get cached cpu-mappings. - * Other objects get WC mapping for now. Even if in system. + * Objects only allowed in system get cached cpu-mappings, or when + * evicting lmem-only buffers to system for swapping. Other objects get + * WC mapping for now. Even if in system. */ - if (obj->mm.region->type == INTEL_MEMORY_SYSTEM && - obj->mm.n_placements <= 1) + if (obj->mm.n_placements <= 1) return ttm_cached; return ttm_write_combined; |