diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2017-11-20 10:20:02 +0000 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2017-11-20 15:56:16 +0000 |
commit | 3fef5cda970124a15c553c1672d800e40fc08a9e (patch) | |
tree | 6ba9c24bca258c8e3bab90a01d29fdfa4fdb9fc1 /drivers/gpu/drm/i915/selftests/i915_gem_request.c | |
parent | 2113184c6f6749f6e4e86a42894f67a50ead6775 (diff) |
drm/i915: Automatic i915_switch_context for legacy
During request construction, after pinning the context we know whether
or not we have to emit a context switch. So move this common operation
from every caller into i915_gem_request_alloc() itself.
v2: Always submit the request if we emitted some commands during request
construction, as typically it also involves changes in global state.
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Mika Kuoppala <mika.kuoppala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20171120102002.22254-2-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/selftests/i915_gem_request.c')
-rw-r--r-- | drivers/gpu/drm/i915/selftests/i915_gem_request.c | 10 |
1 files changed, 0 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/selftests/i915_gem_request.c b/drivers/gpu/drm/i915/selftests/i915_gem_request.c index d7bf53ff8f84..647bf2bbd799 100644 --- a/drivers/gpu/drm/i915/selftests/i915_gem_request.c +++ b/drivers/gpu/drm/i915/selftests/i915_gem_request.c @@ -459,10 +459,6 @@ empty_request(struct intel_engine_cs *engine, if (IS_ERR(request)) return request; - err = i915_switch_context(request); - if (err) - goto out_request; - err = engine->emit_bb_start(request, batch->node.start, batch->node.size, @@ -671,9 +667,6 @@ static int live_all_engines(void *arg) goto out_request; } - err = i915_switch_context(request[id]); - GEM_BUG_ON(err); - err = engine->emit_bb_start(request[id], batch->node.start, batch->node.size, @@ -790,9 +783,6 @@ static int live_sequential_engines(void *arg) } } - err = i915_switch_context(request[id]); - GEM_BUG_ON(err); - err = engine->emit_bb_start(request[id], batch->node.start, batch->node.size, |