Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp1438544pxb; Fri, 13 Nov 2020 12:41:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJzNjQVS4oyEsnSKEVqWY8npdoDGtegXFX/vaPouVM/CGH0k3CXRoxcfYtLtQrkGslTq0Tf4 X-Received: by 2002:a17:906:60c8:: with SMTP id f8mr3946834ejk.14.1605300105365; Fri, 13 Nov 2020 12:41:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1605300105; cv=none; d=google.com; s=arc-20160816; b=yStL5p4Ozk6Uaa3r3lKJf4nfmttsDNVGvs5J0lIZJLnBzNDklsPCGyZh0crE3uy82k 0DJ2obSHsL/hKaJx3rhSVlP6XkBuAldNUaU2zr1sWyUgNegEouZb0vui/N2Fs5zelsIg 1UtwX3Sx/hF8hLYATQTT0FileY16kFJ+MF+d4CXiwuxHX2rhsBbGrADrA5cbznW5uNEO onWomb8WTZV5iSwfpsQva6Z1wRJntCp2GrNvVyMmev33x94Ea6+O8BI2yJ+mGnkgkPGe EnA5djIHVeXv2BnGPsPoDixUTwsMHzzZcl3F4fBVV9xdypciZs8AEip1hU31hNg7/ufe PAxA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:mail-followup-to:message-id:subject:cc:to:from:date :dkim-signature; bh=XWKyPPQcb/AO4HvcVyMm86Eaa/Twuh8I1tqipU5mjZM=; b=pdBq6MfMITOEJdChgPBZjF+qCHJx+Xl5poAUACzI/2L+WTmlE/yrmxLv91giRzA3oo HDOkEUAtN2N/UHxS8hOaEC9Tkpv07D42yqtWMye/ckEhJfd3Gei/dKe3bW3juxLBVyWc lujzCW+8yli4cK+Im2IN38rSu/QLQTId3sY8bQwbzcGB+tdJJ10x0CYnU5beTbsa7gF8 au8BCRheBJH14+GE9i3OeuN3iGvD+krVbMuDw7xUF31uaygvVOEqereVMwBqwxwf3UDH andmr+9pjPJHO6n+ZpZx2lbTqHbWS0u5drbM2jLLJKfGx5Urgj481+pi+FTKXmuULPCu A2rw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=GN9r9oFn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id t6si6754979ejo.473.2020.11.13.12.41.22; Fri, 13 Nov 2020 12:41:45 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=GN9r9oFn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726295AbgKMUjj (ORCPT + 99 others); Fri, 13 Nov 2020 15:39:39 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725866AbgKMUjj (ORCPT ); Fri, 13 Nov 2020 15:39:39 -0500 Received: from mail-wm1-x343.google.com (mail-wm1-x343.google.com [IPv6:2a00:1450:4864:20::343]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9EF76C0613D1 for ; Fri, 13 Nov 2020 12:39:38 -0800 (PST) Received: by mail-wm1-x343.google.com with SMTP id h2so10710456wmm.0 for ; Fri, 13 Nov 2020 12:39:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=date:from:to:cc:subject:message-id:mail-followup-to:references :mime-version:content-disposition:in-reply-to; bh=XWKyPPQcb/AO4HvcVyMm86Eaa/Twuh8I1tqipU5mjZM=; b=GN9r9oFngY/SvOuMbZNIzlQ63VYdQzlMSPwL1+bmiJVB7UgUh1Udsp2b7O3eVtHF0+ 9yObcXMc//LCwL8wimKzjNlEO9uqIAOHPTzKJYrqR/dnoRWBEfmm8YGGTc/R3N54ZYGS udDoW9ANgKUsGryqCfbVOynoWh8BTKMSE9ieI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id :mail-followup-to:references:mime-version:content-disposition :in-reply-to; bh=XWKyPPQcb/AO4HvcVyMm86Eaa/Twuh8I1tqipU5mjZM=; b=pzD9BuDEfZsQHBoPV3U2uFEQEpjRh/v7f1TiDbaqEAPrK+YVQ8OvNWwyV8TwpdnFGE uKey8xhA9qFiskdMww4X7/qkm54AuDm371VozAcjdZTDGd/5DB5/fgo87y+TqOhA2QUj FiFYtH61twp6r7cE1IpSFGNlyJzQaOzCn9RMfQHSsQII18Tkeez2cFxllSDLc9NjaPUe dwL19ioRXHnO0Apt0Vntru3hIigFzfylRySXDctGboAQuZThVIX6z9rFQGKWFz2zHSo9 /tMtaVWxBxXGlKhMPxRSZtwOcOjEo4qEoSjoR5P1fd78Fskf/ZyRInEC0hp8ZZzcHdGx wEqw== X-Gm-Message-State: AOAM533pRm4q+3Ott6eLGtL47GdNnJSLC9Eh0U5D2UxTAINFd3IPJbhL 5QpBZj2MevfJ/GACc2PCMJi9cQ== X-Received: by 2002:a1c:dc0a:: with SMTP id t10mr4422946wmg.5.1605299977359; Fri, 13 Nov 2020 12:39:37 -0800 (PST) Received: from phenom.ffwll.local ([2a02:168:57f4:0:efd0:b9e5:5ae6:c2fa]) by smtp.gmail.com with ESMTPSA id y200sm13494151wmc.23.2020.11.13.12.39.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 13 Nov 2020 12:39:35 -0800 (PST) Date: Fri, 13 Nov 2020 21:39:33 +0100 From: Daniel Vetter To: John Stultz Cc: Sumit Semwal , Christian Koenig , lkml , Liam Mark , Laura Abbott , Brian Starkey , Hridya Valsaraju , Suren Baghdasaryan , Sandeep Patil , Daniel Mentz , Chris Goldsworthy , =?iso-8859-1?Q?=D8rjan?= Eide , Robin Murphy , Ezequiel Garcia , Simon Ser , James Jones , "open list:DMA BUFFER SHARING FRAMEWORK" , DRI mailing list , Daniel Vetter Subject: Re: [PATCH v5 0/7] dma-buf: Performance improvements for system heap & a system-uncached implementation Message-ID: <20201113203933.GT401619@phenom.ffwll.local> Mail-Followup-To: John Stultz , Sumit Semwal , Christian Koenig , lkml , Liam Mark , Laura Abbott , Brian Starkey , Hridya Valsaraju , Suren Baghdasaryan , Sandeep Patil , Daniel Mentz , Chris Goldsworthy , =?iso-8859-1?Q?=D8rjan?= Eide , Robin Murphy , Ezequiel Garcia , Simon Ser , James Jones , "open list:DMA BUFFER SHARING FRAMEWORK" , DRI mailing list References: <20201110034934.70898-1-john.stultz@linaro.org> <20201112093237.GS401619@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Operating-System: Linux phenom 5.7.0-1-amd64 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Nov 12, 2020 at 08:11:02PM -0800, John Stultz wrote: > On Thu, Nov 12, 2020 at 1:32 AM Daniel Vetter wrote: > > On Thu, Nov 12, 2020 at 11:09:04AM +0530, Sumit Semwal wrote: > > > On Tue, 10 Nov 2020 at 09:19, John Stultz wrote: > > > > > > > > Hey All, > > > > So just wanted to send my last revision of my patch series > > > > of performance optimizations to the dma-buf system heap. > > > > > > Thanks very much for your patches - I think the first 5 patches look good to me. > > > > > > I know there was a bit of discussion over adding a new system-uncached > > > heap v/s using a flag to identify that; I think I prefer the separate > > > heap idea, but lets ask one last time if any one else has any real > > > objections to it. > > > > > > Daniel, Christian: any comments from your side on this? > > > > I do wonder a bit where the userspace stack for this all is, since tuning > > allocators without a full stack is fairly pointless. dma-buf heaps is a > > bit in a limbo situation here it feels like. > > As mentioned in the system-uncached patch: > Pending opensource users of this code include: > * AOSP HiKey960 gralloc: > - https://android-review.googlesource.com/c/device/linaro/hikey/+/1399519 > - Visibly improves performance over the system heap > * AOSP Codec2 (possibly, needs more review): > - https://android-review.googlesource.com/c/platform/frameworks/av/+/1360640/17/media/codec2/vndk/C2DmaBufAllocator.cpp#325 > > Additionally both the HiKey, HiKey960 grallocs and Codec2 are already > able to use the current dmabuf heaps instead of ION. > > So I'm not sure what you mean by limbo, other than it being in a > transition state where the interface is upstream and we're working on > moving vendors to it from ION (which is staged to be dropped in 5.11). > Part of that work is making sure we don't regress the performance > expectations. The mesa thing below, since if we test this with some downstream kernel drivers or at least non-mesa userspace I'm somewhat worried we're just creating a nice split world between the android gfx world and the mesa/linux desktop gfx world. But then that's kinda how android rolls, so *shrug* > > Plus I'm vary of anything related to leaking this kind of stuff beyond the > > dma-api because dma api maintainers don't like us doing that. But > > personally no concern on that front really, gpus need this. It's just that > > we do need solid justification I think if we land this. Hence back to > > first point. > > > > Ideally first point comes in the form of benchmarking on android together > > with a mesa driver (or mesa + some v4l driver or whatever it takes to > > actually show the benefits, I have no idea). > > Tying it with mesa is a little tough as the grallocs for mesa devices > usually use gbm (gralloc.gbm or gralloc.minigbm). Swapping the > allocation path for dmabuf heaps there gets a little complex as last I > tried that (when trying to get HiKey working with Lima graphics, as > gbm wouldn't allocate the contiguous buffers required by the display), > I ran into issues with the drm_hwcomposer and mesa expecting the gbm > private handle metadata in the buffer when it was passed in. > > But I might take a look at it again. I got a bit lost digging through > the mesa gbm allocation paths last time. > > I'll also try to see if I can find a benchmark for the codec2 code > (using dmabuf heaps with and without the uncached heap) on on db845c > (w/ mesa), as that is already working and I suspect that might be > close to what you're looking for. tbh I think trying to push for this long term is the best we can hope for. Media is also a lot more *meh* since it's deeply fragmented and a lot less of it upstream than on the gles/display side. I think confirming that this at least doesn't horrible blow up on a gralloc/gbm+mesa stack would be useful I think. -Daniel -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch