All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: Assert we idle in the kernel context
@ 2018-05-31 22:40 Chris Wilson
  2018-05-31 22:57 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Chris Wilson @ 2018-05-31 22:40 UTC (permalink / raw)
  To: intel-gfx

Now that we always switch to the kernel context upon idling, we can
make that assertion.

References: 4dfacb0bcbee ("drm/i915: Switch to kernel context before idling at runtime")
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>
---
 drivers/gpu/drm/i915/i915_gem.c | 31 ++++++++++++++++++-------------
 1 file changed, 18 insertions(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
index f5c4ef052001..66bb81cd43cd 100644
--- a/drivers/gpu/drm/i915/i915_gem.c
+++ b/drivers/gpu/drm/i915/i915_gem.c
@@ -3498,6 +3498,22 @@ new_requests_since_last_retire(const struct drm_i915_private *i915)
 		work_pending(&i915->gt.idle_work.work));
 }
 
+static void assert_kernel_context_is_current(struct drm_i915_private *i915)
+{
+	struct intel_engine_cs *engine;
+	enum intel_engine_id id;
+
+	if (i915_terminally_wedged(&i915->gpu_error))
+		return;
+
+	GEM_BUG_ON(i915->gt.active_requests);
+	for_each_engine(engine, i915, id) {
+		GEM_BUG_ON(__i915_gem_active_peek(&engine->timeline.last_request));
+		GEM_BUG_ON(engine->last_retired_context !=
+			   to_intel_context(i915->kernel_context, engine));
+	}
+}
+
 static void
 i915_gem_idle_work_handler(struct work_struct *work)
 {
@@ -3558,6 +3574,8 @@ i915_gem_idle_work_handler(struct work_struct *work)
 	if (new_requests_since_last_retire(dev_priv))
 		goto out_unlock;
 
+	assert_kernel_context_is_current(dev_priv);
+
 	epoch = __i915_gem_park(dev_priv);
 
 	rearm_hangcheck = false;
@@ -4944,19 +4962,6 @@ void __i915_gem_object_release_unless_active(struct drm_i915_gem_object *obj)
 		i915_gem_object_put(obj);
 }
 
-static void assert_kernel_context_is_current(struct drm_i915_private *i915)
-{
-	struct i915_gem_context *kctx = i915->kernel_context;
-	struct intel_engine_cs *engine;
-	enum intel_engine_id id;
-
-	GEM_BUG_ON(i915->gt.active_requests);
-	for_each_engine(engine, i915, id) {
-		GEM_BUG_ON(__i915_gem_active_peek(&engine->timeline.last_request));
-		GEM_BUG_ON(engine->last_retired_context->gem_context != kctx);
-	}
-}
-
 void i915_gem_sanitize(struct drm_i915_private *i915)
 {
 	struct intel_engine_cs *engine;
-- 
2.17.1

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

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

* ✗ Fi.CI.CHECKPATCH: warning for drm/i915: Assert we idle in the kernel context
  2018-05-31 22:40 [PATCH] drm/i915: Assert we idle in the kernel context Chris Wilson
@ 2018-05-31 22:57 ` Patchwork
  2018-05-31 23:17 ` ✓ Fi.CI.BAT: success " Patchwork
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-05-31 22:57 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Assert we idle in the kernel context
URL   : https://patchwork.freedesktop.org/series/44052/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
3ee19b0cecdd drm/i915: Assert we idle in the kernel context
-:9: WARNING:COMMIT_LOG_LONG_LINE: Possible unwrapped commit description (prefer a maximum 75 chars per line)
#9: 
References: 4dfacb0bcbee ("drm/i915: Switch to kernel context before idling at runtime")

-:9: ERROR:GIT_COMMIT_ID: Please use git commit description style 'commit <12+ chars of sha1> ("<title line>")' - ie: 'commit 4dfacb0bcbee ("drm/i915: Switch to kernel context before idling at runtime")'
#9: 
References: 4dfacb0bcbee ("drm/i915: Switch to kernel context before idling at runtime")

total: 1 errors, 1 warnings, 0 checks, 49 lines checked

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

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

* ✓ Fi.CI.BAT: success for drm/i915: Assert we idle in the kernel context
  2018-05-31 22:40 [PATCH] drm/i915: Assert we idle in the kernel context Chris Wilson
  2018-05-31 22:57 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
@ 2018-05-31 23:17 ` Patchwork
  2018-06-01  0:10 ` ✓ Fi.CI.IGT: " Patchwork
  2018-06-01  9:13 ` [PATCH] " Mika Kuoppala
  3 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-05-31 23:17 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Assert we idle in the kernel context
URL   : https://patchwork.freedesktop.org/series/44052/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4268 -> Patchwork_9165 =

== Summary - SUCCESS ==

  No regressions found.

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

== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@gem_mmap_gtt@basic-small-bo-tiledx:
      fi-gdg-551:         PASS -> FAIL (fdo#102575)

    igt@kms_flip@basic-flip-vs-modeset:
      fi-hsw-4770r:       PASS -> DMESG-WARN (fdo#105602)

    igt@kms_pipe_crc_basic@suspend-read-crc-pipe-c:
      fi-bxt-dsi:         NOTRUN -> INCOMPLETE (fdo#103927)

    
    ==== Possible fixes ====

    igt@kms_chamelium@hdmi-hpd-fast:
      fi-kbl-7500u:       FAIL (fdo#103841, fdo#102672) -> SKIP

    igt@kms_flip@basic-flip-vs-modeset:
      fi-glk-j4005:       DMESG-WARN (fdo#106000) -> PASS

    igt@kms_flip@basic-flip-vs-wf_vblank:
      fi-glk-j4005:       FAIL (fdo#100368) -> PASS

    
  fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
  fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
  fdo#102672 https://bugs.freedesktop.org/show_bug.cgi?id=102672
  fdo#103841 https://bugs.freedesktop.org/show_bug.cgi?id=103841
  fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
  fdo#105602 https://bugs.freedesktop.org/show_bug.cgi?id=105602
  fdo#106000 https://bugs.freedesktop.org/show_bug.cgi?id=106000


== Participating hosts (42 -> 40) ==

  Additional (1): fi-bxt-dsi 
  Missing    (3): fi-ctg-p8600 fi-ilk-m540 fi-skl-6700hq 


== Build changes ==

    * Linux: CI_DRM_4268 -> Patchwork_9165

  CI_DRM_4268: 7138a144b0da03dcbe54731f7ac0dab6948beafb @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4503: ae0ea2a0cff1cf8516d18ada5b9db01c56b73ed9 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9165: 3ee19b0cecdd0ca6020bda92f61c98019202ae45 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

3ee19b0cecdd drm/i915: Assert we idle in the kernel context

== Logs ==

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

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

* ✓ Fi.CI.IGT: success for drm/i915: Assert we idle in the kernel context
  2018-05-31 22:40 [PATCH] drm/i915: Assert we idle in the kernel context Chris Wilson
  2018-05-31 22:57 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
  2018-05-31 23:17 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2018-06-01  0:10 ` Patchwork
  2018-06-01  9:13 ` [PATCH] " Mika Kuoppala
  3 siblings, 0 replies; 5+ messages in thread
From: Patchwork @ 2018-06-01  0:10 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: drm/i915: Assert we idle in the kernel context
URL   : https://patchwork.freedesktop.org/series/44052/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4268_full -> Patchwork_9165_full =

== Summary - WARNING ==

  Minor unknown changes coming with Patchwork_9165_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_9165_full, 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/44052/revisions/1/mbox/

== Possible new issues ==

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

  === IGT changes ===

    ==== Warnings ====

    igt@gem_exec_schedule@deep-bsd1:
      shard-kbl:          SKIP -> PASS +3

    igt@gem_exec_schedule@deep-bsd2:
      shard-kbl:          PASS -> SKIP

    igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-spr-indfb-draw-mmap-gtt:
      shard-hsw:          SKIP -> PASS

    
== Known issues ==

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

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_selftest@live_gtt:
      shard-kbl:          PASS -> INCOMPLETE (fdo#103665)
      shard-glk:          PASS -> FAIL (fdo#105347)

    igt@kms_cursor_legacy@cursor-vs-flip-toggle:
      shard-hsw:          PASS -> FAIL (fdo#103355)

    igt@kms_cursor_legacy@flip-vs-cursor-legacy:
      shard-hsw:          PASS -> FAIL (fdo#102670)

    igt@kms_flip@2x-wf_vblank-ts-check-interruptible:
      shard-glk:          PASS -> FAIL (fdo#103928)

    igt@kms_flip_tiling@flip-x-tiled:
      shard-glk:          PASS -> FAIL (fdo#104724, fdo#103822) +2

    igt@kms_setmode@basic:
      shard-apl:          PASS -> FAIL (fdo#99912)

    
    ==== Possible fixes ====

    igt@gem_eio@hibernate:
      shard-snb:          FAIL (fdo#105957) -> PASS

    igt@kms_atomic_transition@1x-modeset-transitions-nonblocking:
      shard-glk:          FAIL (fdo#105703) -> PASS

    igt@kms_flip_tiling@flip-to-y-tiled:
      shard-glk:          FAIL (fdo#104724, fdo#103822) -> PASS

    
  fdo#102670 https://bugs.freedesktop.org/show_bug.cgi?id=102670
  fdo#103355 https://bugs.freedesktop.org/show_bug.cgi?id=103355
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
  fdo#103928 https://bugs.freedesktop.org/show_bug.cgi?id=103928
  fdo#104724 https://bugs.freedesktop.org/show_bug.cgi?id=104724
  fdo#105347 https://bugs.freedesktop.org/show_bug.cgi?id=105347
  fdo#105703 https://bugs.freedesktop.org/show_bug.cgi?id=105703
  fdo#105957 https://bugs.freedesktop.org/show_bug.cgi?id=105957
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * Linux: CI_DRM_4268 -> Patchwork_9165

  CI_DRM_4268: 7138a144b0da03dcbe54731f7ac0dab6948beafb @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_4503: ae0ea2a0cff1cf8516d18ada5b9db01c56b73ed9 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_9165: 3ee19b0cecdd0ca6020bda92f61c98019202ae45 @ git://anongit.freedesktop.org/gfx-ci/linux

== Logs ==

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

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

* Re: [PATCH] drm/i915: Assert we idle in the kernel context
  2018-05-31 22:40 [PATCH] drm/i915: Assert we idle in the kernel context Chris Wilson
                   ` (2 preceding siblings ...)
  2018-06-01  0:10 ` ✓ Fi.CI.IGT: " Patchwork
@ 2018-06-01  9:13 ` Mika Kuoppala
  3 siblings, 0 replies; 5+ messages in thread
From: Mika Kuoppala @ 2018-06-01  9:13 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx

Chris Wilson <chris@chris-wilson.co.uk> writes:

> Now that we always switch to the kernel context upon idling, we can
> make that assertion.
>
> References: 4dfacb0bcbee ("drm/i915: Switch to kernel context before idling at runtime")
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Mika Kuoppala <mika.kuoppala@linux.intel.com>

Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>

> ---
>  drivers/gpu/drm/i915/i915_gem.c | 31 ++++++++++++++++++-------------
>  1 file changed, 18 insertions(+), 13 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> index f5c4ef052001..66bb81cd43cd 100644
> --- a/drivers/gpu/drm/i915/i915_gem.c
> +++ b/drivers/gpu/drm/i915/i915_gem.c
> @@ -3498,6 +3498,22 @@ new_requests_since_last_retire(const struct drm_i915_private *i915)
>  		work_pending(&i915->gt.idle_work.work));
>  }
>  
> +static void assert_kernel_context_is_current(struct drm_i915_private *i915)
> +{
> +	struct intel_engine_cs *engine;
> +	enum intel_engine_id id;
> +
> +	if (i915_terminally_wedged(&i915->gpu_error))
> +		return;
> +
> +	GEM_BUG_ON(i915->gt.active_requests);
> +	for_each_engine(engine, i915, id) {
> +		GEM_BUG_ON(__i915_gem_active_peek(&engine->timeline.last_request));
> +		GEM_BUG_ON(engine->last_retired_context !=
> +			   to_intel_context(i915->kernel_context, engine));
> +	}
> +}
> +
>  static void
>  i915_gem_idle_work_handler(struct work_struct *work)
>  {
> @@ -3558,6 +3574,8 @@ i915_gem_idle_work_handler(struct work_struct *work)
>  	if (new_requests_since_last_retire(dev_priv))
>  		goto out_unlock;
>  
> +	assert_kernel_context_is_current(dev_priv);
> +
>  	epoch = __i915_gem_park(dev_priv);
>  
>  	rearm_hangcheck = false;
> @@ -4944,19 +4962,6 @@ void __i915_gem_object_release_unless_active(struct drm_i915_gem_object *obj)
>  		i915_gem_object_put(obj);
>  }
>  
> -static void assert_kernel_context_is_current(struct drm_i915_private *i915)
> -{
> -	struct i915_gem_context *kctx = i915->kernel_context;
> -	struct intel_engine_cs *engine;
> -	enum intel_engine_id id;
> -
> -	GEM_BUG_ON(i915->gt.active_requests);
> -	for_each_engine(engine, i915, id) {
> -		GEM_BUG_ON(__i915_gem_active_peek(&engine->timeline.last_request));
> -		GEM_BUG_ON(engine->last_retired_context->gem_context != kctx);
> -	}
> -}
> -
>  void i915_gem_sanitize(struct drm_i915_private *i915)
>  {
>  	struct intel_engine_cs *engine;
> -- 
> 2.17.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2018-06-01  9:13 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-05-31 22:40 [PATCH] drm/i915: Assert we idle in the kernel context Chris Wilson
2018-05-31 22:57 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2018-05-31 23:17 ` ✓ Fi.CI.BAT: success " Patchwork
2018-06-01  0:10 ` ✓ Fi.CI.IGT: " Patchwork
2018-06-01  9:13 ` [PATCH] " Mika Kuoppala

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.