Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1222616ybx; Tue, 5 Nov 2019 12:24:23 -0800 (PST) X-Google-Smtp-Source: APXvYqxamsbRSvi1xHXKNYdCeJ/lpb7rteW3VwR6Yd0cHrQFxviQQvND/lazqIlwdYCEiwZONKI3 X-Received: by 2002:a17:906:6813:: with SMTP id k19mr4783110ejr.34.1572985463529; Tue, 05 Nov 2019 12:24:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1572985463; cv=none; d=google.com; s=arc-20160816; b=jYeqLnm8xUDrT7BBlxqal/juyqUaeWm//Vgc6+8CLWPRT0r016+VxfKmB0zL4esXF3 TxVgaCmXN0FnMzC/IXu/0Tj+/lgNFqwBw41vugEHr5QfrfB4g6MuUvle98mcpMncXW9s EovXL6q4BO+eXqD36mgCoA8d11wVjAqoB3pfAWJ1N+zxfPwlzHu5rKVXKEZLr4b4tpyX /rE7KfQwOfspcTpQCVmBvdaASP/mS4bpk0VEJKLRWeDPksm7M0LwghGS8IXYWgssTaFj E8E6pz1Ur81tkeqsLLr6Izgnxf5zcMT8KwPlxQC1GJ2InujmDOAAyrRurkGYZZJUAVMS /upQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=kJ/QmiONw/J1ide8QmCrFO9LpvSdfgpzRIFng2Jw4qI=; b=jQsPbadoetknLMiiD7l03tW6XN+D1yoCCzuX9nVHDd4w9MzKh6LR4DQhX8QgV8qfQo qPexsCaDmnvm7vKjM5x5fSgPaJhCvTBdg54IVpZmqwQV0MISrulJUpaGiH8tQBx8bLiV kEK9JIFd0y34dXdIsnqtx3wR/x51iSHrII951EHHUIUAzeLLV/jSOOVJHTk7dbu61tbA PHI8KPr/B8ySyE2TLO6MrN0N5pRjr8QktGKRGA1qYqtyPUUbpM4DxMBi29X+LtCQi5i7 XjIs46bv6ch/gdHFqODZP3DO2h6OfuGsr7X339a6oEJD1py06lJmh9s+Y3WeLKZwvKhT 0tSg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=DB9RWO4d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n1si13014203eda.359.2019.11.05.12.23.59; Tue, 05 Nov 2019 12:24:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ffwll.ch header.s=google header.b=DB9RWO4d; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729698AbfKEUWB (ORCPT + 99 others); Tue, 5 Nov 2019 15:22:01 -0500 Received: from mail-oi1-f194.google.com ([209.85.167.194]:45364 "EHLO mail-oi1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725806AbfKEUWA (ORCPT ); Tue, 5 Nov 2019 15:22:00 -0500 Received: by mail-oi1-f194.google.com with SMTP id k2so18762100oij.12 for ; Tue, 05 Nov 2019 12:22:00 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ffwll.ch; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=kJ/QmiONw/J1ide8QmCrFO9LpvSdfgpzRIFng2Jw4qI=; b=DB9RWO4dZYZTGfAckFGl8vDSfPDdaQ/QjEk/hU671olt9Y3FXIlMxBJuMHNhSEx+1y +ZUlhvLB7QpgLPV/AFtZT4PiVrgnDMKWO9nCWljG9Nsi/ZNexqMf1WdMhvzJEZ4S+4HH 2P+bUsoBcu22z3J9i7SqxWpBh2o1czjevA1/8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=kJ/QmiONw/J1ide8QmCrFO9LpvSdfgpzRIFng2Jw4qI=; b=iOafq8Se6UBKucYkZsDTJr43eGqq1JKoc9IO1PiWtZYoxb02mYS2WlsvtW7uZa5y2W V7r1Y2J7Y0MvVQeZepeQXuRF5i4JG9/VR8W38PF3rJBwtPtu0yngudKxa5mRjgdYoSH9 AeuhG+mt+uSYEVGqG60nLjQkjhsev/Ah/KTcX/8psOwxK7R5SQBDiWSgfdC5NsGxaclY wnVK1OaSZ2t44x0R7Y7NCVD5RekRJAWFFSascEQpcxFO/0fu3hc2oojN9KWQrHtG+Qch pdBhiPN2Fd0XNuLfto7NeOW7Gyy/vE6wTWqUrx6BFCNuk1K+x4+Nxmq6NM59lmCoVvIZ mu7Q== X-Gm-Message-State: APjAAAWDP805WPFnBTdNldqdBrJ027lPuEkLtKyEn5E1r3sANkmsC/Dv E7pEv2SXKMyM6IUAiIRhr6SDHsxlJhT2US5E1i2+OA== X-Received: by 2002:a05:6808:4cf:: with SMTP id a15mr727042oie.132.1572985319540; Tue, 05 Nov 2019 12:21:59 -0800 (PST) MIME-Version: 1.0 References: <20191025234834.28214-1-john.stultz@linaro.org> <20191104095823.GD10326@phenom.ffwll.local> <20191105094259.GX10326@phenom.ffwll.local> In-Reply-To: From: Daniel Vetter Date: Tue, 5 Nov 2019 21:21:48 +0100 Message-ID: Subject: Re: [RFC][PATCH 0/2] Allow DMA BUF heaps to be loaded as modules To: John Stultz Cc: lkml , Sandeep Patil , Mike Rapoport , Chenbo Feng , Alistair Strachan , Liam Mark , Yue Hu , dri-devel , "Andrew F . Davis" , Hridya Valsaraju , Andrew Morton , Pratik Patel Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 5, 2019 at 8:48 PM John Stultz wrote: > > On Tue, Nov 5, 2019 at 11:19 AM Daniel Vetter wrote: > > On Tue, Nov 5, 2019 at 6:41 PM John Stultz wrote: > > > On Tue, Nov 5, 2019 at 1:43 AM Daniel Vetter wrote: > > > > > > > > On Mon, Nov 04, 2019 at 10:57:44AM -0800, John Stultz wrote: > > > > > On Mon, Nov 4, 2019 at 1:58 AM Daniel Vetter wrote: > > > > > > On Fri, Oct 25, 2019 at 11:48:32PM +0000, John Stultz wrote: > > > > > So even if the heaps are configured via DT (which at the moment there > > > > > is no such binding, so that's not really a valid method yet), there's > > > > > still the question of if the heap is necessary/makes sense on the > > > > > device. And the DT would only control the availability of the heap > > > > > interface, not if the heap driver is loaded or not. > > > > > > > > Hm I thought the cma regions are configured in DT? How does that work if > > > > it's not using DT? > > > > > > So yea, CMA regions are either configured by DT or setup at build time > > > (I think there's a cmdline option to set it up as well). > > > > > > But the CMA regions and the dmabuf cma heap driver are separate > > > things. The latter uses the former. > > > > Huh, I assumed the plan is that whenever there's a cma region, we want > > to instantiate a dma-buf heap for it? Why/when would we not want to do > > that? > > Not quite. Andrew noted that we may not want to expose all CMA regions > via dmabuf heaps, so right now we only expose the default region. I > have follow on patches that I sent out earlier (which requires a > to-be-finalized DT binding) which allows us to specify which other CMA > regions to expose. Why do we not want to expose them all? I figured if there's a cma heap, then a device you have needs it, and if that's the case you might want to allocate for that device from the heap? Maybe link to the discussion? > > > > > On the HiKey/HiKey960 boards, we have to allocate contiguous buffers > > > > > for the display framebuffer. So gralloc uses ION to allocate from the > > > > > CMA heap. However on the db845c, it has no such restrictions, so the > > > > > CMA heap isn't necessary. > > > > > > > > Why do you have a CMA region for the 2nd board if you don't need it? > > > > _That_ sounds like some serious memory waster, not a few lines of code > > > > loaded for nothing :-) > > > > > > ??? That's not what I said above. If the db845c doesn't need CMA it > > > won't have a CMA region. > > > > > > The issue at hand is that we may want to avoid loading the dmabuf CMA > > > heap driver on a board that doesn't use CMA. > > > > So the CMA core code is also a module, or how does that work? Not > > No. CMA core isn't available as a module. > > > loading the cma dma-buf heap, but keeping all the other cma code > > around feels slightly silly. Do we have numbers that justify this > > silliness? > > I agree that is maybe not the most critical item on the list, but its > one of many that do add up over time. > > Again, I'll defer to Sandeep or other folks on the Google side to help > with the importance here. Mostly I'm trying to ensure there is > functional parity to ION so we don't give folks any reason they could > object to deprecating it. > > > > The main reason I'm only submitting system and CMA is because those > > > are the only two I personally have a user for (HiKey/HiKey960 boards). > > > It's my hope that once we deprecate ION in Android, vendors will > > > migrate and we'll be able to push them to upstream their heaps as > > > well. > > > > I think for upstream I'd want to see those other heaps first. If > > they're mostly driver allocators exposed as heaps, then I think we > > need something different than heap modules, maybe allow dma-buf to > > allocate from drivers instead. But afaiui all such driver allocators > > we have in upstream are cma regions only right now. > > I'm sorry, I'm not sure I understand what you mean here (I'm not sure > what action I should be taking). Could you clarify this point? I'm not sold on the use-case for this, but maybe if I see the actual use-cases I might be swayed. A very basic/minimal "register a new dma-buf heap" function should be all that's really needed for android, so maybe we can start with that? -Daniel -- Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch