From b0cbb06dd1cee26f3957fc0ec1d44b2a4a75247e Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Wed, 7 Aug 2019 10:05:58 -0700 Subject: [PATCH 1/2] staging: android: ion: Use the MSM dmabuf ops when possible Use the MSM dmabuf operations for cache maintenance on ION buffers if they are present. Otherwise, fallback to the default ION dmabuf operations. Change-Id: I56e7eabb2614a958aca11c9c1fa4ecd5415ce96a Signed-off-by: Isaac J. Manjarres --- drivers/staging/android/ion/ion.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index 7142185c9410..3e5457289dac 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -27,6 +27,7 @@ #include #include "ion.h" +#include "msm_ion_priv.h" static struct ion_device *internal_dev; @@ -427,7 +428,11 @@ static struct dma_buf *ion_alloc_dmabuf(size_t len, unsigned int heap_id_mask, if (IS_ERR(buffer)) return ERR_CAST(buffer); +#if IS_ENABLED(CONFIG_ION_MSM_HEAPS) + exp_info.ops = &msm_ion_dma_buf_ops; +#else exp_info.ops = &dma_buf_ops; +#endif exp_info.size = buffer->size; exp_info.flags = O_RDWR; exp_info.priv = buffer; From a3d33fec73cfd9b6b26029af7f7dfa20042750ce Mon Sep 17 00:00:00 2001 From: "Isaac J. Manjarres" Date: Tue, 6 Aug 2019 13:16:02 -0700 Subject: [PATCH 2/2] defconfig: Enable the MSM ION heaps on Lahaina Enable the MSM ION heaps to allow allocations from these heaps through ION. Change-Id: Ib62d8124d27dcf6dd0a357eb0e36fef5af1138f6 Signed-off-by: Isaac J. Manjarres --- arch/arm64/configs/vendor/lahaina_QGKI.config | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm64/configs/vendor/lahaina_QGKI.config b/arch/arm64/configs/vendor/lahaina_QGKI.config index f47979153249..588eb5934e5c 100644 --- a/arch/arm64/configs/vendor/lahaina_QGKI.config +++ b/arch/arm64/configs/vendor/lahaina_QGKI.config @@ -10,3 +10,4 @@ CONFIG_QCOM_SECURE_BUFFER=y CONFIG_EDAC_KRYO_ARM64=y CONFIG_EDAC_KRYO_ARM64_PANIC_ON_UE=y CONFIG_SPARSEMEM_VMEMMAP=y +CONFIG_ION_MSM_HEAPS=y