[Intel-gfx] [PATCH 1/2] drm/i915/gt: Allow clobbering gpu resets if the display is off
Chris Wilson
chris at chris-wilson.co.uk
Wed Sep 11 10:01:51 UTC 2019
Quoting Ville Syrjälä (2019-09-10 09:58:38)
> On Tue, Sep 10, 2019 at 09:32:45AM +0100, Chris Wilson wrote:
> > Quoting Ville Syrjälä (2019-09-10 08:39:31)
> > > On Mon, Sep 09, 2019 at 11:55:35PM +0100, Chris Wilson wrote:
> > > > If the display is inactive, we need not worry about the gpu reset
> > > > clobbering the display!
> > > >
> > > > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > > > ---
> > > > drivers/gpu/drm/i915/gt/intel_reset.c | 18 +++++++++++++++++-
> > > > 1 file changed, 17 insertions(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/gpu/drm/i915/gt/intel_reset.c b/drivers/gpu/drm/i915/gt/intel_reset.c
> > > > index b9d84d52e986..fe57296b790c 100644
> > > > --- a/drivers/gpu/drm/i915/gt/intel_reset.c
> > > > +++ b/drivers/gpu/drm/i915/gt/intel_reset.c
> > > > @@ -7,6 +7,7 @@
> > > > #include <linux/sched/mm.h>
> > > > #include <linux/stop_machine.h>
> > > >
> > > > +#include "display/intel_display.h"
> > > > #include "display/intel_display_types.h"
> > > > #include "display/intel_overlay.h"
> > > >
> > > > @@ -729,6 +730,21 @@ static void nop_submit_request(struct i915_request *request)
> > > > intel_engine_queue_breadcrumbs(engine);
> > > > }
> > > >
> > > > +static bool reset_clobbers_display(struct drm_i915_private *i915)
> > > > +{
> > > > + struct intel_crtc *crtc;
> > > > +
> > > > + if (!INTEL_INFO(i915)->gpu_reset_clobbers_display)
> > > > + return false;
> > > > +
> > > > + for_each_intel_crtc(&i915->drm, crtc) {
> > > > + if (crtc->active)
> > > > + return true;
> > > > + }
> > >
> > > This feels racy. crtc->active gets set somewhere in the middle of the
> > > modeset, so looks like now we could clobber all the stuff we've already
> > > set up before crtc->active got set.
> >
> > The question is, does it matter? After we unwedge, we clobber again for
> > realz. Not that we have anything deliberately trying to race
> > wedge-vs-modeset(on/off).
>
> Not sure. But I suspect the hw might decide to hang the box if eg.
> the PLL is borked when we touch something that really needs the clock.
crtc->active only changes within the atomic_tail? Worst case I guess is
we add
srcu = -ENODEV;
if (i915->gpu_reset_clobbers_display)
/* only fails if interrupted */
srcu = intel_gt_reset_trylock(&i915->gt);
...
if (srcu > 0)
intel_gt_reset_unlock(&i915->gt, srcu);
-Chris
More information about the Intel-gfx
mailing list