All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2] drm/i915/selftests: Mark mock contexts as being !GGTT
@ 2018-07-17 14:12 Chris Wilson
  2018-07-17 14:12 ` [PATCH 2/2] drm/i915/selftests: Exercise resetting in the middle of a wait-on-fence Chris Wilson
  2018-07-17 15:36 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915/selftests: Mark mock contexts as being !GGTT Patchwork
  0 siblings, 2 replies; 3+ messages in thread
From: Chris Wilson @ 2018-07-17 14:12 UTC (permalink / raw)
  To: intel-gfx

i915_is_ggtt() uses the ctx->file_priv == NULL to determine if the
context was allocation on behalf of the user, or by the kernel.
Ordinarily, we only ever allocate one context by the kernel and this is
used as the Global GTT, but for self testing we may want to create lots
of internal contexts unconnected to struct files. These we ordinarily do
not want to mistake for the GGTT, even when mocked there will only be a
single mock GGTT.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 drivers/gpu/drm/i915/selftests/mock_context.c | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/selftests/mock_context.c b/drivers/gpu/drm/i915/selftests/mock_context.c
index 8904f1ce64e3..23b8b254ef89 100644
--- a/drivers/gpu/drm/i915/selftests/mock_context.c
+++ b/drivers/gpu/drm/i915/selftests/mock_context.c
@@ -103,7 +103,14 @@ live_context(struct drm_i915_private *i915, struct drm_file *file)
 struct i915_gem_context *
 kernel_context(struct drm_i915_private *i915)
 {
-	return i915_gem_context_create_kernel(i915, I915_PRIORITY_NORMAL);
+	struct i915_gem_context *ctx;
+
+	ctx = i915_gem_context_create_kernel(i915, I915_PRIORITY_NORMAL);
+	if (IS_ERR(ctx))
+		return ctx;
+
+	ctx->file_priv = ERR_PTR(-EPERM); /* !i915_is_ggtt() */
+	return ctx;
 }
 
 void kernel_context_close(struct i915_gem_context *ctx)
-- 
2.18.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] drm/i915/selftests: Exercise resetting in the middle of a wait-on-fence
  2018-07-17 14:12 [PATCH 1/2] drm/i915/selftests: Mark mock contexts as being !GGTT Chris Wilson
@ 2018-07-17 14:12 ` Chris Wilson
  2018-07-17 15:36 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915/selftests: Mark mock contexts as being !GGTT Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Chris Wilson @ 2018-07-17 14:12 UTC (permalink / raw)
  To: intel-gfx

On older HW, gen2/3, fence registers are used for detiling GPU commands
and as such changing those registers requires serialisation with the
requests on the GPU. Anything running on the GPU is subject to a hang,
and so we must be able to recover cleanly in the middle of a stuck wait
on a fence register.

We can simulate using the fence on the GPU simply by marking the fence
as active on the request for this vma, the interface being common to all
gen, thus broadening the test.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
---
 .../gpu/drm/i915/selftests/intel_hangcheck.c  | 74 +++++++++++++++++--
 1 file changed, 67 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
index 65d66cdedd26..142e5381ffb7 100644
--- a/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
+++ b/drivers/gpu/drm/i915/selftests/intel_hangcheck.c
@@ -1018,8 +1018,37 @@ static int evict_vma(void *data)
 	return err;
 }
 
+static int evict_fence(void *data)
+{
+	struct evict_vma *arg = data;
+	struct drm_i915_private *i915 = arg->vma->vm->i915;
+	int err;
+
+	complete(&arg->completion);
+
+	mutex_lock(&i915->drm.struct_mutex);
+
+	/* Mark the fence register as dirty to force the mmio update. */
+	err = i915_gem_object_set_tiling(arg->vma->obj, I915_TILING_Y, 512);
+	if (err)
+		goto out_unlock;
+
+	err = i915_vma_pin_fence(arg->vma);
+	if (err)
+		goto out_unlock;
+
+	i915_vma_unpin_fence(arg->vma);
+
+out_unlock:
+	mutex_unlock(&i915->drm.struct_mutex);
+
+	return err;
+}
+
 static int __igt_reset_evict_vma(struct drm_i915_private *i915,
-				 struct i915_address_space *vm)
+				 struct i915_address_space *vm,
+				 int (*fn)(void *),
+				 unsigned int flags)
 {
 	struct drm_i915_gem_object *obj;
 	struct task_struct *tsk = NULL;
@@ -1040,12 +1069,18 @@ static int __igt_reset_evict_vma(struct drm_i915_private *i915,
 	if (err)
 		goto unlock;
 
-	obj = i915_gem_object_create_internal(i915, PAGE_SIZE);
+	obj = i915_gem_object_create_internal(i915, SZ_1M);
 	if (IS_ERR(obj)) {
 		err = PTR_ERR(obj);
 		goto fini;
 	}
 
+	if (flags & EXEC_OBJECT_NEEDS_FENCE) {
+		err = i915_gem_object_set_tiling(obj, I915_TILING_X, 512);
+		if (err)
+			goto out_obj;
+	}
+
 	arg.vma = i915_vma_instance(obj, vm, NULL);
 	if (IS_ERR(arg.vma)) {
 		err = PTR_ERR(arg.vma);
@@ -1060,10 +1095,24 @@ static int __igt_reset_evict_vma(struct drm_i915_private *i915,
 
 	err = i915_vma_pin(arg.vma, 0, 0,
 			   i915_vma_is_ggtt(arg.vma) ? PIN_GLOBAL : PIN_USER);
-	if (err)
+	if (err) {
+		i915_request_add(rq);
 		goto out_obj;
+	}
 
-	err = i915_vma_move_to_active(arg.vma, rq, EXEC_OBJECT_WRITE);
+	if (flags & EXEC_OBJECT_NEEDS_FENCE) {
+		err = i915_vma_pin_fence(arg.vma);
+		if (err) {
+			i915_vma_unpin(arg.vma);
+			i915_request_add(rq);
+			goto out_obj;
+		}
+	}
+
+	err = i915_vma_move_to_active(arg.vma, rq, flags);
+
+	if (flags & EXEC_OBJECT_NEEDS_FENCE)
+		i915_vma_unpin_fence(arg.vma);
 	i915_vma_unpin(arg.vma);
 
 	i915_request_get(rq);
@@ -1086,7 +1135,7 @@ static int __igt_reset_evict_vma(struct drm_i915_private *i915,
 
 	init_completion(&arg.completion);
 
-	tsk = kthread_run(evict_vma, &arg, "igt/evict_vma");
+	tsk = kthread_run(fn, &arg, "igt/evict_vma");
 	if (IS_ERR(tsk)) {
 		err = PTR_ERR(tsk);
 		tsk = NULL;
@@ -1137,7 +1186,8 @@ static int igt_reset_evict_ggtt(void *arg)
 {
 	struct drm_i915_private *i915 = arg;
 
-	return __igt_reset_evict_vma(i915, &i915->ggtt.vm);
+	return __igt_reset_evict_vma(i915, &i915->ggtt.vm,
+				     evict_vma, EXEC_OBJECT_WRITE);
 }
 
 static int igt_reset_evict_ppgtt(void *arg)
@@ -1154,12 +1204,21 @@ static int igt_reset_evict_ppgtt(void *arg)
 
 	err = 0;
 	if (ctx->ppgtt) /* aliasing == global gtt locking, covered above */
-		err = __igt_reset_evict_vma(i915, &ctx->ppgtt->vm);
+		err = __igt_reset_evict_vma(i915, &ctx->ppgtt->vm,
+					    evict_vma, EXEC_OBJECT_WRITE);
 
 	kernel_context_close(ctx);
 	return err;
 }
 
+static int igt_reset_evict_fence(void *arg)
+{
+	struct drm_i915_private *i915 = arg;
+
+	return __igt_reset_evict_vma(i915, &i915->ggtt.vm,
+				     evict_fence, EXEC_OBJECT_NEEDS_FENCE);
+}
+
 static int wait_for_others(struct drm_i915_private *i915,
 			   struct intel_engine_cs *exclude)
 {
@@ -1409,6 +1468,7 @@ int intel_hangcheck_live_selftests(struct drm_i915_private *i915)
 		SUBTEST(igt_reset_wait),
 		SUBTEST(igt_reset_evict_ggtt),
 		SUBTEST(igt_reset_evict_ppgtt),
+		SUBTEST(igt_reset_evict_fence),
 		SUBTEST(igt_handle_error),
 	};
 	bool saved_hangcheck;
-- 
2.18.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915/selftests: Mark mock contexts as being !GGTT
  2018-07-17 14:12 [PATCH 1/2] drm/i915/selftests: Mark mock contexts as being !GGTT Chris Wilson
  2018-07-17 14:12 ` [PATCH 2/2] drm/i915/selftests: Exercise resetting in the middle of a wait-on-fence Chris Wilson
@ 2018-07-17 15:36 ` Patchwork
  1 sibling, 0 replies; 3+ messages in thread
From: Patchwork @ 2018-07-17 15:36 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] drm/i915/selftests: Mark mock contexts as being !GGTT
URL   : https://patchwork.freedesktop.org/series/46707/
State : failure

== Summary ==

= CI Bug Log - changes from CI_DRM_4501 -> Patchwork_9692 =

== Summary - FAILURE ==

  Serious unknown changes coming with Patchwork_9692 absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_9692, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/46707/revisions/1/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in Patchwork_9692:

  === IGT changes ===

    ==== Possible regressions ====

    igt@drv_selftest@live_hangcheck:
      fi-kbl-7500u:       PASS -> DMESG-FAIL
      fi-kbl-7560u:       PASS -> DMESG-FAIL
      fi-skl-6700hq:      PASS -> DMESG-FAIL
      fi-skl-gvtdvm:      PASS -> DMESG-FAIL
      fi-skl-6700k2:      PASS -> DMESG-FAIL
      fi-blb-e6850:       PASS -> DMESG-FAIL
      fi-cfl-guc:         PASS -> DMESG-FAIL
      fi-skl-guc:         PASS -> DMESG-FAIL
      fi-skl-6600u:       PASS -> DMESG-FAIL
      fi-pnv-d510:        PASS -> DMESG-FAIL
      fi-cfl-8700k:       PASS -> DMESG-FAIL
      fi-kbl-r:           PASS -> DMESG-FAIL
      fi-kbl-guc:         PASS -> DMESG-FAIL
      fi-cfl-s3:          PASS -> DMESG-FAIL
      fi-skl-6770hq:      PASS -> DMESG-FAIL
      fi-whl-u:           PASS -> DMESG-FAIL
      fi-bxt-dsi:         PASS -> DMESG-FAIL
      fi-bxt-j4205:       PASS -> DMESG-FAIL
      fi-skl-6260u:       PASS -> DMESG-FAIL
      fi-glk-j4005:       PASS -> DMESG-FAIL
      fi-kbl-x1275:       PASS -> DMESG-FAIL
      fi-kbl-7567u:       PASS -> DMESG-FAIL
      fi-glk-dsi:         PASS -> DMESG-FAIL

    
    ==== Warnings ====

    igt@drv_selftest@live_execlists:
      fi-whl-u:           PASS -> SKIP +1
      fi-cfl-8700k:       PASS -> SKIP +1
      fi-glk-j4005:       PASS -> SKIP +1
      fi-skl-guc:         PASS -> SKIP
      fi-kbl-r:           PASS -> SKIP +1
      fi-cfl-s3:          PASS -> SKIP +1
      fi-kbl-guc:         PASS -> SKIP
      fi-kbl-7500u:       PASS -> SKIP +1
      fi-skl-6700hq:      PASS -> SKIP +1
      fi-bxt-j4205:       PASS -> SKIP +1
      fi-cfl-guc:         PASS -> SKIP

    igt@drv_selftest@live_guc:
      fi-glk-dsi:         PASS -> SKIP +1
      fi-kbl-7567u:       PASS -> SKIP +1
      fi-skl-6600u:       PASS -> SKIP +1
      fi-skl-gvtdvm:      PASS -> SKIP +1
      fi-skl-6260u:       PASS -> SKIP +1
      fi-bxt-dsi:         PASS -> SKIP +1
      fi-skl-6700k2:      PASS -> SKIP +1
      fi-skl-6770hq:      PASS -> SKIP +1
      fi-kbl-7560u:       PASS -> SKIP +1
      fi-kbl-x1275:       PASS -> SKIP +1

    
== Known issues ==

  Here are the changes found in Patchwork_9692 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@debugfs_test@read_all_entries:
      fi-snb-2520m:       PASS -> INCOMPLETE (fdo#103713)

    igt@gem_exec_suspend@basic-s3:
      {fi-cfl-8109u}:     NOTRUN -> INCOMPLETE (fdo#107187)

    igt@kms_flip@basic-flip-vs-modeset:
      fi-skl-6700hq:      PASS -> DMESG-WARN (fdo#105998) +1

    igt@kms_frontbuffer_tracking@basic:
      fi-hsw-peppy:       PASS -> DMESG-FAIL (fdo#106103, fdo#102614)

    
    ==== Possible fixes ====

    igt@drv_selftest@live_guc:
      fi-skl-guc:         DMESG-WARN (fdo#107175, fdo#107258) -> SKIP
      fi-cfl-guc:         DMESG-WARN (fdo#107258) -> SKIP
      fi-kbl-guc:         DMESG-WARN (fdo#107258) -> SKIP

    igt@gem_exec_suspend@basic-s4-devices:
      fi-kbl-7500u:       DMESG-WARN (fdo#107139, fdo#105128) -> PASS

    igt@kms_busy@basic-flip-b:
      fi-skl-6700hq:      DMESG-WARN (fdo#105998) -> PASS +1

    igt@prime_vgem@basic-fence-flip:
      fi-ilk-650:         FAIL (fdo#104008) -> PASS

    
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  fdo#102614 https://bugs.freedesktop.org/show_bug.cgi?id=102614
  fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
  fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
  fdo#105128 https://bugs.freedesktop.org/show_bug.cgi?id=105128
  fdo#105998 https://bugs.freedesktop.org/show_bug.cgi?id=105998
  fdo#106103 https://bugs.freedesktop.org/show_bug.cgi?id=106103
  fdo#107139 https://bugs.freedesktop.org/show_bug.cgi?id=107139
  fdo#107175 https://bugs.freedesktop.org/show_bug.cgi?id=107175
  fdo#107187 https://bugs.freedesktop.org/show_bug.cgi?id=107187
  fdo#107258 https://bugs.freedesktop.org/show_bug.cgi?id=107258


== Participating hosts (46 -> 41) ==

  Additional (1): fi-cfl-8109u 
  Missing    (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 fi-kbl-8809g 


== Build changes ==

    * Linux: CI_DRM_4501 -> Patchwork_9692

  CI_DRM_4501: 692d13f7b75baf0bb8c58b9784569c52d68f01e2 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4559: 6d341aac2124836443ce74e8e97a4508ac8d5095 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9692: f16d2775c3e28682b4952c48044de450e3448ef8 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

f16d2775c3e2 drm/i915/selftests: Exercise resetting in the middle of a wait-on-fence
f5c0dd0ea208 drm/i915/selftests: Mark mock contexts as being !GGTT

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_9692/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-07-17 15:36 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-07-17 14:12 [PATCH 1/2] drm/i915/selftests: Mark mock contexts as being !GGTT Chris Wilson
2018-07-17 14:12 ` [PATCH 2/2] drm/i915/selftests: Exercise resetting in the middle of a wait-on-fence Chris Wilson
2018-07-17 15:36 ` ✗ Fi.CI.BAT: failure for series starting with [1/2] drm/i915/selftests: Mark mock contexts as being !GGTT Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.