[Intel-gfx] [PATCH 04/15] drm/i915: Flush the execlist ports if idle
Chris Wilson
chris at chris-wilson.co.uk
Thu Jul 20 12:28:59 UTC 2017
Quoting Mika Kuoppala (2017-07-20 13:18:40)
> > diff --git a/drivers/gpu/drm/i915/intel_lrc.c b/drivers/gpu/drm/i915/intel_lrc.c
> > index 3c83f2dd6798..ad61d1998fb7 100644
> > --- a/drivers/gpu/drm/i915/intel_lrc.c
> > +++ b/drivers/gpu/drm/i915/intel_lrc.c
> > @@ -1327,6 +1327,31 @@ static void reset_common_ring(struct intel_engine_cs *engine,
> > {
> > struct execlist_port *port = engine->execlist_port;
> > struct intel_context *ce;
> > + unsigned int n;
> > +
> > + /*
> > + * Catch up with any missed context-switch interrupts.
> > + *
> > + * Ideally we would just read the remaining CSB entries now that we
> > + * know the gpu is idle. However, the CSB registers are sometimes^W
> > + * often trashed across a GPU reset! Instead we have to rely on
> > + * guessing the missed context-switch events by looking at what
> > + * requests were completed.
> > + */
> > + if (!request) {
> > + for (n = 0; n < ARRAY_SIZE(engine->execlist_port); n++)
>
> You need to check against null before put in here?
dma_fence_put and i915_gem_request_put, by extension, are NULL-safe.
-Chris
More information about the Intel-gfx
mailing list