Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp6896411ybx; Mon, 11 Nov 2019 17:00:23 -0800 (PST) X-Google-Smtp-Source: APXvYqzS0BbCrQz/n8rfTI8u66Gc01N9jLPDaObNcnhKzsEMydMt31sz8ee8rccAbDfe7oZxNFlA X-Received: by 2002:a17:906:3053:: with SMTP id d19mr26123201ejd.109.1573520423427; Mon, 11 Nov 2019 17:00:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573520423; cv=none; d=google.com; s=arc-20160816; b=FjItl/lWL4hApzVo3OyBnvUJYb/F+ceOkHll0t6YQFwoaJSO3kpxYjHEwnbBhjdsxn zDccycIkFzt/WpCr1YLmmHuJy5KjNhGh8dtLascDEROIHq0lWxpr/wJmdDS6dK6JER37 Y+5vCaS2q6obysuMFyRXXXWyotOxDBPHIxPreEd6G5ZBAzMvxynM5GuogT3UQPscdf/d pUzYZNIfuhuzrBchgTatthTBiB2TPX1/2mwHauRmGA6MppMjOpliF099LA7GJmYlAv5D PM/lB3/g3vOC3HjCy2/3/MUftWd86+abDxknvZiT7UhHJQA6wZ6DGOKrJ0ALZjGxtvK0 Bf6A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=G+W/WgXFQW+lt7IfFRrFaHlfa6KYsGjbDHKvVT4OS68=; b=AwaeNKfW29nD4y99fF00VbpxlbgwQ3po8nsnOi2WDq5vmyEMMJleiSKBt8aaZH+B8X e8zHYI5pZGwH23dZWiWS9THIaVidm4EvNcrgdprSxy0L4W2QjTAmbuSzlXZb0X2KINGt 0/Zbp3gkqS6C3i8xlNl/nl59gN3DNjV/E9N9Oji1UjilESNWkJ47FsTma+X13jNNB3rb UO9gL4WjyDyKDbFe5omtOMvm/kPntCgEri1f5d3MP4VbiAIe6cJ7VagVKmidmxlnfHLT hL6Y5Bb1rQPM+L1GWZhcblVb9Lpus45/oquS0A341ig1DW1XjLucoZR2X6koKyPcYQrl EzHQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@android.com header.s=20161025 header.b="g5FCw/Ir"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=android.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w1si12682410eda.433.2019.11.11.16.59.58; Mon, 11 Nov 2019 17:00: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=@android.com header.s=20161025 header.b="g5FCw/Ir"; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=android.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727226AbfKLA4M (ORCPT + 99 others); Mon, 11 Nov 2019 19:56:12 -0500 Received: from mail-pg1-f193.google.com ([209.85.215.193]:45721 "EHLO mail-pg1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726906AbfKLA4M (ORCPT ); Mon, 11 Nov 2019 19:56:12 -0500 Received: by mail-pg1-f193.google.com with SMTP id w11so10611769pga.12 for ; Mon, 11 Nov 2019 16:56:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=android.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=G+W/WgXFQW+lt7IfFRrFaHlfa6KYsGjbDHKvVT4OS68=; b=g5FCw/IrcyCS1t94m4uHwMuV4Q3V5h7wkcZG9mdWN/i4/r74kHXoFxRopB1hP4HYNT Rhoi+JpodhCjU4z0t5yxD8TCE0oGNH9l3mtzZgtTyqlmi/2Ljg9eR8fZ6areT3FHNMlr r03QRqPz9c4fvkCM9ISoeNY5EZ01cyxNKr2mLZhYt3uuA1yD6sgpRN5CWro+j6gfUxEO KkUygH0E0yiK9/Uyfx76DxUJQCVplN5l8caDT5g5QzoqGNU3jzDytjWqGut9jEKw8bK5 aYkIhntlaimGrJkGOKh0k6ZKz10+Cq9LjdKyiZs96ik3WI6w++0q+vnhKfAV7KPAhTTk y6Jg== 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:references :mime-version:content-disposition:in-reply-to:user-agent; bh=G+W/WgXFQW+lt7IfFRrFaHlfa6KYsGjbDHKvVT4OS68=; b=CKPHxh1eK0MmaRQNouZ+wS5NmiS8TGMlHObM8Tqmrq0Rn0nu2XfaHewpuCkXTfU01s CnvkanWi3pjU1B+uhnx4p2tIoQY8YeOS7VX1zxjWCpGp5Pv+DyzVjquAdLI3LHTBtWOO JkbS8r4TmtYI2t3pUBCkcEwLOhdR068IMFnw316m/JYzHvXTv5tSK3umJyWiQC/ta0nI WZoslFJLzyy4AJqQJPDQE0Yu9tOVxvfwfUfDLM1HyoBRDA7DoQtbf83extY/HGBWyg7g AoyWYXXxlmzyfslOzajTfZzHSSQbhoObaQ61tF0iNfDhccYe0W5Rs+rGwLPhAE/oOOHD M7PQ== X-Gm-Message-State: APjAAAWVi5aq2InKS2NB+rk8YT3VZgfoqu1fbRyMK3+T+iNGPt1k7kHh uT55JF88TLjjomIZu3IhhWi3Fw== X-Received: by 2002:a63:950c:: with SMTP id p12mr33368602pgd.238.1573520170966; Mon, 11 Nov 2019 16:56:10 -0800 (PST) Received: from localhost ([2401:fa00:d:2:4dd6:fffa:d6aa:9572]) by smtp.gmail.com with ESMTPSA id k103sm627402pje.16.2019.11.11.16.56.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Nov 2019 16:56:10 -0800 (PST) Date: Tue, 12 Nov 2019 09:56:07 +0900 From: Sandeep Patil To: John Stultz Cc: Daniel Vetter , lkml , Mike Rapoport , Chenbo Feng , Alistair Strachan , Liam Mark , Yue Hu , dri-devel , "Andrew F . Davis" , Hridya Valsaraju , Andrew Morton , Pratik Patel Subject: Re: [RFC][PATCH 0/2] Allow DMA BUF heaps to be loaded as modules Message-ID: <20191112005607.GB17144@google.com> References: <20191025234834.28214-1-john.stultz@linaro.org> <20191104095823.GD10326@phenom.ffwll.local> <20191105094259.GX10326@phenom.ffwll.local> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 05, 2019 at 11:47:53AM -0800, 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. > > > > > > 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. Parity with ION will definitely be nice. For now, however, even if we achieve that parity with UAPI and think about the cma-heap-as-module bit later, I guess that's ok. The real problem is the need for these heaps to be a module in the first place. I'd much rather have an upstream user to show the need for cache maintenance operations that have been talked about so many times, so we can make them happen for dma-buf-heaps in upstream. None of this has to be a module if that happens :(. The reason for the "modularization" for ion heaps is also the CMOs for Android use cases. Unfortunately we haven't had any luck with proving the need for. John, CMIIW. - ssp