Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp10916113ybi; Thu, 25 Jul 2019 07:02:57 -0700 (PDT) X-Google-Smtp-Source: APXvYqxWeJX0xpWMDInAklk1WPZtOw3vnSK7/5W+CXkW36ZREH/0qoOAV9oyozfJt2Xx9hDztTRJ X-Received: by 2002:a63:f817:: with SMTP id n23mr87234478pgh.35.1564063377433; Thu, 25 Jul 2019 07:02:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564063377; cv=none; d=google.com; s=arc-20160816; b=th8djNp+yd0Hnua8SHm8h749DVRHn3Ml2QVhTgX+dJiVe4ymMQ82edMozzOUUfkK0J sPewmzl59lI5fa2fTa4bLr4UR3uyEOo7gsGbYYBT8qzcGzDTAi8JB47oWyv1GavQxbQj R1sfTwjD6W2cGQFdevGC1q7HDOJpcxD8SMD40zo4g7CjalIbQDgA5amlOqpzuRVNhZA3 QgVEtkXQl3esoTS31z5Lfzsc+xRwuQIjDyB+8ddIY2fs+Ibaqiz/+durRPv+O8Dd/u53 NP1qJhjd52atUgHA2bNwYyRCpIqYu/Y3J8ptzwaD46O6HUF7Zen/Ar6NC40fJe06K0ky wVkA== 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=d/Ysj7kh7KPJXSRnD+7pXkEpijt1uOPkmGiBPwEU0NY=; b=gECSu0bJ0BI2TeYEESKBHJ+RUCtjZvcXFDtm8kjKO5bgADlyrPKt+WWjOFhm2V9azo nmaR4wgKVI3u1l6BQXE+tOQ19x0zxjYrAN9k703nTT1zcFU2vgQxHeYLRQYpmJj+R1Cy Gwakeu4CGW3qeBmY+kCOEjWiF/qyDONd95xNCFCgKdG+Go/EqqBnl0hEgIBlXNLwQeP7 QCjKrVPEiIxMJRDPZC0w2kDhDE4ChFwT50oouAePq/XLGRY8cOAZ/Nq8BjwuNyTbeAoj X6C8ZLu6EGIzBoPCrwayKVlQdTKfaagca4EuBJzBRv5Q7AMZ1f83MOlreZzrnHB+DgSo X5Zw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HxCqORj8; 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 c35si7991350pgm.51.2019.07.25.07.02.41; Thu, 25 Jul 2019 07:02:57 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=HxCqORj8; 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 S2389422AbfGYMwH (ORCPT + 99 others); Thu, 25 Jul 2019 08:52:07 -0400 Received: from bombadil.infradead.org ([198.137.202.133]:43480 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387586AbfGYMwG (ORCPT ); Thu, 25 Jul 2019 08:52:06 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=d/Ysj7kh7KPJXSRnD+7pXkEpijt1uOPkmGiBPwEU0NY=; b=HxCqORj8GBkaWezV1GQRjNvVZ +BFTh80S74cUb74cD5mbtq97mvtsPXISwyW/qBwnCLNSMIvHoknTZJY7iy69qaYqLqxXFrOGZ0yWP 4nEDrGR+e5C7NVDIE0WDt4s3AcAoxLLQ5LyPar2PwR4zroWRVaWf1Fm3jBQ4xIKaz5Xnwy17yKn8v EfDQSRkw4jU3WtiosYKG0GN15/EvYANWvDyqgAHPn88wuV8iGFAhmRNqD+3aGAYj3Bds6KCk0l0LD mxUCUEEg30Rz5e0VO57VcEBJ/NV/hR1ljwMhgMNoo6lLbBeOog3VhwjMdhV/EktJ/lqctFGNSM7xM hDYm5eeYQ==; Received: from hch by bombadil.infradead.org with local (Exim 4.92 #3 (Red Hat Linux)) id 1hqdE6-0002T5-Ad; Thu, 25 Jul 2019 12:52:06 +0000 Date: Thu, 25 Jul 2019 05:52:06 -0700 From: Christoph Hellwig To: John Stultz Cc: Christoph Hellwig , lkml , Laura Abbott , Benjamin Gaignard , Sumit Semwal , Liam Mark , Pratik Patel , Brian Starkey , Vincent Donnefort , Sudipto Paul , "Andrew F . Davis" , Xu YiPing , "Chenfeng (puck)" , butao , "Xiaqing (A)" , Yudongbin , Chenbo Feng , Alistair Strachan , dri-devel Subject: Re: [PATCH v6 4/5] dma-buf: heaps: Add CMA heap to dmabuf heaps Message-ID: <20190725125206.GE20286@infradead.org> References: <20190624194908.121273-1-john.stultz@linaro.org> <20190624194908.121273-5-john.stultz@linaro.org> <20190718100840.GB19666@infradead.org> <20190724065958.GC16225@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.11.4 (2019-03-13) X-SRS-Rewrite: SMTP reverse-path rewritten from by bombadil.infradead.org. See http://www.infradead.org/rpr.html Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jul 24, 2019 at 11:46:24AM -0700, John Stultz wrote: > I'm still not understanding how this would work. Benjamin and Laura > already commented on this point, but for a simple example, with the > HiKey boards, the DRM driver requires contiguous memory for the > framebuffer, but the GPU can handle non-contiguous. Thus the target > framebuffers that we pass to the display has to be CMA allocated, but > all the other graphics buffers that the GPU will render to and > composite can be system. But that just means we need a flag that memory needs to be contiguous, which totally makes sense at the API level. But CMA is not the only source of contigous memory, so we should not conflate the two. > Laura already touched on this, but similar logic can be used for > camera buffers, which can make sure we allocate from a specifically > reserved CMA region that is only used for the camera so we can always > be sure to have N free buffers immediately to capture with, etc. And for that we already have per-device CMA areas hanging off struct device, which this should reuse instead of adding another duplicate CMA area lookup scheme.