Re: [Intel-gfx] [PATCH 09/10] drm/i915: wait render timeout ioctl

2012-04-23 Thread Ben Widawsky
On Sun, 22 Apr 2012 14:45:13 +0200 Daniel Vetter wrote: > On Fri, Apr 20, 2012 at 06:23:31PM -0700, Ben Widawsky wrote: > > Finally we can use the new timed seqno waiting function to allow > > userspace to wait on a request with a timeout. This implements that > > interface. > > > > The new ioct

Re: [Intel-gfx] [PATCH 09/10] drm/i915: wait render timeout ioctl

2012-04-22 Thread Chris Wilson
On Fri, 20 Apr 2012 18:23:31 -0700, Ben Widawsky wrote: > +out: > + args->timeout_ns = timeout * 1000; Multiple paths reach this point and a single one converted timeout to microseconds. -Chris -- Chris Wilson, Intel Open Source Technology Centre _

Re: [Intel-gfx] [PATCH 09/10] drm/i915: wait render timeout ioctl

2012-04-22 Thread Daniel Vetter
On Fri, Apr 20, 2012 at 06:23:31PM -0700, Ben Widawsky wrote: > Finally we can use the new timed seqno waiting function to allow > userspace to wait on a request with a timeout. This implements that > interface. > > The new ioctl is very straight forward, there is a flags field which I > envision

Re: [Intel-gfx] [PATCH 09/10] drm/i915: wait render timeout ioctl

2012-04-22 Thread Daniel Vetter
On Sun, Apr 22, 2012 at 10:48:01AM +0100, Chris Wilson wrote: > On Fri, 20 Apr 2012 18:23:31 -0700, Ben Widawsky 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_ge

Re: [Intel-gfx] [PATCH 09/10] drm/i915: wait render timeout ioctl

2012-04-22 Thread Chris Wilson
On Fri, 20 Apr 2012 18:23:31 -0700, Ben Widawsky 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 time

Re: [Intel-gfx] [PATCH 09/10] drm/i915: wait render timeout ioctl

2012-04-22 Thread Chris Wilson
On Sat, 21 Apr 2012 09:12:17 -0700, Ben Widawsky wrote: > On Sat, 21 Apr 2012 10:41:55 +0100 > Chris Wilson wrote: > > I think this whole interface is a stop-gap solution for pollable sync > > objects without a clear use case. Do we have a spec for a feature > > wishing to build upon this interfa

Re: [Intel-gfx] [PATCH 09/10] drm/i915: wait render timeout ioctl

2012-04-21 Thread Ben Widawsky
On Sat, 21 Apr 2012 09:12:17 -0700 Ben Widawsky wrote: > On Sat, 21 Apr 2012 10:41:55 +0100 > Chris Wilson wrote: > > > On Fri, 20 Apr 2012 18:23:31 -0700, Ben Widawsky > > wrote: > > > + ret = i915_seqno_wait_timed(ring, seqno, true, &timeout); > > > + if (ret == -ERESTARTSYS) > > > +

Re: [Intel-gfx] [PATCH 09/10] drm/i915: wait render timeout ioctl

2012-04-21 Thread Ben Widawsky
On Sat, 21 Apr 2012 10:41:55 +0100 Chris Wilson wrote: > On Fri, 20 Apr 2012 18:23:31 -0700, Ben Widawsky > wrote: > > + ret = i915_seqno_wait_timed(ring, seqno, true, &timeout); > > + if (ret == -ERESTARTSYS) > > + ret = -EINTR; > Don't convert it here, pass ERESTARTSYS to the sys

Re: [Intel-gfx] [PATCH 09/10] drm/i915: wait render timeout ioctl

2012-04-21 Thread Chris Wilson
On Fri, 20 Apr 2012 18:23:31 -0700, Ben Widawsky wrote: > + ret = i915_seqno_wait_timed(ring, seqno, true, &timeout); > + if (ret == -ERESTARTSYS) > + ret = -EINTR; Don't convert it here, pass ERESTARTSYS to the system call handler which decides how to handle it. > + else

[Intel-gfx] [PATCH 09/10] drm/i915: wait render timeout ioctl

2012-04-20 Thread Ben Widawsky
Finally we can use the new timed seqno waiting function to allow userspace to wait on a request with a timeout. This implements that interface. The new ioctl is very straight forward, there is a flags field which I envision may be useful for various flush permutations of the command. Signed-off-b