提交 93c97dc1 编写于 作者: I Imre Deak

drm/i915: Avoid early GPU idling due to race with new request

There is a small race where a new request can be submitted and retired
after the idle worker started to run which leads to idling the GPU too
early. Fix this by deferring the idling to the pending instance of the
worker.

This scenario was pointed out by Chris.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: NImre Deak <imre.deak@intel.com>
Reviewed-by: NChris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1478510405-11799-2-git-send-email-imre.deak@intel.com
上级 5bd11a34
...@@ -2766,6 +2766,13 @@ i915_gem_idle_work_handler(struct work_struct *work) ...@@ -2766,6 +2766,13 @@ i915_gem_idle_work_handler(struct work_struct *work)
goto out_rearm; goto out_rearm;
} }
/*
* New request retired after this work handler started, extend active
* period until next instance of the work.
*/
if (work_pending(work))
goto out_unlock;
if (dev_priv->gt.active_requests) if (dev_priv->gt.active_requests)
goto out_unlock; goto out_unlock;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册