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

Commit ada8c413 authored by Oscar Mateo's avatar Oscar Mateo Committed by Chris Wilson
Browse files

drm/i915/guc: Small improvements to guc_wq_item_append

parent 048d2847
Loading
Loading
Loading
Loading
+7 −8
Original line number Diff line number Diff line
@@ -471,6 +471,7 @@ static void guc_wq_item_append(struct i915_guc_client *client,
	const size_t wqi_size = sizeof(struct guc_wq_item);
	const u32 wqi_len = wqi_size / sizeof(u32) - 1;
	struct intel_engine_cs *engine = rq->engine;
	struct i915_gem_context *ctx = rq->ctx;
	struct guc_process_desc *desc = __get_process_desc(client);
	struct guc_wq_item *wqi;
	u32 freespace, tail, wq_off;
@@ -479,8 +480,7 @@ static void guc_wq_item_append(struct i915_guc_client *client,
	freespace = CIRC_SPACE(client->wq_tail, desc->head, client->wq_size);
	GEM_BUG_ON(freespace < wqi_size);

	/* The GuC firmware wants the tail index in QWords, not bytes */
	tail = intel_ring_set_tail(rq->ring, rq->tail) >> 3;
	tail = intel_ring_set_tail(rq->ring, rq->tail) / sizeof(u64);
	GEM_BUG_ON(tail > WQ_RING_TAIL_MAX);

	/* For now workqueue item is 4 DWs; workqueue buffer is 2 pages. So we
@@ -509,8 +509,7 @@ static void guc_wq_item_append(struct i915_guc_client *client,
		      (engine->guc_id << WQ_TARGET_SHIFT) |
		      WQ_NO_WCFLUSH_WAIT;

	/* The GuC wants only the low-order word of the context descriptor */
	wqi->context_desc = (u32)intel_lr_context_descriptor(rq->ctx, engine);
	wqi->context_desc = lower_32_bits(intel_lr_context_descriptor(ctx, engine));

	wqi->submit_element_info = tail << WQ_RING_TAIL_SHIFT;
	wqi->fence_id = rq->global_seqno;