Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756498AbcC2NYE (ORCPT ); Tue, 29 Mar 2016 09:24:04 -0400 Received: from mail-yw0-f182.google.com ([209.85.161.182]:36464 "EHLO mail-yw0-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751427AbcC2NX7 (ORCPT ); Tue, 29 Mar 2016 09:23:59 -0400 MIME-Version: 1.0 In-Reply-To: <56F9E613.1030902@samsung.com> References: <1458758847-21170-1-git-send-email-gustavo@padovan.org> <56F3A2DC.8080507@samsung.com> <56F47D01.7040508@samsung.com> <56F88828.5050304@samsung.com> <56F9E613.1030902@samsung.com> Date: Tue, 29 Mar 2016 09:23:53 -0400 Message-ID: Subject: Re: [RFC 0/6] drm/fences: add in-fences to DRM From: Rob Clark To: Inki Dae Cc: Daniel Stone , Linux Kernel Mailing List , "dri-devel@lists.freedesktop.org" , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Daniel Vetter , Riley Andrews , Gustavo Padovan , John Harrison Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2007 Lines: 34 On Mon, Mar 28, 2016 at 10:18 PM, Inki Dae wrote: > > In addition, I wonder how explicit and implicit fences could coexist together. > Rob said, > "Implicit sync ofc remains the default, but userspace could opt-in to explicit sync instead" > > This would mean that if we use explicit sync for user-space then it coexists with implicit sync. However, these two sync fences can't see same DMA buffer because explicit fence has a different file object from implicit one. > So in this case, I think explicit fence would need to be hung up on the reservation object of dmabuf object somehow. Otherwise, although they coexist together, are these fences - explicit and implicit - used for differenct purpose separately? > I'm not entirely sure about coexistance at the same time. It ofc shouldn't be a problem for one kernel to support both kinds of userspace (pure explicit and pure implicit). And how this would work on kms atomic ioctl (compositor/consumer) side seems clear enough.. ie. some sort of flag, which if set user provides an explicit fence fd, and if not set we fall back to current behaviour (ie. get fences from resv object). On the gpu/producer side, I think what makes sense is to both attach the fence to the resv objects and (optionally, specified by an submit ioctl flag) return a fence fd. The other option is to add a new ioctl to convert an internal per-ring fence/seqno (that is already returned by submit ioctl) to a fence fd.. but I think that would end up with duplicate 'struct fence' objects on the kernel side (not sure if that would cause issues somehow), and might be unneeded since with EGL_ANDROID_native_fence_sync since we should know before glFlush() is called whether we want an fd or not. But main thing I'm pondering here is how to sanely support the old way of userspace gl driver internal synchronization with new userspace on old kernel, but also conditionally support EGL_ANDROID_native_fence_sync if you have a new enough kernel. BR, -R