Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4daffb66 authored by Chris Wilson's avatar Chris Wilson
Browse files

drm/i915: Stop storing the context name as the timeline name



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: default avatarChris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: default avatarTvrtko Ursulin <tvrtko.ursulin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190321140711.11190-4-chris@chris-wilson.co.uk
parent 3e055312
Loading
Loading
Loading
Loading
+2 −3
Original line number Original line Diff line number Diff line
@@ -673,9 +673,8 @@ last_request_on_engine(struct i915_timeline *timeline,
	rq = i915_active_request_raw(&timeline->last_request,
	rq = i915_active_request_raw(&timeline->last_request,
				     &engine->i915->drm.struct_mutex);
				     &engine->i915->drm.struct_mutex);
	if (rq && rq->engine == engine) {
	if (rq && rq->engine == engine) {
		GEM_TRACE("last request for %s on engine %s: %llx:%llu\n",
		GEM_TRACE("last request on engine %s: %llx:%llu\n",
			  timeline->name, engine->name,
			  engine->name, rq->fence.context, rq->fence.seqno);
			  rq->fence.context, rq->fence.seqno);
		GEM_BUG_ON(rq->timeline != timeline);
		GEM_BUG_ON(rq->timeline != timeline);
		return rq;
		return rq;
	}
	}
+2 −5
Original line number Original line Diff line number Diff line
@@ -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))
	if (test_bit(DMA_FENCE_FLAG_SIGNALED_BIT, &fence->flags))
		return "signaled";
		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)
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
		 * is just about to be. Either works, if we miss the last two
		 * noops - they are safe to be replayed on a reset.
		 * 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);
		tail = READ_ONCE(request->tail);
		list_del(&ring->active_link);
		list_del(&ring->active_link);
	} else {
	} else {
@@ -1064,10 +1063,8 @@ void i915_request_add(struct i915_request *request)
	__i915_active_request_set(&timeline->last_request, request);
	__i915_active_request_set(&timeline->last_request, request);


	list_add_tail(&request->ring_link, &ring->request_list);
	list_add_tail(&request->ring_link, &ring->request_list);
	if (list_is_first(&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);
		list_add(&ring->active_link, &request->i915->gt.active_rings);
		list_add(&ring->active_link, &request->i915->gt.active_rings);
	}
	request->i915->gt.active_engines |= request->engine->mask;
	request->i915->gt.active_engines |= request->engine->mask;
	request->emitted_jiffies = jiffies;
	request->emitted_jiffies = jiffies;


+1 −4
Original line number Original line Diff line number Diff line
@@ -197,7 +197,6 @@ static void cacheline_free(struct i915_timeline_cacheline *cl)


int i915_timeline_init(struct drm_i915_private *i915,
int i915_timeline_init(struct drm_i915_private *i915,
		       struct i915_timeline *timeline,
		       struct i915_timeline *timeline,
		       const char *name,
		       struct i915_vma *hwsp)
		       struct i915_vma *hwsp)
{
{
	void *vaddr;
	void *vaddr;
@@ -213,7 +212,6 @@ int i915_timeline_init(struct drm_i915_private *i915,
	BUILD_BUG_ON(KSYNCMAP < I915_NUM_ENGINES);
	BUILD_BUG_ON(KSYNCMAP < I915_NUM_ENGINES);


	timeline->i915 = i915;
	timeline->i915 = i915;
	timeline->name = name;
	timeline->pin_count = 0;
	timeline->pin_count = 0;
	timeline->has_initial_breadcrumb = !hwsp;
	timeline->has_initial_breadcrumb = !hwsp;
	timeline->hwsp_cacheline = NULL;
	timeline->hwsp_cacheline = NULL;
@@ -342,7 +340,6 @@ void i915_timeline_fini(struct i915_timeline *timeline)


struct i915_timeline *
struct i915_timeline *
i915_timeline_create(struct drm_i915_private *i915,
i915_timeline_create(struct drm_i915_private *i915,
		     const char *name,
		     struct i915_vma *global_hwsp)
		     struct i915_vma *global_hwsp)
{
{
	struct i915_timeline *timeline;
	struct i915_timeline *timeline;
@@ -352,7 +349,7 @@ i915_timeline_create(struct drm_i915_private *i915,
	if (!timeline)
	if (!timeline)
		return ERR_PTR(-ENOMEM);
		return ERR_PTR(-ENOMEM);


	err = i915_timeline_init(i915, timeline, name, global_hwsp);
	err = i915_timeline_init(i915, timeline, global_hwsp);
	if (err) {
	if (err) {
		kfree(timeline);
		kfree(timeline);
		return ERR_PTR(err);
		return ERR_PTR(err);
+0 −2
Original line number Original line Diff line number Diff line
@@ -32,7 +32,6 @@


int i915_timeline_init(struct drm_i915_private *i915,
int i915_timeline_init(struct drm_i915_private *i915,
		       struct i915_timeline *tl,
		       struct i915_timeline *tl,
		       const char *name,
		       struct i915_vma *hwsp);
		       struct i915_vma *hwsp);
void i915_timeline_fini(struct i915_timeline *tl);
void i915_timeline_fini(struct i915_timeline *tl);


@@ -57,7 +56,6 @@ i915_timeline_set_subclass(struct i915_timeline *timeline,


struct i915_timeline *
struct i915_timeline *
i915_timeline_create(struct drm_i915_private *i915,
i915_timeline_create(struct drm_i915_private *i915,
		     const char *name,
		     struct i915_vma *global_hwsp);
		     struct i915_vma *global_hwsp);


static inline struct i915_timeline *
static inline struct i915_timeline *
+0 −1
Original line number Original line Diff line number Diff line
@@ -71,7 +71,6 @@ struct i915_timeline {
	struct i915_active_request barrier;
	struct i915_active_request barrier;


	struct list_head link;
	struct list_head link;
	const char *name;
	struct drm_i915_private *i915;
	struct drm_i915_private *i915;


	struct kref kref;
	struct kref kref;
Loading