[Intel-gfx] [PATCH 4/6] drm/i915: Track per-context engine busyness

Chris Wilson chris at chris-wilson.co.uk
Sun Feb 9 11:02:16 UTC 2020


Quoting Tvrtko Ursulin (2020-02-07 16:13:29)
>                 } else {
> -                       GEM_BUG_ON(!*execlists->active);
> +                       rq = *execlists->active++;
> +                       GEM_BUG_ON(!rq);
> +
> +                       GEM_BUG_ON(execlists->active - execlists->inflight >
> +                                  execlists_num_ports(execlists));
>  
>                         /* port0 completed, advanced to port1 */
>                         trace_ports(execlists, "completed", execlists->active);
> @@ -2327,13 +2359,15 @@ static void process_csb(struct intel_engine_cs *engine)
>                          * coherent (visible from the CPU) before the
>                          * user interrupt and CSB is processed.
>                          */
> -                       GEM_BUG_ON(!i915_request_completed(*execlists->active) &&
> +                       GEM_BUG_ON(!i915_request_completed(rq) &&
>                                    !reset_in_progress(execlists));
> -                       execlists_schedule_out(*execlists->active++);
>  
> -                       GEM_BUG_ON(execlists->active - execlists->inflight >
> -                                  execlists_num_ports(execlists));
> +                       execlists_schedule_out(rq);

We don't need to touch this branch...

>                 }
> +
> +               rq = *execlists->active;
> +               if (rq)
> +                       intel_context_stats_start(rq->context);

As this can be done after the loop. I think combining it with the
set_timeslice would be nice (both are 'time' related).

>         } while (head != tail);
>  
>         execlists->csb_head = head;


More information about the Intel-gfx mailing list