From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH 11/12 v2] drm/i915: wait render timeout ioctl Date: Sat, 28 Apr 2012 19:33:26 -0700 Message-ID: <20120428193326.088c287d@bwidawsk.net> References: <1335481389-7232-1-git-send-email-ben@bwidawsk.net> <1335481389-7232-12-git-send-email-ben@bwidawsk.net> <1335540301_69364@CP5-2952> <20120428191134.6c501d1c@bwidawsk.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from cloud01.chad-versace.us (184-106-247-128.static.cloud-ips.com [184.106.247.128]) by gabe.freedesktop.org (Postfix) with ESMTP id 332969E753 for ; Sat, 28 Apr 2012 19:35:11 -0700 (PDT) In-Reply-To: <20120428191134.6c501d1c@bwidawsk.net> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org Errors-To: intel-gfx-bounces+gcfxdi-intel-gfx=m.gmane.org@lists.freedesktop.org To: Ben Widawsky Cc: intel-gfx@lists.freedesktop.org List-Id: intel-gfx@lists.freedesktop.org On Sat, 28 Apr 2012 19:11:34 -0700 Ben Widawsky wrote: > On Fri, 27 Apr 2012 16:24:24 +0100 > Chris Wilson wrote: > > > On Thu, 26 Apr 2012 16:03:08 -0700, Ben Widawsky > > wrote: > > > This helps implement glClientWaitSync. > > > > > > 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. > > > > What are the semantics of the ioctl? A simple use case would help > > specify the interface here. > > The first time I sent out the series, I included the libdrm and igt > test. Is this what you're looking for, or something in the commit > message? > > > > > In particular, I can't tell whether the return value (timeout_ns) is > > meant to be the time elapsed or the time remaining. What value is > > returned in the timeout if we are interrupted before the wait > > completes? Would > > end = gettimeofday() + timeout; > > do { > > ret = i915_gem_wait(handle, 0, &timeout); > > } while (ret == -1 && errno == EINTR); > > assert(gettimeofday() <= end); > > wait forever, or until the original timeout expires? > > -Chris > > > > The return value should give the remaining time left if the return > value was not 0, though I venture to guess you're Socratically trying > to tell me something, so I'll go through this again and find the bug. Ah, I think I see the problem...