drm/i915: Use atomic waits for short non-atomic ones
authorTvrtko Ursulin <tvrtko.ursulin@intel.com>
Wed, 29 Jun 2016 11:27:22 +0000 (12:27 +0100)
committerTvrtko Ursulin <tvrtko.ursulin@intel.com>
Wed, 29 Jun 2016 14:53:15 +0000 (15:53 +0100)
commit18f4b8435c50888bb36cf8de3b7f0075f00dc12c
tree22fc1a86c1c0461f418df08faccce9e92540d664
parentc68b0ab2e08fd8913a794d11e74cbf5cd589b3df
drm/i915: Use atomic waits for short non-atomic ones

usleep_range is not recommended for waits shorten than 10us.

Make the wait_for_us use the atomic variant for such waits.

To do so we need to reimplement the _wait_for_atomic macro to
be safe with regards to preemption and interrupts.

v2: Reimplement _wait_for_atomic to be irq and preemption safe.
    (Chris Wilson and Imre Deak)

v3: Fixed in_atomic check due rebase error.
v4: Build bug on non-constant timeouts.
v5: Compile away cpu migration code in atomic paths.

Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Imre Deak <imre.deak@intel.com>
Cc: Mika Kuoppala <mika.kuoppala@intel.com>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1467114710-29989-1-git-send-email-tvrtko.ursulin@linux.intel.com
drivers/gpu/drm/i915/intel_drv.h