All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ben Widawsky <ben@bwidawsk.net>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: Dave Airlie <airlied@redhat.com>,
	intel-gfx@lists.freedesktop.org, Woodhouse <dwmw2@infradead.org>,
	David@freedesktop.org
Subject: Re: [PATCH v2 2/4] drm/i915: Ironlake mobile GPU with VT-d fix
Date: Fri, 14 Oct 2011 19:08:25 -0700	[thread overview]
Message-ID: <20111014190825.6f10070f@bwidawsk.net> (raw)
In-Reply-To: <20110926072317.GA2804@phenom.ffwll.local>

On Mon, 26 Sep 2011 09:23:17 +0200
Daniel Vetter <daniel@ffwll.ch> wrote:

> On Sun, Sep 25, 2011 at 04:42:57PM -0700, Ben Widawsky wrote:
> > > >  static int sandybridge_write_fence_reg(struct drm_i915_gem_object
> > > > *obj, diff --git a/drivers/gpu/drm/i915/i915_gem_gtt.c
> > > > b/drivers/gpu/drm/i915/i915_gem_gtt.c index 7a709cd..0c6226b 100644
> > > > --- a/drivers/gpu/drm/i915/i915_gem_gtt.c
> > > > +++ b/drivers/gpu/drm/i915/i915_gem_gtt.c
> > > > @@ -49,10 +49,39 @@ static unsigned int
> > > > cache_level_to_agp_type(struct drm_device *dev, }
> > > >  }
> > > >  
> > > > +static bool do_idling(struct drm_i915_private *dev_priv)
> > > > +{
> > > > +	bool ret = dev_priv->mm.interruptible;
> > > > +
> > > > +	if (dev_priv->mm.gtt->do_idle_maps) {
> > > > +		dev_priv->mm.interruptible = false;
> > > > +		if (i915_gpu_idle(dev_priv->dev))
> > > > +			DRM_ERROR("couldn't idle GPU %d\n", ret);
> > > > +	}
> > > 
> > > I don't like the uninterruptible sleep in core gem - this is only for
> > > modesetting where backtracking is just not really feasible. I've
> > > quickly checked the code and I haven't seen any problems in handing
> > > back the -ERESTARTSYS to gem_object_unbind.
> > > 
> > 
> > While I agree that we could probably return at idle time, we have to
> > guarantee that no GPU activity occurs until the unmap has completed. I
> > checked the code and don't really understand how it can occur, but I
> > believe it *can* occur as I've seen it happen in the idle function. Any
> > other proposal how to fix this, or any proof that the GPU can't wake up
> > to do display stuff while doing the unmap?
> 
> Hm, looks like some misunderstanding. I understand why the gpu_idle needs
> to be here, my gripes are solely with the uninterruptible sleep that you
> use. I think a normal interruptible sleep with passing back the return
> value to gem_unbind_object should work: By the time we're calling
> gtt_unbind_object in gem_unbind_object we have not yet committed to the
> unbound state, so can just bail out if the mappings are still there. And
> gtt_unbind_object idles the gpu before touching the mappings, so when we
> have to bail out with -ERESTARTSYS the mapping is untouched and everything
> safe.
> -Daniel

Okay. I agree your suggestion works. I've changed the code to do this. I
will not listen to you for a while if someone comes in and just says
make it non interruptible, because it seems to be happening a lot
recently :P

Ben

  reply	other threads:[~2011-10-15  2:08 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-09-24 22:23 [PATCH v2 0/4] Ironlake mobile GPU with VT-d, fix Ben Widawsky
2011-09-24 22:23 ` [PATCH v2 1/4] drm/i915: add warning for unidle GPU Ben Widawsky
2011-09-25 10:16   ` Daniel Vetter
2011-09-25 11:15     ` Chris Wilson
2011-09-24 22:23 ` [PATCH v2 2/4] drm/i915: Ironlake mobile GPU with VT-d fix Ben Widawsky
2011-09-24 22:41   ` Ben Widawsky
2011-09-25  9:40   ` Daniel Vetter
2011-09-25 23:42     ` Ben Widawsky
2011-09-26  7:23       ` Daniel Vetter
2011-10-15  2:08         ` Ben Widawsky [this message]
2011-09-24 22:23 ` [PATCH v2 3/4] intel-iommu: IOTLB hang workaround Ben Widawsky
2011-09-24 22:23 ` [PATCH v2 4/4] drm/i915: add unidle warning back Ben Widawsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20111014190825.6f10070f@bwidawsk.net \
    --to=ben@bwidawsk.net \
    --cc=David@freedesktop.org \
    --cc=airlied@redhat.com \
    --cc=daniel@ffwll.ch \
    --cc=dwmw2@infradead.org \
    --cc=intel-gfx@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.