drm/i915: Skip switch to kernel context if already done
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 29 Dec 2016 14:40:37 +0000 (14:40 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Mon, 16 Jan 2017 12:21:20 +0000 (12:21 +0000)
commit9a8f084f133b621b2636b1db2f7f6a4cb9a63bec
tree46c67788de336dc3fe65fc6c2daa3e2936e10fdc
parent9e43641ffb429700056500000b2ebbd8dbc2ef83
drm/i915: Skip switch to kernel context if already done

Some engines are never user or already sitting idle in the kernel
context and for those we can skip flushing the current context for
i915_gem_switch_to_kernel_context(). We used to perform this
optimisation but that was removed for convenience of converting over to
multiple timelines and handling the pending request queues.

From the perspective of writing selftests, reducing the number of
background operations on the engines makes defining assertions easier.

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