Re: [PATCH 1/3] drm/i915/execlists: Microoptimise execlists_cancel_port_request()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Quoting Mika Kuoppala (2017-09-25 14:00:17)
> Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> writes:
> 
> > Just rearrange the code slightly to trim the number of iterations
> > required.
> >
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > ---
> >  drivers/gpu/drm/i915/intel_lrc.c | 17 ++++++++++-------
> >  1 file changed, 10 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> > index 3623403a4f2d..2c07f3c08bd3 100644
> > --- a/drivers/gpu/drm/i915/intel_lrc.c
> > +++ b/drivers/gpu/drm/i915/intel_lrc.c
> > @@ -571,14 +571,17 @@ static void execlists_dequeue(struct intel_engine_cs *engine)
> >               execlists_submit_ports(engine);
> >  }
> >  
> > -static void execlist_cancel_port_requests(struct intel_engine_execlists *execlists)
> > +static void
> > +execlist_cancel_port_requests(struct intel_engine_execlists *execlists)
> >  {
> > -     unsigned int i;
> > -
> > -     for (i = 0; i < ARRAY_SIZE(execlists->port); i++)
> > -             i915_gem_request_put(port_request(&execlists->port[i]));
> > +     struct execlist_port *port = execlists->port;
> > +     unsigned int num_ports = ARRAY_SIZE(execlists->port);
> >  
> > -     memset(execlists->port, 0, sizeof(execlists->port));
> > +     while (num_ports-- && port_isset(port)) {
> > +             i915_gem_request_put(port_request(port));
> > +             memset(port, 0, sizeof(*port));
> > +             port++;
> > +     }
> 
> I thought this to be more about the reset and thus memsetting
> everything would give us a clean plate. However now it matches
> more of what the function is about.
> 
> Reviewed-by: Mika Kuoppala <mika.kuoppala@xxxxxxxxxxxxxxx>

Pushed this one just to keep whittling down the number of patches.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux