]> git.baikalelectronics.ru Git - kernel.git/commitdiff
drm/i915/selftests: check for missing aperture
authorMatthew Auld <matthew.auld@intel.com>
Tue, 29 Oct 2019 09:58:56 +0000 (09:58 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Tue, 29 Oct 2019 10:35:47 +0000 (10:35 +0000)
We may be missing support for the mappable aperture on some platforms.

Signed-off-by: Matthew Auld <matthew.auld@intel.com>
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@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/20191029095856.25431-7-matthew.auld@intel.com
drivers/gpu/drm/i915/gem/selftests/i915_gem_coherency.c
drivers/gpu/drm/i915/gem/selftests/i915_gem_mman.c
drivers/gpu/drm/i915/gt/selftest_hangcheck.c
drivers/gpu/drm/i915/selftests/i915_gem.c
drivers/gpu/drm/i915/selftests/i915_gem_gtt.c

index 0a195e5b98e61c90c821ea97b7d93579322ab30a..2b29f6b4e1ddcec3aab8583eea725ce2bf57b774 100644 (file)
@@ -250,7 +250,12 @@ static bool always_valid(struct context *ctx)
 
 static bool needs_fence_registers(struct context *ctx)
 {
-       return !intel_gt_is_wedged(ctx->engine->gt);
+       struct intel_gt *gt = ctx->engine->gt;
+
+       if (intel_gt_is_wedged(gt))
+               return false;
+
+       return gt->ggtt->num_fences;
 }
 
 static bool needs_mi_store_dword(struct context *ctx)
index d45a93928ff5d246c0cdda54fe5d4e6d2a1e09cd..29b2077b73d25c8f60a3b55c1c819c4d0d9ecc07 100644 (file)
@@ -301,6 +301,9 @@ static int igt_partial_tiling(void *arg)
        int tiling;
        int err;
 
+       if (!i915_ggtt_has_aperture(&i915->ggtt))
+               return 0;
+
        /* We want to check the page mapping and fencing of a large object
         * mmapped through the GTT. The object we create is larger than can
         * possibly be mmaped as a whole, and so we must use partial GGTT vma.
@@ -431,6 +434,9 @@ static int igt_smoke_tiling(void *arg)
        IGT_TIMEOUT(end);
        int err;
 
+       if (!i915_ggtt_has_aperture(&i915->ggtt))
+               return 0;
+
        /*
         * igt_partial_tiling() does an exhastive check of partial tiling
         * chunking, but will undoubtably run out of time. Here, we do a
index b7207b4883915e28e449d3d3c5cefaefc44ef95b..8abc0a1d692b00eef36eb4207e089305683c352c 100644 (file)
@@ -1149,8 +1149,12 @@ static int __igt_reset_evict_vma(struct intel_gt *gt,
        struct i915_request *rq;
        struct evict_vma arg;
        struct hang h;
+       unsigned int pin_flags;
        int err;
 
+       if (!gt->ggtt->num_fences && flags & EXEC_OBJECT_NEEDS_FENCE)
+               return 0;
+
        if (!engine || !intel_engine_can_store_dword(engine))
                return 0;
 
@@ -1186,10 +1190,12 @@ static int __igt_reset_evict_vma(struct intel_gt *gt,
                goto out_obj;
        }
 
-       err = i915_vma_pin(arg.vma, 0, 0,
-                          i915_vma_is_ggtt(arg.vma) ?
-                          PIN_GLOBAL | PIN_MAPPABLE :
-                          PIN_USER);
+       pin_flags = i915_vma_is_ggtt(arg.vma) ? PIN_GLOBAL : PIN_USER;
+
+       if (flags & EXEC_OBJECT_NEEDS_FENCE)
+               pin_flags |= PIN_MAPPABLE;
+
+       err = i915_vma_pin(arg.vma, 0, 0, pin_flags);
        if (err) {
                i915_request_add(rq);
                goto out_obj;
index 6d22567ad620aec323515a5b92eef8eec7ece8e0..e378543ed45375f5b4ef415ef9803ffcded756bd 100644 (file)
@@ -45,6 +45,10 @@ static void trash_stolen(struct drm_i915_private *i915)
        unsigned long page;
        u32 prng = 0x12345678;
 
+       /* XXX: fsck. needs some more thought... */
+       if (!i915_ggtt_has_aperture(ggtt))
+               return;
+
        for (page = 0; page < size; page += PAGE_SIZE) {
                const dma_addr_t dma = i915->dsm.start + page;
                u32 __iomem *s;
index a1cb072e4a1b25130d8f4610af96bb921f34d2bf..3f7e80fb3bbd1d0e49105990b7c0d924f5c22421 100644 (file)
@@ -1149,6 +1149,9 @@ static int igt_ggtt_page(void *arg)
        unsigned int *order, n;
        int err;
 
+       if (!i915_ggtt_has_aperture(ggtt))
+               return 0;
+
        obj = i915_gem_object_create_internal(i915, PAGE_SIZE);
        if (IS_ERR(obj))
                return PTR_ERR(obj);