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: 10823251 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 64DA113A4 for ; Thu, 21 Feb 2019 07:40:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 554FB2EE28 for ; Thu, 21 Feb 2019 07:40:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 495A02EE30; Thu, 21 Feb 2019 07:40:40 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 1A02F2EE28 for ; Thu, 21 Feb 2019 07:40:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 2BA7C8919A; Thu, 21 Feb 2019 07:40:36 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-pg1-x544.google.com (mail-pg1-x544.google.com [IPv6:2607:f8b0:4864:20::544]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9500C8919A for ; Thu, 21 Feb 2019 07:40:34 +0000 (UTC) Received: by mail-pg1-x544.google.com with SMTP id y1so13351151pgk.11 for ; Wed, 20 Feb 2019 23:40:34 -0800 (PST) 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=NmRuPrebTJLiu/s+nIUecJPr9mzv3qleaUdLX3+T1lm3br/HUXaduj3ynjzx9nA4Th QfUIM576q+1jm7xYiERFdBMpwC1MDtYtPIw7/kI1hw72ni8EY73a5FweN7lixvzvldcy d3emlzbjuQqJ7/22JsF7P7NS3OmBo3Z91j76s4FNptA1SNUPCkraiPQG1mlVDaFu3b3X qS21vME7TKzKX1KghhXknwBET5TPxCkMrJ5k8QoA3WYLlm3Uy8CJgpkHz7+Zuu6dL42d gs4jXFkjGkhzFcRWjntm2GqHrlIoQOyzehT7tx/z546tSNF4mYdPgBHD2fQOOo0D2aqo Xq/g== X-Gm-Message-State: AHQUAuYBdG62SLDklXUBzo5N22I0ydmauOD5ULtWVk5GRT3Nu62qbpUo aR93QDnbS/XuvDzhVuqnJ4/pBg== 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) 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 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 X-Mailman-Original-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-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Chenbo Feng , Alistair Strachan , Liam Mark , "Andrew F . Davis" , dri-devel@lists.freedesktop.org MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP 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