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

Commit 57e21513 authored by Dave Gordon's avatar Dave Gordon Committed by Daniel Vetter
Browse files

drm/i915: Check for matching ringbuffer in logical_ring_wait_request()



The request queue is per-engine, and may therefore contain requests
from several different contexts/ringbuffers. In determining which
request to wait for, this function should only consider requests
from the ringbuffer that it's checking for space, and ignore any
that it finds that belong to other contexts.

Signed-off-by: default avatarDave Gordon <david.s.gordon@intel.com>
Reviewed-by: default avatarDeepak S <deepak.s@linux.intel.com>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
parent b32c6f48
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -930,6 +930,16 @@ static int logical_ring_wait_request(struct intel_ringbuffer *ringbuf,
	}

	list_for_each_entry(request, &ring->request_list, list) {
		/*
		 * The request queue is per-engine, so can contain requests
		 * from multiple ringbuffers. Here, we must ignore any that
		 * aren't from the ringbuffer we're considering.
		 */
		struct intel_context *ctx = request->ctx;
		if (ctx->engine[ring->id].ringbuf != ringbuf)
			continue;

		/* Would completion of this request free enough space? */
		if (__intel_ring_space(request->tail, ringbuf->tail,
				       ringbuf->size) >= bytes) {
			seqno = request->seqno;