[PATCH v2 14/14] drm/i915: Remove one level of indention from wait-for-execute

Chris Wilson
2017-02-14T09:54:32Z

Now that the code is getting simpler, we can reduce the indentation when
waiting for the global_seqno.

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

diff --git a/drivers/gpu/drm/i915/i915_gem_request.c b/drivers/gpu/drm/i915/i915_gem_request.c
index 06af48c28045..fa98bbf35337 100644
--- a/drivers/gpu/drm/i915/i915_gem_request.c
+++ b/drivers/gpu/drm/i915/i915_gem_request.c
@@ -1071,34 +1071,29 @@ long i915_wait_request(struct drm_i915_gem_request *req,
wait.tsk = current;

restart:
- wait.seqno = i915_gem_request_global_seqno(req);
- if (!wait.seqno) {
- do {
- set_current_state(state);
-
- wait.seqno = i915_gem_request_global_seqno(req);
- if (wait.seqno)
- break;
+ do {
+ set_current_state(state);
+ wait.seqno = i915_gem_request_global_seqno(req);
+ if (wait.seqno)
+ break;

- if (flags & I915_WAIT_LOCKED &&
- __i915_reset_request(req))
- continue;
+ if (flags & I915_WAIT_LOCKED && __i915_reset_request(req))
+ continue;

- if (signal_pending_state(state, current)) {
- timeout = -ERESTARTSYS;
- goto complete;
- }
+ if (signal_pending_state(state, current)) {
+ timeout = -ERESTARTSYS;
+ goto complete;
+ }

- if (!timeout) {
- timeout = -ETIME;
- goto complete;
- }
+ if (!timeout) {
+ timeout = -ETIME;
+ goto complete;
+ }

- timeout = io_schedule_timeout(timeout);
- } while (1);
+ timeout = io_schedule_timeout(timeout);
+ } while (1);

- GEM_BUG_ON(!wait.seqno);
- }
+ GEM_BUG_ON(!wait.seqno);
GEM_BUG_ON(!i915_sw_fence_signaled(&req->submit));

/* Optimistic short spin before touching IRQs */
--
2.11.0