drm/i915: Switch the global i915.semaphores check to a local predicate
authorChris Wilson <chris@chris-wilson.co.uk>
Wed, 3 May 2017 09:39:24 +0000 (10:39 +0100)
committerChris Wilson <chris@chris-wilson.co.uk>
Wed, 3 May 2017 10:08:53 +0000 (11:08 +0100)
Rather than use a global modparam, we can just check to see if the
engine has semaphores configured upon it.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Link: http://patchwork.freedesktop.org/patch/msgid/20170503093924.5320-7-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_request.c

index b30d432415d81819fbca8d4b650f5f758b24693c..9074303c88887f9767ee18b09c1c87973d854ac2 100644 (file)
@@ -711,13 +711,15 @@ i915_gem_request_await_request(struct drm_i915_gem_request *to,
        if (!seqno)
                goto await_dma_fence;
 
-       if (!i915.semaphores) {
+       if (!to->engine->semaphore.sync_to) {
                if (!__i915_gem_request_started(from, seqno))
                        goto await_dma_fence;
 
                if (!__i915_spin_request(from, seqno, TASK_INTERRUPTIBLE, 2))
                        goto await_dma_fence;
        } else {
+               GEM_BUG_ON(!from->engine->semaphore.signal);
+
                if (seqno <= to->timeline->global_sync[from->engine->id])
                        return 0;