Re: [PATCH] drm/i915/selftests: Flush the context worker

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

 



Quoting Mika Kuoppala (2019-12-30 16:00:22)
> Chris Wilson <chris@xxxxxxxxxxxxxxxxxx> writes:
> 
> > When cleaning up the mock device, remember to flush the context worker
> > to free the residual GEM contexts before shutting down the device.
> >
> > Closes: https://gitlab.freedesktop.org/drm/intel/issues/802
> > Signed-off-by: Chris Wilson <chris@xxxxxxxxxxxxxxxxxx>
> > Cc: Matthew Auld <matthew.auld@xxxxxxxxx>
> > ---
> >  drivers/gpu/drm/i915/i915_gem.c                  | 4 ++--
> >  drivers/gpu/drm/i915/selftests/mock_gem_device.c | 2 ++
> >  2 files changed, 4 insertions(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/i915_gem.c b/drivers/gpu/drm/i915/i915_gem.c
> > index 9ddcf17230e6..a3d701b50a6b 100644
> > --- a/drivers/gpu/drm/i915/i915_gem.c
> > +++ b/drivers/gpu/drm/i915/i915_gem.c
> > @@ -1172,6 +1172,8 @@ void i915_gem_driver_remove(struct drm_i915_private *dev_priv)
> >  
> >  void i915_gem_driver_release(struct drm_i915_private *dev_priv)
> >  {
> > +     i915_gem_driver_release__contexts(dev_priv);
> > +
> >       intel_gt_driver_release(&dev_priv->gt);
> >  
> >       intel_wa_list_free(&dev_priv->gt_wa_list);
> > @@ -1179,8 +1181,6 @@ void i915_gem_driver_release(struct drm_i915_private *dev_priv)
> >       intel_uc_cleanup_firmwares(&dev_priv->gt.uc);
> >       i915_gem_cleanup_userptr(dev_priv);
> >  
> > -     i915_gem_driver_release__contexts(dev_priv);
> > -
> 
> Have I missed some memo on double underscores?

Nah, it's something I've tried that has caught on. For situations like
this where we are calling a subroutine for a subphase, and not operating
on a subobject.

We could do i915_gem_contexts_driver_release(&i915->gem.contexts) which is
probably more sensible now that we have i915->gem.contexts.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/intel-gfx



[Index of Archives]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux