Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755168AbcC2CTG (ORCPT ); Mon, 28 Mar 2016 22:19:06 -0400 Received: from mailout3.samsung.com ([203.254.224.33]:36527 "EHLO mailout3.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751697AbcC2CTD (ORCPT ); Mon, 28 Mar 2016 22:19:03 -0400 MIME-version: 1.0 Content-type: text/plain; charset=utf-8 X-AuditID: cbfee68e-f79d96d0000012b1-d4-56f9e613f2ef Content-transfer-encoding: 8BIT Message-id: <56F9E613.1030902@samsung.com> Date: Tue, 29 Mar 2016 11:18:59 +0900 From: Inki Dae User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 To: Daniel Stone Cc: Rob Clark , Linux Kernel Mailing List , "dri-devel@lists.freedesktop.org" , =?UTF-8?B?QXJ2ZSBIasO4bm5ldsOlZw==?= , Daniel Vetter , Riley Andrews , Gustavo Padovan , John Harrison Subject: Re: [RFC 0/6] drm/fences: add in-fences to DRM References: <1458758847-21170-1-git-send-email-gustavo@padovan.org> <56F3A2DC.8080507@samsung.com> <56F47D01.7040508@samsung.com> <56F88828.5050304@samsung.com> In-reply-to: X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrFIsWRmVeSWpSXmKPExsWyRsSkRFf42c8wg+3TDS3e/73PZrHw4V1m iyut01ktrnx9z2bxaXUru8Wkpw/YLC7vmsNm8XrTX0aL5wt/MDtwemzbvY3V4+/z6ywee78t YPF48XUbs8fOWXfZPRbvecnkcb/7OJPH501yARxRXDYpqTmZZalF+nYJXBkPvneyFiyXqVj7 aTlLA+NnsS5GTg4JAROJRZPPMEHYYhIX7q1n62Lk4hASWMEocX7jeVaYoq8vuqASsxglrl3b zgKS4BUQlPgx+R6QzcHBLCAvceRSNoSpLjFlSi5E+QNGiQOnvjBDlGtJLLrXDraMRUBV4mjn d3YQmw3InrjiPhtIr6hAhET3iUqQsAj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2KUSC1ILihOSs81ykst 1ytOzC0uzUvXS87P3cQITgTPpHcwHt7lfohRgINRiYeXYcHPMCHWxLLiytxDjBIczEoivE5P gUK8KYmVValF+fFFpTmpxYcYTYH+m8gsJZqcD0xSeSXxhsYmZkaWRuaGFkbG5krivI//rwsT EkhPLEnNTk0tSC2C6WPi4JRqYJyTtP+eWeTF7Z/Wh26cPu/876KZEavnH9OvSDpmHzj/hua5 T/JurN8jayfULgmcEmGesqd2sY10ZETSwdNL/VYeWmOsvbvgZM1X37Msy/SyqrZ0G/BeWXSp 9JT3Wq4WjXVB8/llLjxImG+q6F57T86ZZYHUrsMWGhNcl+2/OP9s3tVfKcy7VJuUWIozEg21 mIuKEwFJlzv1GgMAAA== DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3557 Lines: 66 Hi Daniel, 2016년 03월 28일 22:26에 Daniel Stone 이(가) 쓴 글: > Hi Inki, > > On 28 March 2016 at 02:26, Inki Dae wrote: >> 2016년 03월 25일 21:10에 Daniel Stone 이(가) 쓴 글: >>> Second, really. Vulkan avoids implicit sync entirely, and exposes >>> fence-like primitives throughout its whole API. These include being >>> able to pass prerequisite fences for display (what Gustavo is adding >>> here: something to block on before display), and also when the user >>> acquires a buffer as a render target, it is given another prerequisite >>> fence (the other side of what Gustavo is suggesting, i.e. the fence >>> triggers when the buffer is no longer displayed and becomes available >>> for rendering). >>> >>> In order to implement this correctly, and avoid performance bubbles, >>> we need a primitive like this exposed through the KMS API, from both >>> sides. This is especially important when you take the case of >>> userspace suballocation, where userspace allocates larger blocks and >>> divides the allocation internally for different uses. Implicit sync >>> does not work at all for that case. >> >> Can you give me more details why implicit sync cannot take care of the case of userspace suballocation? > > Implicit sync does not know about suballocation, so implicit will > operate for every range in the buffer, not just the one you want. > > Say you have one kernel buffer, which userspace subdivides into four > independent buffers. It can perform operations on these buffers which > are completely independent of each other, and an explicit sync model > allows this independence to be kept. Implicit sync ties them together, > so that you cannot do any operations on buffer 1 until all operations > on buffer 2 have completed. > >> And is there any reason that fence fd shouldn't dependent of DMABUF - now fence fd is a new file, not DMABUF fd? > > Because dmabuf is for buffer sharing, and fences aren't buffers (they > will never export page ranges). Is there any particular benefit you > think you would get from doing this? Just for consistency. As you know, implicit sync hangs DMA fence up on dmabuf object through reservation object so dmabuf independent explicit sync looked strange to me. As you mentioned above, the suballocation would be why explicit sync should be indepenent of DMABUF. 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? Thanks, Inki Dae > >>> good thing. This is also the model that ChromeOS is moving towards, so >>> it becomes more important from that point of view as well. >> >> I think Gustavo should had explaned this path series enough to other people when posting them - ie, what relationship explict and implicit fences have, and why implicit fence - which is independent of DMABUF - is required, and what use cases there are in real users, and etc. > > Fair enough, the summary could perhaps contain something like this. > > Cheers, > Daniel > >