From patchwork Tue Aug 18 08:04:13 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyesoo Yu X-Patchwork-Id: 11720181 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3BC5E16B1 for ; Tue, 18 Aug 2020 07:46:01 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id E6CE9207DF for ; Tue, 18 Aug 2020 07:46:00 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="DM9i9Osq" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E6CE9207DF Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id F24398D0003; Tue, 18 Aug 2020 03:45:59 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id E82F38D000B; Tue, 18 Aug 2020 03:45:59 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D261B8D0009; Tue, 18 Aug 2020 03:45:59 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0001.hostedemail.com [216.40.44.1]) by kanga.kvack.org (Postfix) with ESMTP id BE00E8D0003 for ; Tue, 18 Aug 2020 03:45:59 -0400 (EDT) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 8828E362C for ; Tue, 18 Aug 2020 07:45:59 +0000 (UTC) X-FDA: 77162905638.06.sink22_1c00ede2701d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin06.hostedemail.com (Postfix) with ESMTP id 59EA81003A84C for ; Tue, 18 Aug 2020 07:45:59 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,hyesoo.yu@samsung.com,,RULES_HIT:30054,0,RBL:203.254.224.33:@samsung.com:.lbl8.mailshell.net-62.18.1.2 64.10.201.10;04ygjfyshbbxug6ydfcamo4diwywrocbn9pgszedjm8bjtqpf15ynwt6tc1ta71.tbybacpx1f3m5m6u1j5i7e91pxwwyqsyhy54ztwa7c3up3w6ousqxk739y7moya.1-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:217,LUA_SUMMARY:none X-HE-Tag: sink22_1c00ede2701d X-Filterd-Recvd-Size: 8431 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by imf46.hostedemail.com (Postfix) with ESMTP for ; Tue, 18 Aug 2020 07:45:57 +0000 (UTC) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20200818074554epoutp03d0bebfc521c2bd431f723cc8d142094a~sTR0IGuNz0363903639epoutp03h for ; Tue, 18 Aug 2020 07:45:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20200818074554epoutp03d0bebfc521c2bd431f723cc8d142094a~sTR0IGuNz0363903639epoutp03h DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597736754; bh=WSuAFDWoURcxmiALpbK+J/YL247Y+9wNans04ihmNTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=DM9i9Osq4+e6Sd/RgZgzykuNiWTclRA4U0w2dZLXlbi9WqFohMh3TTFI7IxNSOMzN ZCxC2dBphDUhJls3xwEUR0Wj0kWw+JoLTBxcpsBs8zUqG4eSAMDwC3t+CTNTZKVmqp DChDfWbp2J6PA+cKR0u/WU4/YCIoIk14ZtGOxGMM= Received: from epsnrtp1.localdomain (unknown [182.195.42.162]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20200818074554epcas2p19f579b82774797c41f96c2c7fe4e9759~sTRzoJm6b0149301493epcas2p1z; Tue, 18 Aug 2020 07:45:54 +0000 (GMT) Received: from epsmges2p2.samsung.com (unknown [182.195.40.190]) by epsnrtp1.localdomain (Postfix) with ESMTP id 4BW2yl1BvLzMqYlr; Tue, 18 Aug 2020 07:45:51 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p2.samsung.com (Symantec Messaging Gateway) with SMTP id 69.10.18874.E278B3F5; Tue, 18 Aug 2020 16:45:50 +0900 (KST) Received: from epsmtrp1.samsung.com (unknown [182.195.40.13]) by epcas2p1.samsung.com (KnoxPortal) with ESMTPA id 20200818074550epcas2p1e12121bc6e38086277766f08a59767ff~sTRwKzPO62831228312epcas2p1h; Tue, 18 Aug 2020 07:45:50 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp1.samsung.com (KnoxPortal) with ESMTP id 20200818074550epsmtrp1d20be4cab1f36e79e6f352e53dbf616f~sTRwJPPI82704027040epsmtrp1r; Tue, 18 Aug 2020 07:45:50 +0000 (GMT) X-AuditID: b6c32a46-503ff700000049ba-82-5f3b872e2517 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id F6.78.08303.E278B3F5; Tue, 18 Aug 2020 16:45:50 +0900 (KST) Received: from Dabang.dsn.sec.samsung.com (unknown [12.36.155.59]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200818074550epsmtip2b83c1a5c64259b06e112df6e7747129b~sTRv4_JW_2522925229epsmtip2N; Tue, 18 Aug 2020 07:45:50 +0000 (GMT) From: Hyesoo Yu To: sumit.semwal@linaro.org Cc: minchan@kernel.org, akpm@linux-foundation.org, iamjoonsoo.kim@lge.com, joaodias@google.com, linux-mm@kvack.org, pullip.cho@samsung.com, surenb@google.com, vbabka@suse.cz, afd@ti.com, benjamin.gaignard@linaro.org, lmark@codeaurora.org, labbott@redhat.com, Brian.Starkey@arm.com, john.stultz@linaro.org, christian.koenig@amd.com, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, Hyesoo Yu Subject: [PATCH 1/3] dma-buf: add missing EXPORT_SYMBOL_GPL() for dma heaps Date: Tue, 18 Aug 2020 17:04:13 +0900 Message-Id: <20200818080415.7531-2-hyesoo.yu@samsung.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200818080415.7531-1-hyesoo.yu@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA02Te0xTVxzHc2577y2akmvFecQotY4tuPBot+IBYRJl5G4sER97hBDhDu5a XClNW2AwluEq5WVhjJcDQkkEBrXMyWuAjG0FAQER5CWbYAQxccJYQOaDIWspZvz3Ob/f95vv +f1ODo8jyCadedFKLatWMgoRsYXb1OHm7e6Zdijca+0UWujNJVHpZTOBvrb0Emi6dxCg+btX cWTsHMDRyPICgVYzBnFUk6Uj0JPyaQ7qX3FHNW1PMfR45B6GhltLCXT+x0YcTZnXcFR8fQxD VcsLJHph+A2g1J87SdQ7uUSivFvlBCo5mw0CdtKpt1YJ2lxmBvRwtgGjy+vi6DpTBkHXLX5L 0pnzIxh9Z6yNoHsurHDpu1ndGP3HixkOvdA+StDZDSZA95d3knT37Z8weqlubwgVqvCTs0wU qxayysjYqGilzF8UfDL8aLjU20vsLvZBB0VCJRPD+osC3w9xD4pWWFchEsYzijhrKYTRaESe b/upY+O0rFAeq9H6i1hVlEIlFqs8NEyM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YPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200818074550epcas2p1e12121bc6e38086277766f08a59767ff References: <20200818080415.7531-1-hyesoo.yu@samsung.com> X-Rspamd-Queue-Id: 59EA81003A84C X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam05 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: The interface of dma heap is used from kernel module to register dma heaps, otherwize we will get compile error. Signed-off-by: Hyesoo Yu --- drivers/dma-buf/dma-heap.c | 2 ++ drivers/dma-buf/heaps/heap-helpers.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/dma-buf/dma-heap.c b/drivers/dma-buf/dma-heap.c index afd22c9..cc6339c 100644 --- a/drivers/dma-buf/dma-heap.c +++ b/drivers/dma-buf/dma-heap.c @@ -189,6 +189,7 @@ void *dma_heap_get_drvdata(struct dma_heap *heap) { return heap->priv; } +EXPORT_SYMBOL_GPL(dma_heap_get_drvdata); struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) { @@ -272,6 +273,7 @@ struct dma_heap *dma_heap_add(const struct dma_heap_export_info *exp_info) kfree(heap); return err_ret; } +EXPORT_SYMBOL_GPL(dma_heap_add); static char *dma_heap_devnode(struct device *dev, umode_t *mode) { diff --git a/drivers/dma-buf/heaps/heap-helpers.c b/drivers/dma-buf/heaps/heap-helpers.c index 9f964ca..741bae0 100644 --- a/drivers/dma-buf/heaps/heap-helpers.c +++ b/drivers/dma-buf/heaps/heap-helpers.c @@ -24,6 +24,7 @@ void init_heap_helper_buffer(struct heap_helper_buffer *buffer, INIT_LIST_HEAD(&buffer->attachments); buffer->free = free; } +EXPORT_SYMBOL_GPL(init_heap_helper_buffer); struct dma_buf *heap_helper_export_dmabuf(struct heap_helper_buffer *buffer, int fd_flags) @@ -37,6 +38,7 @@ struct dma_buf *heap_helper_export_dmabuf(struct heap_helper_buffer *buffer, return dma_buf_export(&exp_info); } +EXPORT_SYMBOL_GPL(heap_helper_export_dmabuf); static void *dma_heap_map_kernel(struct heap_helper_buffer *buffer) { From patchwork Tue Aug 18 08:04:14 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyesoo Yu X-Patchwork-Id: 11720185 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3AFC61392 for ; Tue, 18 Aug 2020 07:46:03 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id DFD2C2075E for ; Tue, 18 Aug 2020 07:46:02 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="mUxAmzYy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org DFD2C2075E Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 28D218D0009; Tue, 18 Aug 2020 03:46:00 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 205F28D000C; Tue, 18 Aug 2020 03:46:00 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id F1F8B8D0009; Tue, 18 Aug 2020 03:45:59 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0023.hostedemail.com [216.40.44.23]) by kanga.kvack.org (Postfix) with ESMTP id D3B4E8D0003 for ; Tue, 18 Aug 2020 03:45:59 -0400 (EDT) Received: from smtpin12.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 8FAB9180AD817 for ; Tue, 18 Aug 2020 07:45:59 +0000 (UTC) X-FDA: 77162905638.12.quill41_07092982701d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin12.hostedemail.com (Postfix) with ESMTP id 60CD31800456F for ; Tue, 18 Aug 2020 07:45:59 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,hyesoo.yu@samsung.com,,RULES_HIT:30029:30034:30054:30067,0,RBL:203.254.224.33:@samsung.com:.lbl8.mailshell.net-62.18.1.2 64.10.201.10;04yry3fitnrk8f459t9rwjuet3db1ypfteidnfwngcidfysnpnxejoy9niu1tzo.5hybpnrs3pi38h9xiofeyjtei331yp8taqbmxu7sjhrywwc46yq9wszfs71fiq3.1-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: quill41_07092982701d X-Filterd-Recvd-Size: 14567 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by imf26.hostedemail.com (Postfix) with ESMTP for ; Tue, 18 Aug 2020 07:45:57 +0000 (UTC) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20200818074555epoutp03ec1651302de6002ccd45a6819454f979~sTR0WVBOu0381803818epoutp03L for ; Tue, 18 Aug 2020 07:45:55 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20200818074555epoutp03ec1651302de6002ccd45a6819454f979~sTR0WVBOu0381803818epoutp03L DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597736755; bh=Zxep55EI+fppSvUl8AKpPiN+7XzgmmMwtuEKgBYUiB0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mUxAmzYyDZXN2OVAnK8fTCoKkWip8Z8iRYkD9O7mrmmoP5+z5Tdqfn++6UPySz9Pj RliTkdCeTmZ3bd6VXHSjuOtXToXhD9WwSTEcDg9nKdPq8ln6vYlbULEUdAPqF0Jd4P V6tUQT+pm4lN53XzIDYMA1jIYtbv9QBVgcKzk+ts= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p1.samsung.com (KnoxPortal) with ESMTP id 20200818074554epcas2p1744ee5e7179005b3e00bb6e7d517dc66~sTRz3Wuvn1835918359epcas2p1D; Tue, 18 Aug 2020 07:45:54 +0000 (GMT) Received: from epsmges2p1.samsung.com (unknown [182.195.40.181]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4BW2yn2rp7zMqYkb; Tue, 18 Aug 2020 07:45:53 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p1.samsung.com (Symantec Messaging Gateway) with SMTP id 27.CD.19322.1378B3F5; Tue, 18 Aug 2020 16:45:53 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20200818074553epcas2p240c2129fb8186f53e03abb0a0725461c~sTRyXolaO2912929129epcas2p2J; Tue, 18 Aug 2020 07:45:53 +0000 (GMT) Received: from epsmgms1p1new.samsung.com (unknown [182.195.42.41]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200818074552epsmtrp2846013684148a5d9ba9ca9a6e668269c~sTRyWiEey3172931729epsmtrp2V; Tue, 18 Aug 2020 07:45:52 +0000 (GMT) X-AuditID: b6c32a45-797ff70000004b7a-eb-5f3b87318684 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p1new.samsung.com (Symantec Messaging Gateway) with SMTP id A7.6D.08382.0378B3F5; Tue, 18 Aug 2020 16:45:52 +0900 (KST) Received: from Dabang.dsn.sec.samsung.com (unknown [12.36.155.59]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200818074552epsmtip258a1346d0159ab3ee30e951ffa88b795~sTRyEiSmV2522325223epsmtip2d; Tue, 18 Aug 2020 07:45:52 +0000 (GMT) From: Hyesoo Yu To: sumit.semwal@linaro.org Cc: minchan@kernel.org, akpm@linux-foundation.org, iamjoonsoo.kim@lge.com, joaodias@google.com, linux-mm@kvack.org, pullip.cho@samsung.com, surenb@google.com, vbabka@suse.cz, afd@ti.com, benjamin.gaignard@linaro.org, lmark@codeaurora.org, labbott@redhat.com, Brian.Starkey@arm.com, john.stultz@linaro.org, christian.koenig@amd.com, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, Hyesoo Yu Subject: [PATCH 2/3] dma-buf: heaps: add chunk heap to dmabuf heaps Date: Tue, 18 Aug 2020 17:04:14 +0900 Message-Id: <20200818080415.7531-3-hyesoo.yu@samsung.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200818080415.7531-1-hyesoo.yu@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Te0xTZxTfd297W3S4a0X8VuboypYNHNgWi1/RMo2M3bkRWIhbIsm6Du6A rK+0RWEki4gIIu9u6AAV9uBZwlYQ0FGZlY1aX7wkZKKMMpg6EQIDYQiu9GrGf79zzu93ft85 Xw4X5xVy+NwkjZHWa5QqIbGG1XLJPyRQnLVDIVp4QqJJRxEHlTeaCXTY5iCQ09EN0MTwz2x0 pvM6G/XPThJo6Vg3G9UezyDQowonjq4uBqLa9nkM/dM/gqG+8+UEyv3xLBvdMT9ho9LLAxiq mp3koOW8iwBlWjs5yHF7hoNMvRUEKkvPB7s2UZm9SwRlPm0GVF9+HkZVWJIpS90xgrJMF3Oo nIl+jBoaaCco+8lFFjV8vAujbi2P4tTkhZsEld9cB6irFZ0cqm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kKeKIMFwmF/8F/6eiT14DAAA= X-CMS-MailID: 20200818074553epcas2p240c2129fb8186f53e03abb0a0725461c X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200818074553epcas2p240c2129fb8186f53e03abb0a0725461c References: <20200818080415.7531-1-hyesoo.yu@samsung.com> X-Rspamd-Queue-Id: 60CD31800456F X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam02 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This patch adds support for a chunk heap that allows for buffers that are made up of a list of fixed size chunks taken from a CMA. Chunk sizes are configuratd when the heaps are created. Signed-off-by: Hyesoo Yu Reported-by: kernel test robot --- drivers/dma-buf/heaps/Kconfig | 9 ++ drivers/dma-buf/heaps/Makefile | 1 + drivers/dma-buf/heaps/chunk_heap.c | 222 +++++++++++++++++++++++++++++++++++++ 3 files changed, 232 insertions(+) create mode 100644 drivers/dma-buf/heaps/chunk_heap.c diff --git a/drivers/dma-buf/heaps/Kconfig b/drivers/dma-buf/heaps/Kconfig index a5eef06..98552fa 100644 --- a/drivers/dma-buf/heaps/Kconfig +++ b/drivers/dma-buf/heaps/Kconfig @@ -12,3 +12,12 @@ config DMABUF_HEAPS_CMA Choose this option to enable dma-buf CMA heap. This heap is backed by the Contiguous Memory Allocator (CMA). If your system has these regions, you should say Y here. + +config DMABUF_HEAPS_CHUNK + tristate "DMA-BUF CHUNK Heap" + depends on DMABUF_HEAPS && DMA_CMA + help + Choose this option to enable dma-buf CHUNK heap. This heap is backed + by the Contiguous Memory Allocator (CMA) and allocate the buffers that + are made up to a list of fixed size chunks tasken from CMA. Chunk sizes + are configurated when the heaps are created. diff --git a/drivers/dma-buf/heaps/Makefile b/drivers/dma-buf/heaps/Makefile index 6e54cde..3b2a0986 100644 --- a/drivers/dma-buf/heaps/Makefile +++ b/drivers/dma-buf/heaps/Makefile @@ -2,3 +2,4 @@ obj-y += heap-helpers.o obj-$(CONFIG_DMABUF_HEAPS_SYSTEM) += system_heap.o obj-$(CONFIG_DMABUF_HEAPS_CMA) += cma_heap.o +obj-$(CONFIG_DMABUF_HEAPS_CHUNK) += chunk_heap.o diff --git a/drivers/dma-buf/heaps/chunk_heap.c b/drivers/dma-buf/heaps/chunk_heap.c new file mode 100644 index 0000000..1eefaec --- /dev/null +++ b/drivers/dma-buf/heaps/chunk_heap.c @@ -0,0 +1,222 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * ION Memory Allocator chunk heap exporter + * + * Copyright (c) 2020 Samsung Electronics Co., Ltd. + * Author: for Samsung Electronics. + */ + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include "heap-helpers.h" + +struct chunk_heap { + struct dma_heap *heap; + phys_addr_t base; + phys_addr_t size; + atomic_t cur_pageblock_idx; + unsigned int max_num_pageblocks; + unsigned int order; +}; + +static void chunk_heap_free(struct heap_helper_buffer *buffer) +{ + struct chunk_heap *chunk_heap = dma_heap_get_drvdata(buffer->heap); + pgoff_t pg; + + for (pg = 0; pg < buffer->pagecount; pg++) + __free_pages(buffer->pages[pg], chunk_heap->order); + kvfree(buffer->pages); + kfree(buffer); +} + +static inline unsigned long chunk_get_next_pfn(struct chunk_heap *chunk_heap) +{ + unsigned long i = atomic_inc_return(&chunk_heap->cur_pageblock_idx) % + chunk_heap->max_num_pageblocks; + + return PHYS_PFN(chunk_heap->base) + i * pageblock_nr_pages; +} + +static int chunk_alloc_pages(struct chunk_heap *chunk_heap, struct page **pages, + unsigned int order, unsigned int count) +{ + unsigned long base; + unsigned int i = 0, nr_block = 0, nr_elem, ret; + + while (count) { + /* + * If the number of scanned page block is the same as max block, + * the tries of allocation fails. + */ + if (nr_block++ == chunk_heap->max_num_pageblocks) { + ret = -ENOMEM; + goto err_bulk; + } + base = chunk_get_next_pfn(chunk_heap); + nr_elem = min_t(unsigned int, count, pageblock_nr_pages >> order); + ret = alloc_pages_bulk(base, base + pageblock_nr_pages, MIGRATE_CMA, + GFP_KERNEL, order, nr_elem, pages + i); + if (ret < 0) + goto err_bulk; + + i += ret; + count -= ret; + } + + return 0; + +err_bulk: + while (i-- > 0) + __free_pages(pages[i], order); + + return ret; +} + +static int chunk_heap_allocate(struct dma_heap *heap, unsigned long len, + unsigned long fd_flags, unsigned long heap_flags) +{ + + struct chunk_heap *chunk_heap = dma_heap_get_drvdata(heap); + struct heap_helper_buffer *helper_buffer; + struct dma_buf *dmabuf; + unsigned int count = DIV_ROUND_UP(len, PAGE_SIZE << chunk_heap->order); + int ret = -ENOMEM; + + helper_buffer = kzalloc(sizeof(*helper_buffer), GFP_KERNEL); + if (!helper_buffer) + return ret; + + init_heap_helper_buffer(helper_buffer, chunk_heap_free); + + helper_buffer->heap = heap; + helper_buffer->size = ALIGN(len, PAGE_SIZE << chunk_heap->order); + helper_buffer->pagecount = count; + helper_buffer->pages = kvmalloc_array(helper_buffer->pagecount, + sizeof(*helper_buffer->pages), GFP_KERNEL); + if (!helper_buffer->pages) + goto err0; + + ret = chunk_alloc_pages(chunk_heap, helper_buffer->pages, + chunk_heap->order, helper_buffer->pagecount); + if (ret < 0) + goto err1; + + dmabuf = heap_helper_export_dmabuf(helper_buffer, fd_flags); + if (IS_ERR(dmabuf)) { + ret = PTR_ERR(dmabuf); + goto err2; + } + + helper_buffer->dmabuf = dmabuf; + + ret = dma_buf_fd(dmabuf, fd_flags); + if (ret < 0) { + dma_buf_put(dmabuf); + return ret; + } + + return ret; + +err2: + while (count-- > 0) + __free_pages(helper_buffer->pages[count], chunk_heap->order); +err1: + kvfree(helper_buffer->pages); +err0: + kfree(helper_buffer); + + return ret; +} + +static void rmem_remove_callback(void *p) +{ + of_reserved_mem_device_release((struct device *)p); +} + +static const struct dma_heap_ops chunk_heap_ops = { + .allocate = chunk_heap_allocate, +}; + +static int chunk_heap_probe(struct platform_device *pdev) +{ + struct chunk_heap *chunk_heap; + struct reserved_mem *rmem; + struct device_node *rmem_np; + struct dma_heap_export_info exp_info; + unsigned int alignment; + int ret; + + ret = of_reserved_mem_device_init(&pdev->dev); + if (ret || !pdev->dev.cma_area) { + dev_err(&pdev->dev, "The CMA reserved area is not assigned (ret %d)", ret); + return -EINVAL; + } + + ret = devm_add_action(&pdev->dev, rmem_remove_callback, &pdev->dev); + if (ret) { + of_reserved_mem_device_release(&pdev->dev); + return ret; + } + + rmem_np = of_parse_phandle(pdev->dev.of_node, "memory-region", 0); + rmem = of_reserved_mem_lookup(rmem_np); + + chunk_heap = devm_kzalloc(&pdev->dev, sizeof(*chunk_heap), GFP_KERNEL); + if (!chunk_heap) + return -ENOMEM; + + chunk_heap->base = rmem->base; + chunk_heap->size = rmem->size; + chunk_heap->max_num_pageblocks = rmem->size >> (pageblock_order + PAGE_SHIFT); + + of_property_read_u32(pdev->dev.of_node, "alignment", &alignment); + chunk_heap->order = get_order(alignment); + + exp_info.name = rmem->name; + exp_info.ops = &chunk_heap_ops; + exp_info.priv = chunk_heap; + + chunk_heap->heap = dma_heap_add(&exp_info); + if (IS_ERR(chunk_heap->heap)) + return PTR_ERR(chunk_heap->heap); + + return 0; +} + +static const struct of_device_id chunk_heap_of_match[] = { + { .compatible = "dma_heap,chunk", }, + { }, +}; + +MODULE_DEVICE_TABLE(of, chunk_heap_of_match); + +static struct platform_driver chunk_heap_driver = { + .driver = { + .name = "chunk_heap", + .of_match_table = chunk_heap_of_match, + }, + .probe = chunk_heap_probe, +}; + +static int __init chunk_heap_init(void) +{ + return platform_driver_register(&chunk_heap_driver); +} +module_init(chunk_heap_init); +MODULE_DESCRIPTION("DMA-BUF Chunk Heap"); +MODULE_LICENSE("GPL v2"); From patchwork Tue Aug 18 08:04:15 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyesoo Yu X-Patchwork-Id: 11720187 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9E21816B1 for ; Tue, 18 Aug 2020 07:46:05 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 5B5E920738 for ; Tue, 18 Aug 2020 07:46:05 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=samsung.com header.i=@samsung.com header.b="EDLCjEn7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 5B5E920738 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=samsung.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id B2A948D000C; Tue, 18 Aug 2020 03:46:01 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id A8D7C8D000B; Tue, 18 Aug 2020 03:46:01 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 92CA68D000C; Tue, 18 Aug 2020 03:46:01 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0153.hostedemail.com [216.40.44.153]) by kanga.kvack.org (Postfix) with ESMTP id 6D54F8D000B for ; Tue, 18 Aug 2020 03:46:01 -0400 (EDT) Received: from smtpin15.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 24282180AD817 for ; Tue, 18 Aug 2020 07:46:01 +0000 (UTC) X-FDA: 77162905722.15.brass41_0017d8f2701d Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin15.hostedemail.com (Postfix) with ESMTP id E9E6A1814B0C1 for ; Tue, 18 Aug 2020 07:46:00 +0000 (UTC) X-Spam-Summary: 1,0,0,,d41d8cd98f00b204,hyesoo.yu@samsung.com,,RULES_HIT:30054:30080,0,RBL:203.254.224.33:@samsung.com:.lbl8.mailshell.net-62.18.1.2 64.10.201.10;04yro5i8pqyo7kchwbjqdj1f5q3ebycsyguy1a4qojoqkki5uzy94eywupzhfhr.1tc5bbrnom9b8n8a51xg8da4on8ozwo9h8fecpb4mda8krf7uuwqyxjhs8ntw91.1-lbl8.mailshell.net-223.238.255.100,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fp,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:24,LUA_SUMMARY:none X-HE-Tag: brass41_0017d8f2701d X-Filterd-Recvd-Size: 8503 Received: from mailout3.samsung.com (mailout3.samsung.com [203.254.224.33]) by imf13.hostedemail.com (Postfix) with ESMTP for ; Tue, 18 Aug 2020 07:45:59 +0000 (UTC) Received: from epcas2p1.samsung.com (unknown [182.195.41.53]) by mailout3.samsung.com (KnoxPortal) with ESMTP id 20200818074556epoutp0374c0b6d5114e39cd85ca3b238f85f61f~sTR1-ZqUl0388503885epoutp03G for ; Tue, 18 Aug 2020 07:45:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout3.samsung.com 20200818074556epoutp0374c0b6d5114e39cd85ca3b238f85f61f~sTR1-ZqUl0388503885epoutp03G DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1597736756; bh=NYk4vyq4/Af59A9O7MoR71/hiPLvorK8FswSuJrxYj0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=EDLCjEn7OgwFd7LWq54JTIpNUm7RJgtOrh17wuOD4tQYJ+ncz7bHbYEZloJKG/HCP M7JcIR8kEL+8CJnXWEpNgypoU75ZkJj3AlcUTMD1rRke3qNVYmUqbPLxembxNTUqeh SvpWORuzfslb2sVxkTtiruVNtpSRuTB9Cf1AADaw= Received: from epsnrtp4.localdomain (unknown [182.195.42.165]) by epcas2p3.samsung.com (KnoxPortal) with ESMTP id 20200818074556epcas2p3e533cf487e0aedafeb49bf98bb3f95af~sTR1fFhvt3189631896epcas2p3O; Tue, 18 Aug 2020 07:45:56 +0000 (GMT) Received: from epsmges2p4.samsung.com (unknown [182.195.40.190]) by epsnrtp4.localdomain (Postfix) with ESMTP id 4BW2yq0g06zMqYkw; Tue, 18 Aug 2020 07:45:55 +0000 (GMT) Received: from epcas2p2.samsung.com ( [182.195.41.54]) by epsmges2p4.samsung.com (Symantec Messaging Gateway) with SMTP id B2.7B.27013.2378B3F5; Tue, 18 Aug 2020 16:45:54 +0900 (KST) Received: from epsmtrp2.samsung.com (unknown [182.195.40.14]) by epcas2p2.samsung.com (KnoxPortal) with ESMTPA id 20200818074554epcas2p2702e648ba975ea6fbe33c84396b152a9~sTRz60yJF2912929129epcas2p2P; Tue, 18 Aug 2020 07:45:54 +0000 (GMT) Received: from epsmgms1p2.samsung.com (unknown [182.195.42.42]) by epsmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200818074554epsmtrp2a90715301aa5475ea0eb05387cb4b51a~sTRz5weJW3172931729epsmtrp2Y; Tue, 18 Aug 2020 07:45:54 +0000 (GMT) X-AuditID: b6c32a48-d1fff70000006985-f0-5f3b8732f518 Received: from epsmtip2.samsung.com ( [182.195.34.31]) by epsmgms1p2.samsung.com (Symantec Messaging Gateway) with SMTP id 79.78.08303.2378B3F5; Tue, 18 Aug 2020 16:45:54 +0900 (KST) Received: from Dabang.dsn.sec.samsung.com (unknown [12.36.155.59]) by epsmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200818074554epsmtip2c2421d264027b33b380a1078e7784644~sTRzmy3cy2522425224epsmtip2U; Tue, 18 Aug 2020 07:45:54 +0000 (GMT) From: Hyesoo Yu To: sumit.semwal@linaro.org Cc: minchan@kernel.org, akpm@linux-foundation.org, iamjoonsoo.kim@lge.com, joaodias@google.com, linux-mm@kvack.org, pullip.cho@samsung.com, surenb@google.com, vbabka@suse.cz, afd@ti.com, benjamin.gaignard@linaro.org, lmark@codeaurora.org, labbott@redhat.com, Brian.Starkey@arm.com, john.stultz@linaro.org, christian.koenig@amd.com, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, linaro-mm-sig@lists.linaro.org, linux-kernel@vger.kernel.org, robh+dt@kernel.org, devicetree@vger.kernel.org, Hyesoo Yu Subject: [PATCH 3/3] dma-heap: Devicetree binding for chunk heap Date: Tue, 18 Aug 2020 17:04:15 +0900 Message-Id: <20200818080415.7531-4-hyesoo.yu@samsung.com> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20200818080415.7531-1-hyesoo.yu@samsung.com> MIME-Version: 1.0 X-Brightmail-Tracker: H4sIAAAAAAAAA01Te0xTVxze6e29LWrNteg4wh7dZUYhFlqk5YAwcBBzI86RYJzbEruO3hVm abu2sMmEuclDKiU8ssEKatkcUh5jIDgG4gRJCgQV5ZG6DRUQkjEBlTEmL9dSzPjv+32/7zvf +f1ODhfj53I8uQlqA6NTy1UUsY596ZqPVLgra7dMNPsmmu7O56DS2moCfdXeTaCR7l6AJu+1 4Ohcxw0c9c9OE2gpuxdH1tMnCTRnGcFQz4IQWS//y0J/9w+zUF9zKYFyfmrE0d3qZzgydw2y UPnsNActm9oAymjt4KDuoRkOKrxtIVDJl7kgwoPOuL1E0NVnqwHdl2ti0Zb6JLq+Mpug658U cGjjZD+L/mPwMkF3Fi+w6XunbSz69+VRjJ6+MkDQuQ2VgO6xdHBom/1nFj1T/0oM+Z4qNJ6R KxidgFHHaRQJamUYFR0ri5RJpCKxUByMgiiBWp7IhFFR+2OEexNUjlVQgmS5KslBxcj1esr/ jVCdJsnACOI1ekMYxWgVKq1YrPXTyxP1SWqlX5wmMUQsEgVIHMoPVPEFV8O1eRs/W776PfsE yFtvBG5cSAbCB8sXWUawjssnmwC8k58NXMUTADMvWVY7MwDWlJ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QCftf1sGDTr0BYavqBwZGWbgw6a64T8GLlQzZ8q//DhhprKwZLRl0cOJ7zDMCM2gYO tHUMc2C+Q0dA7RkVWOeNMhxjBNLf1APkVOVgSGdIQYay8wQyfM3joOzBFgy1t5oIZLn6C0ed Fxox1Dbey0KuJy8JpKoqA6hJ18BBja+qMTRsmLONivZaHcdIDxxmFEvX7PVKyKtbm5Q7LXW8 7hZ+GuROzQZckqbC6JyK3yAbeJF8ygjojos/8Ekwm9YMW7HJPJPuPNvAnpRGAf210A7cgKAC aEtViScLKF+68O5dj8Si6nG6/t4rwg1mUutoc9eniVWSxKn5dG/jCXfkUSvpDvWpyX1/+rK2 A7hrLrWK7i9f6a75E4bRZPScwKNm0NZrfZ7TWBN6+kMtKxdQmv+Q5j+kA1gZmM0kKWXxMmVI UqicORKkFMuUKfL4IEmizAA83xaJjMBUNhRkBhgJzIAmWUIBb59lRSyfFyc+eoxRJMYqUqSM 0gx8SVzozRvVFO/hU/HiZOYQwyQxin8UI7k+p7FI+8ai2hL1o2W84N5v3WHjY9LjNznbi1cv 9+2P2NI1EusnjDqm2hHTXCMO97M6mdShrIH+Tcuf3pckcCK/tSnm7uYGU9LsnV/uaKPvH66y 3k4V7+/DZqkOvkdhi0UVix6MiLCM5JP7vSOW5Duu+aUVHIxOd0yb1Vf90izbOlD5dkqyrTRQ ov7JOztw43awZZeDWz03Kr92MOr5gvINn0NKTO/aT62qFmQp1JIrqd51QR9XnJsyvWcJg32o ZJoEXSkBgs3lkp3GcP2lQJAnfV1kjMgEP+O+L3SdccllFUPtMSKLITLzg7T7jX+cz4JmuH6t 0/60a15BZs2yF9qYd9ApxJUJ4hARS6EU/wVwY7QAXAMAAA== X-CMS-MailID: 20200818074554epcas2p2702e648ba975ea6fbe33c84396b152a9 X-Msg-Generator: CA X-Sendblock-Type: AUTO_CONFIDENTIAL CMS-TYPE: 102P DLP-Filter: Pass X-CFilter-Loop: Reflected X-CMS-RootMailID: 20200818074554epcas2p2702e648ba975ea6fbe33c84396b152a9 References: <20200818080415.7531-1-hyesoo.yu@samsung.com> X-Rspamd-Queue-Id: E9E6A1814B0C1 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam01 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Document devicetree binding for chunk heap on dma heap framework Signed-off-by: Hyesoo Yu --- .../devicetree/bindings/dma-buf/chunk_heap.yaml | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma-buf/chunk_heap.yaml diff --git a/Documentation/devicetree/bindings/dma-buf/chunk_heap.yaml b/Documentation/devicetree/bindings/dma-buf/chunk_heap.yaml new file mode 100644 index 0000000..1ee8fad --- /dev/null +++ b/Documentation/devicetree/bindings/dma-buf/chunk_heap.yaml @@ -0,0 +1,46 @@ +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) +%YAML 1.2 +--- +$id: http://devicetree.org/schemas/dma-buf/chunk_heap.yaml# +$schema: http://devicetree.org/meta-schemas/core.yaml# + +title: Device tree binding for chunk heap on DMA HEAP FRAMEWORK + +maintainers: + - Sumit Semwal + +description: | + The chunk heap is backed by the Contiguous Memory Allocator (CMA) and + allocates the buffers that are made up to a list of fixed size chunks + taken from CMA. Chunk sizes are configurated when the heaps are created. + +properties: + compatible: + enum: + - dma_heap,chunk + +required: + - compatible + - memory-region + - alignment + +additionalProperties: false + +examples: + - | + reserved-memory { + #address-cells = <2>; + #size-cells = <1>; + + chunk_memory: chunk_memory { + compatible = "shared-dma-pool"; + reusable; + size = <0x10000000>; + }; + }; + + chunk_default_heap: chunk_default_heap { + compatible = "dma_heap,chunk"; + memory-region = <&chunk_memory>; + alignment = <0x10000>; + };