From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout-p-101.mailbox.org (mout-p-101.mailbox.org [80.241.56.151]) by mx.groups.io with SMTP id smtpd.web10.2416.1603181950241815929 for ; Tue, 20 Oct 2020 01:19:11 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@mailbox.org header.s=mail20150812 header.b=m0Yv8RhZ; spf=pass (domain: mailbox.org, ip: 80.241.56.151, mailfrom: crg7475@mailbox.org) Received: from smtp2.mailbox.org (smtp2.mailbox.org [80.241.60.241]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-101.mailbox.org (Postfix) with ESMTPS id 4CFmk33btszKmWR for ; Tue, 20 Oct 2020 10:19:07 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=mailbox.org; h= content-language:content-transfer-encoding:content-type :content-type:mime-version:date:date:message-id:subject:subject :from:from:received; s=mail20150812; t=1603181944; bh=o5A+84U/VA XsKA/AZKuUWxlVMDf0gGCUXocQ9HJ3Uzc=; b=m0Yv8RhZEu0VuR/TPhySulQkDK /nSq1ZL+6A54cv0UMHtp/ocf1CVFCnGa4QyCqDR7TnOIuHp01Tq2+0nynYzp1pc3 RcAgUKZSqWFdqbKvLyg8JN6bqNzTOIQ1e4oyHHXYdBZ4vUk5ycPIKQDzp+wH/7rf SZD/YiB+W+Y5YCbiXPL7yot7fgUvmgkshFek4AVzF87pqOoDoBQKX/OxzTg7pRce 60Qztiw2q/vWQAC3+6XodwsyO+BZfmHnPEwTOFm5ld6x9/Ue0YPiciinz+SNb4sV mgNd/YfAc3g9ytbpBq3no+3roD7AW3HgsMsFEgMIfhc27VVB6elWrZLsbqfw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mailbox.org; s=mail20150812; t=1603181945; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=la2HXrefPnwEiHe6ysQK6eauWZWdMlvpF9rFFYUC3wg=; b=IXNwx0BKqjas2DG+jqLbzI/454HoJhC3wa7ZtNtGf2S3XnYZXptJNp74xwioXW/n678dI+ WXaPpHf6vQvSNSuY/s9bkRH2Gv9EKtRPJzOatgR1JnaBLLVlAvhdBU+UELJJ+HHdkiH0JM yaCwM8x2JcCXeSsg9AwZ8ZtQ5sV74ZI4TksDxsmI9YfXHvn5DiAedw/R5N7O1Owtsz1g9p V+K1ckvOBUNBaVtphnr+sVPL87dUCSYml7i08CwKAARyL/xXGzxZCa0xyLag8izcryrazo 2ZaiTuui2maYsbNdAyTqA576Q7D3aGICd3tMRxV4sO/D+12XB8bsJ7HLqv5ypQ== X-Virus-Scanned: amavisd-new at heinlein-support.de Received: from smtp2.mailbox.org ([80.241.60.241]) by spamfilter05.heinlein-hosting.de (spamfilter05.heinlein-hosting.de [80.241.56.123]) (amavisd-new, port 10030) with ESMTP id PGq_XovG1B-Y for ; Tue, 20 Oct 2020 10:19:04 +0200 (CEST) To: meta-freescale@lists.yoctoproject.org From: "Carlos Rafael Giani" Subject: Enabling ION with CMA heap on imx6 Message-ID: <1ec795f6-53b7-52c7-f2dc-05c39c2f0d03@mailbox.org> Date: Tue, 20 Oct 2020 10:19:03 +0200 MIME-Version: 1.0 X-MBO-SPAM-Probability: X-Rspamd-Score: -4.69 / 15.00 / 15.00 X-Rspamd-Queue-Id: 868211710 X-Rspamd-UID: 871f54 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US On i.MX6 machines, it is currently not possible to use the ION allocator. However, there is no hardware limitation that requires ION to be disabled. If ION were enabled, with a CMA heap, then it would be possible for userspace to allocate DMA-BUF buffers. I could then enable the ion packageconfig in the libimxdmabuffer recipe. The defconfig only needs these additions: CONFIG_ION=y CONFIG_ION_SYSTEM_HEAP=y CONFIG_ION_CMA_HEAP=y I tried it out, worked fine. Using DMA-BUF for allocating physically contiguous memory (via CMA) is preferable over using other allocators (like the ones from the VPU, IPU etc.) since it allows for proper buffer sharing, ownership transfer, is based on FDs (though physical address are accessible via an NXP extension), and there are extensions in OpenCL, OpenGL etc. for importing DMA-BUF. V4L2 also has DMA-BUF support. Opinions?