diff mbox

[06/15] drm/i915: Check the execlist queue for pending requests before declaring idle

Message ID 20170717091141.23102-6-chris@chris-wilson.co.uk (mailing list archive)
State New, archived
Headers show

Commit Message

Chris Wilson July 17, 2017, 9:11 a.m. UTC
Including a check against the execlist queue before calling the engine
idle and passing hangcheck.

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

Comments

Mika Kuoppala July 20, 2017, 12:23 p.m. UTC | #1
Chris Wilson <chris@chris-wilson.co.uk> writes:

> Including a check against the execlist queue before calling the engine
> idle and passing hangcheck.
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>

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

> ---
>  drivers/gpu/drm/i915/intel_engine_cs.c | 4 ++++
>  1 file changed, 4 insertions(+)
>
> diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
> index cba120f3d89d..fbac94557ffa 100644
> --- a/drivers/gpu/drm/i915/intel_engine_cs.c
> +++ b/drivers/gpu/drm/i915/intel_engine_cs.c
> @@ -1407,6 +1407,10 @@ bool intel_engine_is_idle(struct intel_engine_cs *engine)
>  	if (port_request(&engine->execlist_port[0]))
>  		return false;
>  
> +	/* ELSP is empty, but there are ready requests? */
> +	if (READ_ONCE(engine->execlist_first))
> +		return false;
> +
>  	/* Ring stopped? */
>  	if (!ring_is_idle(engine))
>  		return false;
> -- 
> 2.13.2
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_engine_cs.c b/drivers/gpu/drm/i915/intel_engine_cs.c
index cba120f3d89d..fbac94557ffa 100644
--- a/drivers/gpu/drm/i915/intel_engine_cs.c
+++ b/drivers/gpu/drm/i915/intel_engine_cs.c
@@ -1407,6 +1407,10 @@  bool intel_engine_is_idle(struct intel_engine_cs *engine)
 	if (port_request(&engine->execlist_port[0]))
 		return false;
 
+	/* ELSP is empty, but there are ready requests? */
+	if (READ_ONCE(engine->execlist_first))
+		return false;
+
 	/* Ring stopped? */
 	if (!ring_is_idle(engine))
 		return false;