[Intel-gfx] [PATCH 6/8] drm/i915/gt: Use virtual_engine during execlists_dequeue

Chris Wilson chris at chris-wilson.co.uk
Mon May 18 10:57:42 UTC 2020


Quoting Tvrtko Ursulin (2020-05-18 11:51:40)
> 
> On 18/05/2020 09:14, Chris Wilson wrote:
> > @@ -2125,9 +2128,10 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
> >        * find itself trying to jump back into a context it has just
> >        * completed and barf.
> >        */
> > -
> >       if ((last = *active)) {
> > -             if (need_preempt(engine, last, rb)) {
> > +             ve = first_virtual_engine(engine);
> 
> If you left this outside the if..
> 
> > @@ -2212,9 +2216,8 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
> >               }
> >       }
> >   
> > -     while (rb) { /* XXX virtual is always taking precedence */
> > -             struct virtual_engine *ve =
> > -                     rb_entry(rb, typeof(*ve), nodes[engine->id].rb);
> > +     /* XXX virtual is always taking precedence */
> > +     while ((ve = first_virtual_engine(engine))) {
> 
> ... then here you wouldn't have to do a re-lookup of the same node, right?

But since we loop inside here, we need to recheck either at the continue
or here.

So:
	ve = first_virtual_engine();
	...
	if (ve) do {
	} while (ve = first_virtual_engine());

is kind of what we want, so a

	while (ve) {
	next_virtual_engine:
		ve = first_virtual_engine()
	}

instead of continues?
-Chris


More information about the Intel-gfx mailing list