summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
diff options
context:
space:
mode:
authorChris Wilson2018-07-19 21:47:45 +0200
committerChris Wilson2018-07-26 14:32:07 +0200
commitab84a110490d38d40780113a1cdfce03b1cdec13 (patch)
tree2d0b7ac89098bc264115a5fb9565371639c4db30 /drivers/gpu/drm/i915/selftests/intel_hangcheck.c
parentdrm/i915: Don't disable the GPU for older gen on wedging (diff)
downloadkernel-qcow2-linux-ab84a110490d38d40780113a1cdfce03b1cdec13.tar.gz
kernel-qcow2-linux-ab84a110490d38d40780113a1cdfce03b1cdec13.tar.xz
kernel-qcow2-linux-ab84a110490d38d40780113a1cdfce03b1cdec13.zip
drm/i915/selftests: Use a full emulation of a user ppgtt context
To test eviction from a ppgtt, we just want a ppgtt i.e. something other than the Global GTT which is shared and used by the kernel for HW features like fencing and scanout. However, we also need it to pass !i915_is_ggtt() and the simplest way is to emulate a full user context rather than the internal kernel context that is used for the GGTT. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20180719194746.19111-1-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/selftests/intel_hangcheck.c')
-rw-r--r--drivers/gpu/drm/i915/selftests/intel_hangcheck.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
index 65d66cdedd26..b2d6d15f025a 100644
--- a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
+++ b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
@@ -1144,19 +1144,27 @@ static int igt_reset_evict_ppgtt(void *arg)
{
struct drm_i915_private *i915 = arg;
struct i915_gem_context *ctx;
+ struct drm_file *file;
int err;
+ file = mock_file(i915);
+ if (IS_ERR(file))
+ return PTR_ERR(file);
+
mutex_lock(&i915->drm.struct_mutex);
- ctx = kernel_context(i915);
+ ctx = live_context(i915, file);
mutex_unlock(&i915->drm.struct_mutex);
- if (IS_ERR(ctx))
- return PTR_ERR(ctx);
+ if (IS_ERR(ctx)) {
+ err = PTR_ERR(ctx);
+ goto out;
+ }
err = 0;
if (ctx->ppgtt) /* aliasing == global gtt locking, covered above */
err = __igt_reset_evict_vma(i915, &ctx->ppgtt->vm);
- kernel_context_close(ctx);
+out:
+ mock_file_free(i915, file);
return err;
}