Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/i915: Tidy common test_bit probing of i915_request->fence.flags

A repeated pattern is to test the signaled bit of our
request->fence.flags. Make this an inline to shorten a few lines and
remove unnecessary line continuations.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190121222117.23305-20-chris@chris-wilson.co.uk

+11 -9
+1 -2
drivers/gpu/drm/i915/i915_irq.c
··· 1182 1182 struct i915_request *waiter = wait->request; 1183 1183 1184 1184 if (waiter && 1185 - !test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, 1186 - &waiter->fence.flags) && 1185 + !i915_request_signaled(waiter) && 1187 1186 intel_wait_check_request(wait, waiter)) 1188 1187 rq = i915_request_get(waiter); 1189 1188
+1 -1
drivers/gpu/drm/i915/i915_request.c
··· 198 198 spin_unlock(&engine->timeline.lock); 199 199 200 200 spin_lock(&rq->lock); 201 - if (!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &rq->fence.flags)) 201 + if (!i915_request_signaled(rq)) 202 202 dma_fence_signal_locked(&rq->fence); 203 203 if (test_bit(DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT, &rq->fence.flags)) 204 204 intel_engine_cancel_signaling(rq);
+5
drivers/gpu/drm/i915/i915_request.h
··· 280 280 #define I915_WAIT_ALL BIT(3) /* used by i915_gem_object_wait() */ 281 281 #define I915_WAIT_FOR_IDLE_BOOST BIT(4) 282 282 283 + static inline bool i915_request_signaled(const struct i915_request *rq) 284 + { 285 + return test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &rq->fence.flags); 286 + } 287 + 283 288 static inline bool intel_engine_has_started(struct intel_engine_cs *engine, 284 289 u32 seqno); 285 290 static inline bool intel_engine_has_completed(struct intel_engine_cs *engine,
+1 -2
drivers/gpu/drm/i915/intel_breadcrumbs.c
··· 631 631 rq->signaling.wait.seqno = 0; 632 632 __list_del_entry(&rq->signaling.link); 633 633 634 - if (!test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, 635 - &rq->fence.flags)) { 634 + if (!i915_request_signaled(rq)) { 636 635 list_add_tail(&rq->signaling.link, 637 636 &list); 638 637 i915_request_get(rq);
+1 -1
drivers/gpu/drm/i915/intel_lrc.c
··· 816 816 list_for_each_entry(rq, &engine->timeline.requests, link) { 817 817 GEM_BUG_ON(!rq->global_seqno); 818 818 819 - if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &rq->fence.flags)) 819 + if (i915_request_signaled(rq)) 820 820 continue; 821 821 822 822 dma_fence_set_error(&rq->fence, -EIO);
+1 -1
drivers/gpu/drm/i915/intel_pm.c
··· 6662 6662 if (!rps->enabled) 6663 6663 return; 6664 6664 6665 - if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &rq->fence.flags)) 6665 + if (i915_request_signaled(rq)) 6666 6666 return; 6667 6667 6668 6668 /* Serializes with i915_request_retire() */
+1 -2
drivers/gpu/drm/i915/intel_ringbuffer.c
··· 836 836 list_for_each_entry(request, &engine->timeline.requests, link) { 837 837 GEM_BUG_ON(!request->global_seqno); 838 838 839 - if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, 840 - &request->fence.flags)) 839 + if (i915_request_signaled(request)) 841 840 continue; 842 841 843 842 dma_fence_set_error(&request->fence, -EIO);