Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp9785067ybi; Wed, 24 Jul 2019 09:55:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqyKuO3OREX4C42vsMRTYEhMT3ulZFmV042AgriTe9gwSvbgitq0cE6uYgNltvah9YtESYsn X-Received: by 2002:a62:6dc2:: with SMTP id i185mr12457839pfc.40.1563987311493; Wed, 24 Jul 2019 09:55:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563987311; cv=none; d=google.com; s=arc-20160816; b=enEi4t1+GfN/sx6xrk6hx0/lTzCWbBsfY0wK9NWv4K+5Lgv7PCnpdbscjBf2Nt4s0h CmCp3STOlo9Kkn88mrF8ujMxwIUC7pjFwC5lu4bpImstfi5t0pZVnDGjOd5qCSRUlweC XqU/Hr8qTrsQGUqq4CAgi+lopuh15oXhyBi0C5RMrim7cg716jNTwn8Z6DT/JhTBJF9b haseYgjwvwmkQWSaxUXNhEDiGkhbJFWxA1DPnf42VY0fc/Zo27Wz+YmFozlQqpnn6JPr NUShFNw3PIcAeRyataVACs+KjEikX8d6UmV9qdw2E32sk9Od3RSs7bfPFOX31Xn2907n 5CPA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=lOtsy9iEeGzWh5ylO4v/a04ehlOrwbMbdn7UL2Ddbrg=; b=GjuvMjUdINSS7KC7TpakNajatTmNqsu2QJKPG8XAAye9vjoiCNsqRsGwSK1RumXLXm HjiAe1Jogxp/sQfGGHrxgPcMQ4ET0ap7D7e0jsYlXz2dmWvJyitlqeRwnXuyqNeRUiRb 3rrgsUL6MvRbCB1bblZXy7JQodKdyt6kNx0el7rM5fDde9Z4Bl2EaKQpQcYJpW0dHyZu lF5WQdzg/H+Md3zc0w4AzIONhzI1EUgDjXsIn3O5dJRDxesax8/b8SEkToaInaqZRIXs CY8jso0x6AHW2v+QHsBNjn5R3p2EgPDcU9W6eap5LaepRcQTtkAiOLVRPRpv7StWpA/M 8BOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=VzLnvQJd; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id v20si15110782pjn.27.2019.07.24.09.54.56; Wed, 24 Jul 2019 09:55:11 -0700 (PDT) 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=@ti.com header.s=ti-com-17Q1 header.b=VzLnvQJd; 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=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728511AbfGXPqj (ORCPT + 99 others); Wed, 24 Jul 2019 11:46:39 -0400 Received: from fllv0016.ext.ti.com ([198.47.19.142]:53094 "EHLO fllv0016.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727680AbfGXPqi (ORCPT ); Wed, 24 Jul 2019 11:46:38 -0400 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by fllv0016.ext.ti.com (8.15.2/8.15.2) with ESMTP id x6OFk3g0070578; Wed, 24 Jul 2019 10:46:03 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1563983163; bh=lOtsy9iEeGzWh5ylO4v/a04ehlOrwbMbdn7UL2Ddbrg=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=VzLnvQJdtFsU8gh8xZW4og7tS+2gLDEUOpGiPoFQzpyWkyjuKjgzj0Vh2fnuO2eeU 91AiiB3Nwjs5rCppmcOgWSZJSm/aGHM+7v5odY7mugVWv05rjXMDQSF+9yVBR4FZOS QNVaFQCsOSQwQaOSYDxuLwyfM8iTvRK1+DHxihl8= Received: from DFLE113.ent.ti.com (dfle113.ent.ti.com [10.64.6.34]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id x6OFk3jV046078 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 24 Jul 2019 10:46:03 -0500 Received: from DFLE108.ent.ti.com (10.64.6.29) by DFLE113.ent.ti.com (10.64.6.34) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5; Wed, 24 Jul 2019 10:46:03 -0500 Received: from lelv0326.itg.ti.com (10.180.67.84) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1713.5 via Frontend Transport; Wed, 24 Jul 2019 10:46:03 -0500 Received: from [10.250.86.29] (ileax41-snat.itg.ti.com [10.172.224.153]) by lelv0326.itg.ti.com (8.15.2/8.15.2) with ESMTP id x6OFk2qF032690; Wed, 24 Jul 2019 10:46:02 -0500 Subject: Re: [PATCH v6 4/5] dma-buf: heaps: Add CMA heap to dmabuf heaps To: Christoph Hellwig , John Stultz CC: lkml , Laura Abbott , Benjamin Gaignard , Sumit Semwal , Liam Mark , Pratik Patel , Brian Starkey , Vincent Donnefort , Sudipto Paul , Xu YiPing , "Chenfeng (puck)" , butao , "Xiaqing (A)" , Yudongbin , Chenbo Feng , Alistair Strachan , dri-devel References: <20190624194908.121273-1-john.stultz@linaro.org> <20190624194908.121273-5-john.stultz@linaro.org> <20190718100840.GB19666@infradead.org> <20190724065958.GC16225@infradead.org> From: "Andrew F. Davis" Message-ID: <8e6f8e4f-20fc-1f1f-2228-f4fd7c7c5c1f@ti.com> Date: Wed, 24 Jul 2019 11:46:01 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.8.0 MIME-Version: 1.0 In-Reply-To: <20190724065958.GC16225@infradead.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 7/24/19 2:59 AM, Christoph Hellwig wrote: > On Mon, Jul 22, 2019 at 10:04:06PM -0700, John Stultz wrote: >> Apologies, I'm not sure I'm understanding your suggestion here. >> dma_alloc_contiguous() does have some interesting optimizations >> (avoiding allocating single page from cma), though its focus on >> default area vs specific device area doesn't quite match up the usage >> model for dma heaps. Instead of allocating memory for a single >> device, we want to be able to allow userland, for a given usage mode, >> to be able to allocate a dmabuf from a specific heap of memory which >> will satisfy the usage mode for that buffer pipeline (across multiple >> devices). >> >> Now, indeed, the system and cma heaps in this patchset are a bit >> simple/trivial (though useful with my devices that require contiguous >> buffers for the display driver), but more complex ION heaps have >> traditionally stayed out of tree in vendor code, in many cases making >> incompatible tweaks to the ION core dmabuf exporter logic. > > So what would the more complicated heaps be? > https://patchwork.kernel.org/patch/10863957/ It's actually a more simple heap type IMHO, but the logic inside is incompatible with the system/CMA heaps, if you move any of their code into the core framework then this heap stops working. Leading to out of tree hacks on the core to get it back functional. I see the same for the "complex" heaps with ION. Andrew >> That's why >> dmabuf heaps is trying to destage ION in a way that allows heaps to >> implement their exporter logic themselves, so we can start pulling >> those more complicated heaps out of their vendor hidey-holes and get >> some proper upstream review. >> >> But I suspect I just am confused as to what your suggesting. Maybe >> could you expand a bit? Apologies for being a bit dense. > > My suggestion is to merge the system and CMA heaps. CMA (at least > the system-wide CMA area) is really just an optimization to get > large contigous regions more easily. We should make use of it as > transparent as possible, just like we do in the DMA code. >