[PATCH 6/6] HAX drm/i915: Enable TTM system for integrated

Thomas Hellström thomas.hellstrom at linux.intel.com
Fri Jun 11 15:41:05 UTC 2021


Just testing what breaks. In particular functionality that relies on
the shrinker and that system is actually shmem should give up. phys as well.

Signed-off-by: Thomas Hellström <thomas.hellstrom at linux.intel.com>
---
 drivers/gpu/drm/i915/gem/selftests/huge_pages.c | 9 ++++++++-
 drivers/gpu/drm/i915/intel_memory_region.c      | 2 +-
 2 files changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
index ccc67ed1a84b..c129c0aced76 100644
--- a/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
+++ b/drivers/gpu/drm/i915/gem/selftests/huge_pages.c
@@ -1512,6 +1512,7 @@ static int igt_shrink_thp(void *arg)
 	struct i915_gem_context *ctx = arg;
 	struct drm_i915_private *i915 = ctx->i915;
 	struct i915_address_space *vm = i915_gem_context_get_vm_rcu(ctx);
+	intel_wakeref_t wakeref;
 	struct drm_i915_gem_object *obj;
 	struct i915_gem_engines_iter it;
 	struct intel_context *ce;
@@ -1574,7 +1575,13 @@ static int igt_shrink_thp(void *arg)
 	 * Now that the pages are *unpinned* shrink-all should invoke
 	 * shmem to truncate our pages.
 	 */
-	i915_gem_shrink_all(i915);
+	with_intel_runtime_pm(&i915->runtime_pm, wakeref) {
+		i915_gem_shrink(NULL, i915, -1UL, NULL,
+				I915_SHRINK_BOUND |
+				I915_SHRINK_UNBOUND |
+				I915_SHRINK_ACTIVE);
+	}
+
 	if (i915_gem_object_has_pages(obj)) {
 		pr_err("shrink-all didn't truncate the pages\n");
 		err = -EINVAL;
diff --git a/drivers/gpu/drm/i915/intel_memory_region.c b/drivers/gpu/drm/i915/intel_memory_region.c
index 0b016bdb8b84..a8ad1149b02d 100644
--- a/drivers/gpu/drm/i915/intel_memory_region.c
+++ b/drivers/gpu/drm/i915/intel_memory_region.c
@@ -220,7 +220,7 @@ int intel_memory_regions_hw_probe(struct drm_i915_private *i915)
 		instance = intel_region_map[i].instance;
 		switch (type) {
 		case INTEL_MEMORY_SYSTEM:
-			if (IS_DGFX(i915))
+			if (1 || IS_DGFX(i915))
 				mem = i915_gem_ttm_system_setup(i915, type,
 								instance);
 			else
-- 
2.31.1



More information about the Intel-gfx-trybot mailing list