public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Ben Widawsky <ben@bwidawsk.net>,
	intel-gfx@lists.freedesktop.org,
	Ben Widawsky <benjamin.widawsky@intel.com>
Subject: Re: [PATCH 09/10] drm/i915: wait render timeout ioctl
Date: Sun, 22 Apr 2012 12:11:38 +0200	[thread overview]
Message-ID: <20120422101138.GD4723@phenom.ffwll.local> (raw)
In-Reply-To: <1335088110_18651@CP5-2952>

On Sun, Apr 22, 2012 at 10:48:01AM +0100, Chris Wilson wrote:
> On Fri, 20 Apr 2012 18:23:31 -0700, Ben Widawsky <ben@bwidawsk.net> wrote:
> > +int
> > +i915_gem_wait_ioctl(struct drm_device *dev, void *data, struct drm_file *file)
> > +{
> > +	struct drm_i915_gem_wait *args = data;
> > +	struct drm_i915_gem_object *obj;
> > +	struct intel_ring_buffer *ring;
> > +	long timeout;
> > +	u32 seqno = 0;
> > +	int ret = 0;
> > +
> > +	ret = i915_mutex_lock_interruptible(dev);
> > +	if (ret)
> > +		return ret;
> > +
> > +	obj = to_intel_bo(drm_gem_object_lookup(dev, file, args->bo_handle));
> > +	if (&obj->base == NULL) {
> > +		mutex_unlock(&dev->struct_mutex);
> > +		return -ENOENT;
> > +	}
> > +
> > +	timeout = args->timeout_ns;
> 
> We discussed on IRC whether or not we needed to flush here. For the
> drm_intel_gem_bo_wait_rendering() use-case, we do need to be able to first
> queue a flush.
> 
>   if (args->flags & I915_WAIT_FINISH)
> 	i915_gem_object_flush_gpu_write_domain(obj);
> 
> Borrowing the terminology from glFlush/glFinish. This becomes moot if
> the flushing list is ever vanquished, but still a useful distinction and
> required today.

Yeah, I agree that emitting any required flushes (akin to the busy ioctl)
makes sense here. While I bikeshed, the mutex_lock can be moved after
drm_gem_object_lookup - we only need the mutex when dropping the reference
(and hence the unref_unlocked variant).
-Daniel
-- 
Daniel Vetter
Mail: daniel@ffwll.ch
Mobile: +41 (0)79 365 57 48

  reply	other threads:[~2012-04-22 10:10 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-21  1:23 [PATCH 00/10] wait for BO with timeout Ben Widawsky
2012-04-21  1:23 ` [PATCH 01/10] drm/i915: remove do_retire from i915_wait_request Ben Widawsky
2012-04-21 17:17   ` Daniel Vetter
2012-04-21 17:27     ` Ben Widawsky
2012-04-21 17:36       ` Daniel Vetter
2012-04-21  1:23 ` [PATCH 02/10] drm/i915: move vbetool invoked ier stuff Ben Widawsky
2012-04-21  9:26   ` Chris Wilson
2012-04-21  1:23 ` [PATCH 03/10] drm/i915: kill waiting_seqno Ben Widawsky
2012-04-22 13:46   ` Chris Wilson
2012-04-22 17:47     ` Ben Widawsky
2012-04-21  1:23 ` [PATCH 04/10] drm/i915: drop polled waits from i915_wait_request Ben Widawsky
2012-04-21  9:29   ` Chris Wilson
2012-04-21 16:14     ` Ben Widawsky
2012-04-21  1:23 ` [PATCH 05/10] drm/i915: extract __wait_seqno " Ben Widawsky
2012-04-21  1:23 ` [PATCH 06/10] drm/i915: use __wait_seqno for ring throttle Ben Widawsky
2012-04-22 14:17   ` Chris Wilson
2012-04-21  1:23 ` [PATCH 07/10] drm/i915: timeout parameter for seqno wait Ben Widawsky
2012-04-22 12:52   ` Daniel Vetter
2012-04-21  1:23 ` [PATCH 08/10] drm/i915: real wait seqno with timeout Ben Widawsky
2012-04-21  1:23 ` [PATCH 09/10] drm/i915: wait render timeout ioctl Ben Widawsky
2012-04-21  9:41   ` Chris Wilson
2012-04-21 16:12     ` Ben Widawsky
2012-04-21 20:37       ` Ben Widawsky
2012-04-22  9:37       ` Chris Wilson
2012-04-22  9:48   ` Chris Wilson
2012-04-22 10:11     ` Daniel Vetter [this message]
2012-04-22 12:45   ` Daniel Vetter
2012-04-23 15:28     ` Ben Widawsky
2012-04-22 14:14   ` Chris Wilson
2012-04-21  1:23 ` [PATCH 10/10] drm/i915: s/i915_wait_reqest/i915_wait_seqno/g 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=20120422101138.GD4723@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=ben@bwidawsk.net \
    --cc=benjamin.widawsky@intel.com \
    --cc=chris@chris-wilson.co.uk \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox