From patchwork Thu Feb 21 07:40:26 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Stultz X-Patchwork-Id: 158870 Delivered-To: patches@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp183415jaa; Wed, 20 Feb 2019 23:40:34 -0800 (PST) X-Received: by 2002:a63:4f61:: with SMTP id p33mr19963357pgl.303.1550734834666; Wed, 20 Feb 2019 23:40:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550734834; cv=none; d=google.com; s=arc-20160816; b=gxWQkE1mjl4+7a+O6FkG5P9s/3bPFBotVMa72IATp3DxA2xgYx4RTskquJtbloNyxc LTn5Jqh1S5U6Yfr487L9nP0EVeOMYjY96h07jS1sxhQhRiBBnUfePoO7nS0fCtJP/YnO WE6o+w8EZtZTd3v1iEagRj8nKJS+vQ/DNWwXdLddjW815d4O3b8FSzLEz/wH4hFCWa7l 0qrC43V6Uh6p8JWibG12glfWDFODHSAVHMuBP5J3b4XuxiksUEUJR9nlWHjNY/9l9oLa PcoI4MdsaIngPL8483ht/XdxKUcFZh1AOHg0/Ubf2jHiyWqoq8TW1vy6V+sNq+Txsq9w U7EQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=message-id:date:subject:cc:to:from:dkim-signature; bh=GWXTOmb3JzNVqDH2hs+GvMP8Fyrmw5Y58p0QdPLnm6A=; b=dABwTSzJSbOk8do2iTx4ouA1yWkSdGRRWZaoRvph+luTMlCdkDI8SKnpXaO1r0VL0B EzQ74mEDPsCf/dlazxecscmcrSNn1fuMtlIaFpDWY1SYKpKuyKWs72EAc7BwwwRt3pDd yqxeHI54hHkO+7vWEj+qzP7sqRMHFY+Fk+E+OMC+V2FLP79bWByLi1sf3/28MoSydTQe H17IcA2jQGPpPCg6L+ym7mFGRMpL4PvLdDkhEDH8/rmnoIOoKE7N1BRyL4IFqxZPgo5E St62vaOHHWBFOffyV31f1f364AobiSPa/E4rFoXfc4CdWIBkd4QeY9zT47U5rDU5V44G 1pmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PPmga1wL; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id v1sor11837732pgr.49.2019.02.20.23.40.34 for (Google Transport Security); Wed, 20 Feb 2019 23:40:34 -0800 (PST) Received-SPF: pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=PPmga1wL; spf=pass (google.com: domain of john.stultz@linaro.org designates 209.85.220.65 as permitted sender) smtp.mailfrom=john.stultz@linaro.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=GWXTOmb3JzNVqDH2hs+GvMP8Fyrmw5Y58p0QdPLnm6A=; b=PPmga1wLUVsoUZS/3RDoXWfzfYAjKxNPZaGg0bSjEwsg4k50W5NP+a8WLLILkB1QNI reBd3Ge//MgtesmesQLSOGfHVcEsxxA5QhUjDa+SCw0pCp2v3wm/DEAYV6yzkHyAj9hY /jEhKkhVN04oaC7AvnapA/qyKxoTqdm9Jf7JDKPbNS2EwwMNRgmNzY7Nx+IxTN16mZa1 JW99iMarxbuaZGbSwle9r8kXdNd/7sCb4M17gHzjrUO9vJ+277aIEc6T7wQsPlk99Alz ybJwy+pVMccQbNZ4NmCBiADfEbGHgI0LsktVX/b+vd8oUT3uBmlyzEqTqQ7pVnFk6nT7 j9FQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=GWXTOmb3JzNVqDH2hs+GvMP8Fyrmw5Y58p0QdPLnm6A=; b=P29VAtVk/5ki/8AVND8qnUKmSL/KzfMCjYtuRUHo6nvPDJ2ljb0FAfVc2O/qUsPeWf hA9tHnWRdm2XLDEKpzQywjyNdYSWGWV6fGobFnoVPkPWEZQNeC2iu5BMHRAwyhOEFyED sEnOg9Tbox6gCvHawq1Y+2ZL2b29vaXKxhUA9QhiJTbqWg8R70hNkTzBoCpjPBbaEbYk J1TU4OQ037gbcx/digct6R9S3IlLoxGoJNjyNLvHND/PnptmKxYgVUighrlzY8ciw0t0 ImfTZxR5UO2RRCCEIqiULuw50WTFxbebDMGLZ1y1W/iqxd83n5HymAtDArMLlQqcyUuV p6GQ== X-Gm-Message-State: AHQUAuaJV3E3F+xaMmhR8I8/7t8VD/uXtLOmhCEXgYSmUR4XufBUjL+V vHk53ksYKklZOgHvBAR62XyDdX9y X-Google-Smtp-Source: AHgI3IaKtwvcC1zDPOsf71nMFTroT7XvoWKAIszTIV7e2HCJlZdy/HwQAx5Kwl5If0ryQeU5yItkCg== X-Received: by 2002:a63:2a96:: with SMTP id q144mr32734182pgq.338.1550734833885; Wed, 20 Feb 2019 23:40:33 -0800 (PST) Return-Path: Received: from localhost.localdomain ([2601:1c2:680:1319:4e72:b9ff:fe99:466a]) by smtp.gmail.com with ESMTPSA id g136sm35907237pfb.154.2019.02.20.23.40.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 20 Feb 2019 23:40:32 -0800 (PST) From: John Stultz To: Laura Abbott Cc: John Stultz , Benjamin Gaignard , Sumit Semwal , Liam Mark , Brian Starkey , "Andrew F . Davis" , Chenbo Feng , Alistair Strachan , dri-devel@lists.freedesktop.org Subject: [EARLY RFC][PATCH 0/4] dmabuf pools infrastructure (destaging ION) Date: Wed, 20 Feb 2019 23:40:26 -0800 Message-Id: <1550734830-23499-1-git-send-email-john.stultz@linaro.org> X-Mailer: git-send-email 2.7.4 Here is a very early peek at my dmabuf pools patchset, which tries to destage a fair chunk of ION functionality. This build and boots, but I've not gotten to testing the actual pool devices yet (need to write some kselftests)! I just wanted some early feedback on the overall direction. The patchset implements per-pool devices (extending my ion per-heap devices patchset from last week), which can be opened directly and then an ioctl is used to allocate a dmabuf from the pool. The interface is similar, but simpler then IONs, only providing an ALLOC ioctl. Also, I've only destaged the system/system-contig and cma pools, since the ION carveout and chunk heaps depended on out of tree board files to initialize those heaps. I'll leave that to folks who are actually using those heaps. Let me know what you think! thanks -john Cc: Laura Abbott Cc: Benjamin Gaignard Cc: Sumit Semwal Cc: Liam Mark Cc: Brian Starkey Cc: Andrew F. Davis Cc: Chenbo Feng Cc: Alistair Strachan Cc: dri-devel@lists.freedesktop.org John Stultz (4): dma-buf: Add dma-buf pools framework dma-buf: pools: Add page-pool for dma-buf pools dma-buf: pools: Add system/system-contig pools to dmabuf pools dma-buf: pools: Add CMA pool to dmabuf pools MAINTAINERS | 13 + drivers/dma-buf/Kconfig | 2 + drivers/dma-buf/Makefile | 1 + drivers/dma-buf/pools/Kconfig | 25 ++ drivers/dma-buf/pools/Makefile | 4 + drivers/dma-buf/pools/cma_pool.c | 143 ++++++++ drivers/dma-buf/pools/dmabuf-pools.c | 670 +++++++++++++++++++++++++++++++++++ drivers/dma-buf/pools/dmabuf-pools.h | 295 +++++++++++++++ drivers/dma-buf/pools/page_pool.c | 157 ++++++++ drivers/dma-buf/pools/pool-helpers.c | 317 +++++++++++++++++ drivers/dma-buf/pools/pool-ioctl.c | 94 +++++ drivers/dma-buf/pools/system_pool.c | 374 +++++++++++++++++++ include/uapi/linux/dmabuf-pools.h | 59 +++ 13 files changed, 2154 insertions(+) create mode 100644 drivers/dma-buf/pools/Kconfig create mode 100644 drivers/dma-buf/pools/Makefile create mode 100644 drivers/dma-buf/pools/cma_pool.c create mode 100644 drivers/dma-buf/pools/dmabuf-pools.c create mode 100644 drivers/dma-buf/pools/dmabuf-pools.h create mode 100644 drivers/dma-buf/pools/page_pool.c create mode 100644 drivers/dma-buf/pools/pool-helpers.c create mode 100644 drivers/dma-buf/pools/pool-ioctl.c create mode 100644 drivers/dma-buf/pools/system_pool.c create mode 100644 include/uapi/linux/dmabuf-pools.h -- 2.7.4