]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commitdiff
drm/i915: Stop storing the context name as the timeline name
authorChris Wilson <chris@chris-wilson.co.uk>
Thu, 21 Mar 2019 14:07:11 +0000 (14:07 +0000)
committerChris Wilson <chris@chris-wilson.co.uk>
Thu, 21 Mar 2019 15:59:31 +0000 (15:59 +0000)
The timeline->name is only used for convenience in pretty printing the
i915_request.fence->ops->get_timeline_name() and it is just as
convenient to pull it from the gem_context directly. The few instances
of its use inside GEM_TRACE() has proven more of a nuisance than
helpful, so not worth saving imo.

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/20190321140711.11190-4-chris@chris-wilson.co.uk
drivers/gpu/drm/i915/i915_gem_context.c
drivers/gpu/drm/i915/i915_request.c
drivers/gpu/drm/i915/i915_timeline.c
drivers/gpu/drm/i915/i915_timeline.h
drivers/gpu/drm/i915/i915_timeline_types.h
drivers/gpu/drm/i915/intel_engine_cs.c
drivers/gpu/drm/i915/intel_lrc.c
drivers/gpu/drm/i915/intel_ringbuffer.c
drivers/gpu/drm/i915/selftests/i915_timeline.c
drivers/gpu/drm/i915/selftests/mock_engine.c

index 9187910391d8f7ecdecf433abac684693af9a481..00dec72f687584090dc2c15c1491c30cfa7bd523 100644 (file)
@@ -673,9 +673,8 @@ last_request_on_engine(struct i915_timeline *timeline,
        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,
-                         rq->fence.context, rq->fence.seqno);
+               GEM_TRACE("last request on engine %s: %llx:%llu\n",
+                         engine->name, rq->fence.context, rq->fence.seqno);
                GEM_BUG_ON(rq->timeline != timeline);
                return rq;
        }
index 0a3d94517d0a344543d41d7ab7721be65fe45f3f..1529824d7c613f6a8b4a142719265001f505eb21 100644 (file)
@@ -66,7 +66,7 @@ static const char *i915_fence_get_timeline_name(struct dma_fence *fence)
        if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
                return "signaled";
 
-       return to_request(fence)->timeline->name;
+       return to_request(fence)->gem_context->name ?: "[i915]";
 }
 
 static bool i915_fence_signaled(struct dma_fence *fence)
@@ -167,7 +167,6 @@ static void advance_ring(struct i915_request *request)
                 * is just about to be. Either works, if we miss the last two
                 * noops - they are safe to be replayed on a reset.
                 */
-               GEM_TRACE("marking %s as inactive\n", ring->timeline->name);
                tail = READ_ONCE(request->tail);
                list_del(&ring->active_link);
        } else {
@@ -1064,10 +1063,8 @@ void i915_request_add(struct i915_request *request)
        __i915_active_request_set(&timeline->last_request, request);
 
        list_add_tail(&request->ring_link, &ring->request_list);
-       if (list_is_first(&request->ring_link, &ring->request_list)) {
-               GEM_TRACE("marking %s as active\n", ring->timeline->name);
+       if (list_is_first(&request->ring_link, &ring->request_list))
                list_add(&ring->active_link, &request->i915->gt.active_rings);
-       }
        request->i915->gt.active_engines |= request->engine->mask;
        request->emitted_jiffies = jiffies;
 
index 8484ba6e51d1caa3afe8d7cf153c983b4eb87272..2f49073649205875b5e2611b3e977e3d9c3dc0a3 100644 (file)
@@ -197,7 +197,6 @@ static void cacheline_free(struct i915_timeline_cacheline *cl)
 
 int i915_timeline_init(struct drm_i915_private *i915,
                       struct i915_timeline *timeline,
-                      const char *name,
                       struct i915_vma *hwsp)
 {
        void *vaddr;
@@ -213,7 +212,6 @@ int i915_timeline_init(struct drm_i915_private *i915,
        BUILD_BUG_ON(KSYNCMAP < I915_NUM_ENGINES);
 
        timeline->i915 = i915;
-       timeline->name = name;
        timeline->pin_count = 0;
        timeline->has_initial_breadcrumb = !hwsp;
        timeline->hwsp_cacheline = NULL;
@@ -342,7 +340,6 @@ void i915_timeline_fini(struct i915_timeline *timeline)
 
 struct i915_timeline *
 i915_timeline_create(struct drm_i915_private *i915,
-                    const char *name,
                     struct i915_vma *global_hwsp)
 {
        struct i915_timeline *timeline;
@@ -352,7 +349,7 @@ i915_timeline_create(struct drm_i915_private *i915,
        if (!timeline)
                return ERR_PTR(-ENOMEM);
 
-       err = i915_timeline_init(i915, timeline, name, global_hwsp);
+       err = i915_timeline_init(i915, timeline, global_hwsp);
        if (err) {
                kfree(timeline);
                return ERR_PTR(err);
index 9126c82064903a86e67b77fa6f956e973a36fd85..c1e47a423d85010d932ad774655dd05933533a14 100644 (file)
@@ -32,7 +32,6 @@
 
 int i915_timeline_init(struct drm_i915_private *i915,
                       struct i915_timeline *tl,
-                      const char *name,
                       struct i915_vma *hwsp);
 void i915_timeline_fini(struct i915_timeline *tl);
 
@@ -57,7 +56,6 @@ i915_timeline_set_subclass(struct i915_timeline *timeline,
 
 struct i915_timeline *
 i915_timeline_create(struct drm_i915_private *i915,
-                    const char *name,
                     struct i915_vma *global_hwsp);
 
 static inline struct i915_timeline *
index 8ff146dc05ba271a6e4deba5266bf3cce41f6e4d..12ba3c573aa0b5c8d5ec774cc53fe8c9f41b698c 100644 (file)
@@ -71,7 +71,6 @@ struct i915_timeline {
        struct i915_active_request barrier;
 
        struct list_head link;
-       const char *name;
        struct drm_i915_private *i915;
 
        struct kref kref;
index 588c640b5a57213a4fd523b5ca23268aea837bdd..24de34289d6860ab7eb210a101934da938a2ef4e 100644 (file)
@@ -581,7 +581,6 @@ int intel_engine_setup_common(struct intel_engine_cs *engine)
 
        err = i915_timeline_init(engine->i915,
                                 &engine->timeline,
-                                engine->name,
                                 engine->status_page.vma);
        if (err)
                goto err_hwsp;
@@ -660,7 +659,7 @@ static int measure_breadcrumb_dw(struct intel_engine_cs *engine)
                return -ENOMEM;
 
        if (i915_timeline_init(engine->i915,
-                              &frame->timeline, "measure",
+                              &frame->timeline,
                               engine->status_page.vma))
                goto out_frame;
 
index 82ee3f66956433f324fcd68998c91ecfe0c23549..131b89972a783e43570e8a104adc89608bfcabb5 100644 (file)
@@ -2805,7 +2805,7 @@ err_unpin_ctx:
 
 static struct i915_timeline *get_timeline(struct i915_gem_context *ctx)
 {
-       return i915_timeline_create(ctx->i915, ctx->name, NULL);
+       return i915_timeline_create(ctx->i915, NULL);
 }
 
 static int execlists_context_deferred_alloc(struct intel_context *ce,
index 720d39729ead8d929f470bc382bb69b17abbd3b5..03bbdf47e7e487033a55e7b199a77121e16a5a54 100644 (file)
@@ -1553,9 +1553,7 @@ static int intel_init_ring_buffer(struct intel_engine_cs *engine)
        if (err)
                return err;
 
-       timeline = i915_timeline_create(engine->i915,
-                                       engine->name,
-                                       engine->status_page.vma);
+       timeline = i915_timeline_create(engine->i915, engine->status_page.vma);
        if (IS_ERR(timeline)) {
                err = PTR_ERR(timeline);
                goto err;
index 844701759ffc14f27f3573a28738387a6e531b72..8e7bcaa1eb663c19638abf724986ff0675bef1c9 100644 (file)
@@ -64,7 +64,7 @@ static int __mock_hwsp_timeline(struct mock_hwsp_freelist *state,
                unsigned long cacheline;
                int err;
 
-               tl = i915_timeline_create(state->i915, "mock", NULL);
+               tl = i915_timeline_create(state->i915, NULL);
                if (IS_ERR(tl))
                        return PTR_ERR(tl);
 
@@ -476,7 +476,7 @@ checked_i915_timeline_create(struct drm_i915_private *i915)
 {
        struct i915_timeline *tl;
 
-       tl = i915_timeline_create(i915, "live", NULL);
+       tl = i915_timeline_create(i915, NULL);
        if (IS_ERR(tl))
                return tl;
 
@@ -658,7 +658,7 @@ static int live_hwsp_wrap(void *arg)
        mutex_lock(&i915->drm.struct_mutex);
        wakeref = intel_runtime_pm_get(i915);
 
-       tl = i915_timeline_create(i915, __func__, NULL);
+       tl = i915_timeline_create(i915, NULL);
        if (IS_ERR(tl)) {
                err = PTR_ERR(tl);
                goto out_rpm;
index 61744819172ba79eeff4440c810278513c6e84b3..61a8206ed6772cdbe7c6811d7d11b5d99d7e78c1 100644 (file)
@@ -50,9 +50,7 @@ static struct intel_ring *mock_ring(struct intel_engine_cs *engine)
        if (!ring)
                return NULL;
 
-       if (i915_timeline_init(engine->i915,
-                              &ring->timeline, engine->name,
-                              NULL)) {
+       if (i915_timeline_init(engine->i915, &ring->timeline, NULL)) {
                kfree(ring);
                return NULL;
        }
@@ -259,10 +257,7 @@ struct intel_engine_cs *mock_engine(struct drm_i915_private *i915,
        engine->base.reset.finish = mock_reset_finish;
        engine->base.cancel_requests = mock_cancel_requests;
 
-       if (i915_timeline_init(i915,
-                              &engine->base.timeline,
-                              engine->base.name,
-                              NULL))
+       if (i915_timeline_init(i915, &engine->base.timeline, NULL))
                goto err_free;
        i915_timeline_set_subclass(&engine->base.timeline, TIMELINE_ENGINE);