diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2019-02-05 16:00:05 +0300 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2019-02-05 20:20:11 +0300 |
commit | 21950ee7cc8f13c5350bda0cae22cdb7ac7e3058 (patch) | |
tree | 83c07ae5da83aa7ef95c5f8821b5ab8cf2b7dd08 /drivers/gpu/drm/i915/i915_gem_context.c | |
parent | 5f5c139d6900b3338963bddcd8a567dcad33cf92 (diff) | |
download | linux-21950ee7cc8f13c5350bda0cae22cdb7ac7e3058.tar.xz |
drm/i915: Pull i915_gem_active into the i915_active family
Looking forward, we need to break the struct_mutex dependency on
i915_gem_active. In the meantime, external use of i915_gem_active is
quite beguiling, little do new users suspect that it implies a barrier
as each request it tracks must be ordered wrt the previous one. As one
of many, it can be used to track activity across multiple timelines, a
shared fence, which fits our unordered request submission much better. We
need to steer external users away from the singular, exclusive fence
imposed by i915_gem_active to i915_active instead. As part of that
process, we move i915_gem_active out of i915_request.c into
i915_active.c to start separating the two concepts, and rename it to
i915_active_request (both to tie it to the concept of tracking just one
request, and to give it a longer, less appealing name).
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/20190205130005.2807-5-chris@chris-wilson.co.uk
Diffstat (limited to 'drivers/gpu/drm/i915/i915_gem_context.c')
-rw-r--r-- | drivers/gpu/drm/i915/i915_gem_context.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/drivers/gpu/drm/i915/i915_gem_context.c b/drivers/gpu/drm/i915/i915_gem_context.c index 93ab287f44b6..280813a4bf82 100644 --- a/drivers/gpu/drm/i915/i915_gem_context.c +++ b/drivers/gpu/drm/i915/i915_gem_context.c @@ -322,7 +322,7 @@ static u32 default_desc_template(const struct drm_i915_private *i915, return desc; } -static void intel_context_retire(struct i915_gem_active *active, +static void intel_context_retire(struct i915_active_request *active, struct i915_request *rq) { struct intel_context *ce = @@ -344,7 +344,8 @@ intel_context_init(struct intel_context *ce, /* Use the whole device by default */ ce->sseu = intel_device_default_sseu(ctx->i915); - init_request_active(&ce->active_tracker, intel_context_retire); + i915_active_request_init(&ce->active_tracker, + NULL, intel_context_retire); } static struct i915_gem_context * @@ -668,8 +669,8 @@ last_request_on_engine(struct i915_timeline *timeline, GEM_BUG_ON(timeline == &engine->timeline); - rq = i915_gem_active_raw(&timeline->last_request, - &engine->i915->drm.struct_mutex); + rq = i915_active_request_raw(&timeline->last_request, + &engine->i915->drm.struct_mutex); if (rq && rq->engine == engine) { GEM_TRACE("last request for %s on engine %s: %llx:%llu\n", timeline->name, engine->name, @@ -1015,8 +1016,8 @@ gen8_modify_rpcs_gpu(struct intel_context *ce, } /* Queue this switch after all other activity by this context. */ - prev = i915_gem_active_raw(&ce->ring->timeline->last_request, - &i915->drm.struct_mutex); + prev = i915_active_request_raw(&ce->ring->timeline->last_request, + &i915->drm.struct_mutex); if (prev && !i915_request_completed(prev)) { ret = i915_request_await_dma_fence(rq, &prev->fence); if (ret < 0) @@ -1039,9 +1040,9 @@ gen8_modify_rpcs_gpu(struct intel_context *ce, * But we only need to take one pin on the account of it. Or in other * words transfer the pinned ce object to tracked active request. */ - if (!i915_gem_active_isset(&ce->active_tracker)) + if (!i915_active_request_isset(&ce->active_tracker)) __intel_context_pin(ce); - i915_gem_active_set(&ce->active_tracker, rq); + __i915_active_request_set(&ce->active_tracker, rq); out_add: i915_request_add(rq); |