From mboxrd@z Thu Jan 1 00:00:00 1970 From: Ben Widawsky Subject: Re: [PATCH 3/4 v7] drm/i915: wait render timeout ioctl Date: Thu, 24 May 2012 20:18:04 -0700 Message-ID: <20120524201804.09bba7b8@bwidawsk.net> References: <1337896991-4795-1-git-send-email-ben@bwidawsk.net> <1337896991-4795-3-git-send-email-ben@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 071419E7E2 for ; Thu, 24 May 2012 20:20:22 -0700 (PDT) In-Reply-To: <1337896991-4795-3-git-send-email-ben@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 Thu, 24 May 2012 15:03:10 -0700 Ben Widawsky wrote: > This helps implement GL_ARB_sync but stops short of allowing full blown > sync objects. Finally we can use the new timed seqno waiting function > to allow userspace to wait on a buffer object with a timeout. This > implements that interface. > > The IOCTL will take as input a buffer object handle, and a timeout in > nanoseconds (flags is currently optional but will likely be used for > permutations of flush operations). Users may specify 0 nanoseconds to > instantly check. > > The wait ioctl with a timeout of 0 reimplements the busy ioctl. With any > non-zero timeout parameter the wait ioctl will wait for the given number > of nanoseconds on an object becoming unbusy. Since the wait itself does > so holding struct_mutex the object may become re-busied before this > completes. A similar but shorter race condition exists in the busy > ioctl. > > v2: ETIME/ERESTARTSYS instead of changing to EBUSY, and EGAIN (Chris) > Flush the object from the gpu write domain (Chris + Daniel) > Fix leaked refcount in good case (Chris) > Naturally align ioctl struct (Chris) > > v3: Drop lock after getting seqno to avoid ugly dance (Chris) > > v4: check for 0 timeout after olr check to allow polling (Chris) > > v5: Updated the comment. (Chris) > > v6: Return -ETIME instead of -EBUSY when timeout_ns is 0 (Daniel) > Fix the commit message comment to be less ugly (Ben) > Add a warning to check the return timespec (Ben) > > v7: Use DRM_AUTH for the ioctl. (Eugeni) Please take v6 if you don't want the DRM_AUTH change. Thanks. Ben