drm/i915: Check for timeout completion when waiting for the rq to submitted
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 8 Feb 2017 18:12:38 +0000 (18:12 +0000)
committerJani Nikula <jani.nikula@intel.com>
Thu, 16 Feb 2017 09:59:12 +0000 (11:59 +0200)
commit44a027058b24541cc7ec499e6fb91db4b130648a
tree06c6ba04be0b98c6676e3332c3007ee19ad10f9c
parent3e52d71ede206df75b56208e7c7a277ef157bb71
drm/i915: Check for timeout completion when waiting for the rq to submitted

We first wait for a request to be submitted to hw and assigned a seqno,
before we can wait for the hw to signal completion (otherwise we don't
know the hw id we need to wait upon). Whilst waiting for the request to
be submitted, we may exceed the user's timeout and need to propagate the
error back.

v2: Make ETIME into an error from wait_for_execute for consistent exit
handling.

Reported-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Fixes: 4680816be336 ("drm/i915: Wait first for submission, before waiting for request completion")
Testcase: igt/gem_wait/basic-await
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: <drm-intel-fixes@lists.freedesktop.org> # v4.10-rc1+
Cc: stable@vger.kernel.org
Link: http://patchwork.freedesktop.org/patch/msgid/20170208181238.7232-1-chris@chris-wilson.co.uk
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
(cherry picked from commit 969bb72cbfd906d347cf76dc9b8c8dbaf83ba27a)
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
drivers/gpu/drm/i915/i915_gem_request.c