From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751989AbdCCOwQ (ORCPT ); Fri, 3 Mar 2017 09:52:16 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:36135 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751601AbdCCOwL (ORCPT ); Fri, 3 Mar 2017 09:52:11 -0500 Date: Fri, 3 Mar 2017 11:33:04 +0100 From: Daniel Vetter To: Laura Abbott Cc: Sumit Semwal , Riley Andrews , arve@android.com, romlem@google.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linaro-mm-sig@lists.linaro.org, Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, Brian Starkey , Daniel Vetter , Mark Brown , Benjamin Gaignard , linux-mm@kvack.org Subject: Re: [RFC PATCH 11/12] staging: android: ion: Make Ion heaps selectable Message-ID: <20170303103304.nxfn7zlccx24b3xq@phenom.ffwll.local> Mail-Followup-To: Laura Abbott , Sumit Semwal , Riley Andrews , arve@android.com, romlem@google.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linaro-mm-sig@lists.linaro.org, Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, Brian Starkey , Daniel Vetter , Mark Brown , Benjamin Gaignard , linux-mm@kvack.org References: <1488491084-17252-1-git-send-email-labbott@redhat.com> <1488491084-17252-12-git-send-email-labbott@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1488491084-17252-12-git-send-email-labbott@redhat.com> X-Operating-System: Linux phenom 4.8.0-1-amd64 User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Mar 02, 2017 at 01:44:43PM -0800, Laura Abbott wrote: > > Currently, all heaps are compiled in all the time. In switching to > a better platform model, let's allow these to be compiled out for good > measure. > > Signed-off-by: Laura Abbott I'm not the biggest fan of making everything Kconfig-selectable. And the #ifdef stuff doesn't look all that pretty. If we'd also use this opportunity to split each heap into their own file I think this patch here would be a lot more useful. Anyway, no real opinion from me on this, just an idea. -Daniel > --- > drivers/staging/android/ion/Kconfig | 32 ++++++++++++++++++++ > drivers/staging/android/ion/Makefile | 8 +++-- > drivers/staging/android/ion/ion_priv.h | 53 ++++++++++++++++++++++++++++++++-- > 3 files changed, 87 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/android/ion/Kconfig b/drivers/staging/android/ion/Kconfig > index 0c91b2b..2e97990 100644 > --- a/drivers/staging/android/ion/Kconfig > +++ b/drivers/staging/android/ion/Kconfig > @@ -17,3 +17,35 @@ config ION_TEST > Choose this option to create a device that can be used to test the > kernel and device side ION functions. > > +config ION_SYSTEM_HEAP > + bool "Ion system heap" > + depends on ION > + help > + Choose this option to enable the Ion system heap. The system heap > + is backed by pages from the buddy allocator. If in doubt, say Y. > + > +config ION_CARVEOUT_HEAP > + bool "Ion carveout heap support" > + depends on ION > + help > + Choose this option to enable carveout heaps with Ion. Carveout heaps > + are backed by memory reserved from the system. Allocation times are > + typically faster at the cost of memory not being used. Unless you > + know your system has these regions, you should say N here. > + > +config ION_CHUNK_HEAP > + bool "Ion chunk heap support" > + depends on ION > + help > + Choose this option to enable chunk heaps with Ion. This heap is > + similar in function the carveout heap but memory is broken down > + into smaller chunk sizes, typically corresponding to a TLB size. > + Unless you know your system has these regions, you should say N here. > + > +config ION_CMA_HEAP > + bool "Ion CMA heap support" > + depends on ION && CMA > + help > + Choose this option to enable CMA heaps with Ion. This heap is backed > + by the Contiguous Memory Allocator (CMA). If your system has these > + regions, you should say Y here. > diff --git a/drivers/staging/android/ion/Makefile b/drivers/staging/android/ion/Makefile > index 9457090..eef022b 100644 > --- a/drivers/staging/android/ion/Makefile > +++ b/drivers/staging/android/ion/Makefile > @@ -1,6 +1,8 @@ > -obj-$(CONFIG_ION) += ion.o ion-ioctl.o ion_heap.o \ > - ion_page_pool.o ion_system_heap.o \ > - ion_carveout_heap.o ion_chunk_heap.o ion_cma_heap.o > +obj-$(CONFIG_ION) += ion.o ion-ioctl.o ion_heap.o > +obj-$(CONFIG_ION_SYSTEM_HEAP) += ion_system_heap.o ion_page_pool.o > +obj-$(CONFIG_ION_CARVEOUT_HEAP) += ion_carveout_heap.o > +obj-$(CONFIG_ION_CHUNK_HEAP) += ion_chunk_heap.o > +obj-$(CONFIG_ION_CMA_HEAP) += ion_cma_heap.o > obj-$(CONFIG_ION_TEST) += ion_test.o > ifdef CONFIG_COMPAT > obj-$(CONFIG_ION) += compat_ion.o > diff --git a/drivers/staging/android/ion/ion_priv.h b/drivers/staging/android/ion/ion_priv.h > index b09bc7c..6eafe0d 100644 > --- a/drivers/staging/android/ion/ion_priv.h > +++ b/drivers/staging/android/ion/ion_priv.h > @@ -369,21 +369,68 @@ size_t ion_heap_freelist_size(struct ion_heap *heap); > * heaps as appropriate. > */ > > + > struct ion_heap *ion_heap_create(struct ion_platform_heap *heap_data); > void ion_heap_destroy(struct ion_heap *heap); > + > +#ifdef CONFIG_ION_SYSTEM_HEAP > struct ion_heap *ion_system_heap_create(struct ion_platform_heap *unused); > void ion_system_heap_destroy(struct ion_heap *heap); > - > struct ion_heap *ion_system_contig_heap_create(struct ion_platform_heap *heap); > void ion_system_contig_heap_destroy(struct ion_heap *heap); > - > +#else > +static inline struct ion_heap * ion_system_heap_create( > + struct ion_platform_heap *unused) > +{ > + return ERR_PTR(-ENODEV); > +} > +static inline void ion_system_heap_destroy(struct ion_heap *heap) { } > + > +static inline struct ion_heap *ion_system_contig_heap_create( > + struct ion_platform_heap *heap) > +{ > + return ERR_PTR(-ENODEV); > +} > + > +static inline void ion_system_contig_heap_destroy(struct ion_heap *heap) { } > +#endif > + > +#ifdef CONFIG_ION_CARVEOUT_HEAP > struct ion_heap *ion_carveout_heap_create(struct ion_platform_heap *heap_data); > void ion_carveout_heap_destroy(struct ion_heap *heap); > - > +#else > +static inline struct ion_heap *ion_carveout_heap_create( > + struct ion_platform_heap *heap_data) > +{ > + return ERR_PTR(-ENODEV); > +} > +static inline void ion_carveout_heap_destroy(struct ion_heap *heap) { } > +#endif > + > +#ifdef CONFIG_ION_CHUNK_HEAP > struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data); > void ion_chunk_heap_destroy(struct ion_heap *heap); > +#else > +static inline struct ion_heap *ion_chunk_heap_create( > + struct ion_platform_heap *heap_data) > +{ > + return ERR_PTR(-ENODEV); > +} > +static inline void ion_chunk_heap_destroy(struct ion_heap *heap) { } > + > +#endif > + > +#ifdef CONFIG_ION_CMA_HEAP > struct ion_heap *ion_cma_heap_create(struct ion_platform_heap *data); > void ion_cma_heap_destroy(struct ion_heap *heap); > +#else > +static inline struct ion_heap *ion_cma_heap_create( > + struct ion_platform_heap *data) > +{ > + return ERR_PTR(-ENODEV); > +} > +static inline void ion_cma_heap_destroy(struct ion_heap *heap) { } > +#endif > > /** > * functions for creating and destroying a heap pool -- allows you > -- > 2.7.4 > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo@kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: email@kvack.org -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wm0-f72.google.com (mail-wm0-f72.google.com [74.125.82.72]) by kanga.kvack.org (Postfix) with ESMTP id AA89E6B0038 for ; Fri, 3 Mar 2017 05:33:09 -0500 (EST) Received: by mail-wm0-f72.google.com with SMTP id u9so2162242wme.6 for ; Fri, 03 Mar 2017 02:33:09 -0800 (PST) Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com. [2a00:1450:400c:c0c::244]) by mx.google.com with ESMTPS id w5si14304622wrb.70.2017.03.03.02.33.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 03 Mar 2017 02:33:08 -0800 (PST) Received: by mail-wr0-x244.google.com with SMTP id u108so8809737wrb.2 for ; Fri, 03 Mar 2017 02:33:08 -0800 (PST) Date: Fri, 3 Mar 2017 11:33:04 +0100 From: Daniel Vetter Subject: Re: [RFC PATCH 11/12] staging: android: ion: Make Ion heaps selectable Message-ID: <20170303103304.nxfn7zlccx24b3xq@phenom.ffwll.local> References: <1488491084-17252-1-git-send-email-labbott@redhat.com> <1488491084-17252-12-git-send-email-labbott@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1488491084-17252-12-git-send-email-labbott@redhat.com> Sender: owner-linux-mm@kvack.org List-ID: To: Laura Abbott Cc: Sumit Semwal , Riley Andrews , arve@android.com, romlem@google.com, devel@driverdev.osuosl.org, linux-kernel@vger.kernel.org, linaro-mm-sig@lists.linaro.org, Greg Kroah-Hartman , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org, dri-devel@lists.freedesktop.org, Brian Starkey , Daniel Vetter , Mark Brown , Benjamin Gaignard , linux-mm@kvack.org On Thu, Mar 02, 2017 at 01:44:43PM -0800, Laura Abbott wrote: > > Currently, all heaps are compiled in all the time. In switching to > a better platform model, let's allow these to be compiled out for good > measure. > > Signed-off-by: Laura Abbott I'm not the biggest fan of making everything Kconfig-selectable. And the #ifdef stuff doesn't look all that pretty. If we'd also use this opportunity to split each heap into their own file I think this patch here would be a lot more useful. Anyway, no real opinion from me on this, just an idea. -Daniel > --- > drivers/staging/android/ion/Kconfig | 32 ++++++++++++++++++++ > drivers/staging/android/ion/Makefile | 8 +++-- > drivers/staging/android/ion/ion_priv.h | 53 ++++++++++++++++++++++++++++++++-- > 3 files changed, 87 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/android/ion/Kconfig b/drivers/staging/android/ion/Kconfig > index 0c91b2b..2e97990 100644 > --- a/drivers/staging/android/ion/Kconfig > +++ b/drivers/staging/android/ion/Kconfig > @@ -17,3 +17,35 @@ config ION_TEST > Choose this option to create a device that can be used to test the > kernel and device side ION functions. > > +config ION_SYSTEM_HEAP > + bool "Ion system heap" > + depends on ION > + help > + Choose this option to enable the Ion system heap. The system heap > + is backed by pages from the buddy allocator. If in doubt, say Y. > + > +config ION_CARVEOUT_HEAP > + bool "Ion carveout heap support" > + depends on ION > + help > + Choose this option to enable carveout heaps with Ion. Carveout heaps > + are backed by memory reserved from the system. Allocation times are > + typically faster at the cost of memory not being used. Unless you > + know your system has these regions, you should say N here. > + > +config ION_CHUNK_HEAP > + bool "Ion chunk heap support" > + depends on ION > + help > + Choose this option to enable chunk heaps with Ion. This heap is > + similar in function the carveout heap but memory is broken down > + into smaller chunk sizes, typically corresponding to a TLB size. > + Unless you know your system has these regions, you should say N here. > + > +config ION_CMA_HEAP > + bool "Ion CMA heap support" > + depends on ION && CMA > + help > + Choose this option to enable CMA heaps with Ion. This heap is backed > + by the Contiguous Memory Allocator (CMA). If your system has these > + regions, you should say Y here. > diff --git a/drivers/staging/android/ion/Makefile b/drivers/staging/android/ion/Makefile > index 9457090..eef022b 100644 > --- a/drivers/staging/android/ion/Makefile > +++ b/drivers/staging/android/ion/Makefile > @@ -1,6 +1,8 @@ > -obj-$(CONFIG_ION) += ion.o ion-ioctl.o ion_heap.o \ > - ion_page_pool.o ion_system_heap.o \ > - ion_carveout_heap.o ion_chunk_heap.o ion_cma_heap.o > +obj-$(CONFIG_ION) += ion.o ion-ioctl.o ion_heap.o > +obj-$(CONFIG_ION_SYSTEM_HEAP) += ion_system_heap.o ion_page_pool.o > +obj-$(CONFIG_ION_CARVEOUT_HEAP) += ion_carveout_heap.o > +obj-$(CONFIG_ION_CHUNK_HEAP) += ion_chunk_heap.o > +obj-$(CONFIG_ION_CMA_HEAP) += ion_cma_heap.o > obj-$(CONFIG_ION_TEST) += ion_test.o > ifdef CONFIG_COMPAT > obj-$(CONFIG_ION) += compat_ion.o > diff --git a/drivers/staging/android/ion/ion_priv.h b/drivers/staging/android/ion/ion_priv.h > index b09bc7c..6eafe0d 100644 > --- a/drivers/staging/android/ion/ion_priv.h > +++ b/drivers/staging/android/ion/ion_priv.h > @@ -369,21 +369,68 @@ size_t ion_heap_freelist_size(struct ion_heap *heap); > * heaps as appropriate. > */ > > + > struct ion_heap *ion_heap_create(struct ion_platform_heap *heap_data); > void ion_heap_destroy(struct ion_heap *heap); > + > +#ifdef CONFIG_ION_SYSTEM_HEAP > struct ion_heap *ion_system_heap_create(struct ion_platform_heap *unused); > void ion_system_heap_destroy(struct ion_heap *heap); > - > struct ion_heap *ion_system_contig_heap_create(struct ion_platform_heap *heap); > void ion_system_contig_heap_destroy(struct ion_heap *heap); > - > +#else > +static inline struct ion_heap * ion_system_heap_create( > + struct ion_platform_heap *unused) > +{ > + return ERR_PTR(-ENODEV); > +} > +static inline void ion_system_heap_destroy(struct ion_heap *heap) { } > + > +static inline struct ion_heap *ion_system_contig_heap_create( > + struct ion_platform_heap *heap) > +{ > + return ERR_PTR(-ENODEV); > +} > + > +static inline void ion_system_contig_heap_destroy(struct ion_heap *heap) { } > +#endif > + > +#ifdef CONFIG_ION_CARVEOUT_HEAP > struct ion_heap *ion_carveout_heap_create(struct ion_platform_heap *heap_data); > void ion_carveout_heap_destroy(struct ion_heap *heap); > - > +#else > +static inline struct ion_heap *ion_carveout_heap_create( > + struct ion_platform_heap *heap_data) > +{ > + return ERR_PTR(-ENODEV); > +} > +static inline void ion_carveout_heap_destroy(struct ion_heap *heap) { } > +#endif > + > +#ifdef CONFIG_ION_CHUNK_HEAP > struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data); > void ion_chunk_heap_destroy(struct ion_heap *heap); > +#else > +static inline struct ion_heap *ion_chunk_heap_create( > + struct ion_platform_heap *heap_data) > +{ > + return ERR_PTR(-ENODEV); > +} > +static inline void ion_chunk_heap_destroy(struct ion_heap *heap) { } > + > +#endif > + > +#ifdef CONFIG_ION_CMA_HEAP > struct ion_heap *ion_cma_heap_create(struct ion_platform_heap *data); > void ion_cma_heap_destroy(struct ion_heap *heap); > +#else > +static inline struct ion_heap *ion_cma_heap_create( > + struct ion_platform_heap *data) > +{ > + return ERR_PTR(-ENODEV); > +} > +static inline void ion_cma_heap_destroy(struct ion_heap *heap) { } > +#endif > > /** > * functions for creating and destroying a heap pool -- allows you > -- > 2.7.4 > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo@kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: email@kvack.org -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 From: daniel@ffwll.ch (Daniel Vetter) Date: Fri, 3 Mar 2017 11:33:04 +0100 Subject: [RFC PATCH 11/12] staging: android: ion: Make Ion heaps selectable In-Reply-To: <1488491084-17252-12-git-send-email-labbott@redhat.com> References: <1488491084-17252-1-git-send-email-labbott@redhat.com> <1488491084-17252-12-git-send-email-labbott@redhat.com> Message-ID: <20170303103304.nxfn7zlccx24b3xq@phenom.ffwll.local> To: linux-arm-kernel@lists.infradead.org List-Id: linux-arm-kernel.lists.infradead.org On Thu, Mar 02, 2017 at 01:44:43PM -0800, Laura Abbott wrote: > > Currently, all heaps are compiled in all the time. In switching to > a better platform model, let's allow these to be compiled out for good > measure. > > Signed-off-by: Laura Abbott I'm not the biggest fan of making everything Kconfig-selectable. And the #ifdef stuff doesn't look all that pretty. If we'd also use this opportunity to split each heap into their own file I think this patch here would be a lot more useful. Anyway, no real opinion from me on this, just an idea. -Daniel > --- > drivers/staging/android/ion/Kconfig | 32 ++++++++++++++++++++ > drivers/staging/android/ion/Makefile | 8 +++-- > drivers/staging/android/ion/ion_priv.h | 53 ++++++++++++++++++++++++++++++++-- > 3 files changed, 87 insertions(+), 6 deletions(-) > > diff --git a/drivers/staging/android/ion/Kconfig b/drivers/staging/android/ion/Kconfig > index 0c91b2b..2e97990 100644 > --- a/drivers/staging/android/ion/Kconfig > +++ b/drivers/staging/android/ion/Kconfig > @@ -17,3 +17,35 @@ config ION_TEST > Choose this option to create a device that can be used to test the > kernel and device side ION functions. > > +config ION_SYSTEM_HEAP > + bool "Ion system heap" > + depends on ION > + help > + Choose this option to enable the Ion system heap. The system heap > + is backed by pages from the buddy allocator. If in doubt, say Y. > + > +config ION_CARVEOUT_HEAP > + bool "Ion carveout heap support" > + depends on ION > + help > + Choose this option to enable carveout heaps with Ion. Carveout heaps > + are backed by memory reserved from the system. Allocation times are > + typically faster at the cost of memory not being used. Unless you > + know your system has these regions, you should say N here. > + > +config ION_CHUNK_HEAP > + bool "Ion chunk heap support" > + depends on ION > + help > + Choose this option to enable chunk heaps with Ion. This heap is > + similar in function the carveout heap but memory is broken down > + into smaller chunk sizes, typically corresponding to a TLB size. > + Unless you know your system has these regions, you should say N here. > + > +config ION_CMA_HEAP > + bool "Ion CMA heap support" > + depends on ION && CMA > + help > + Choose this option to enable CMA heaps with Ion. This heap is backed > + by the Contiguous Memory Allocator (CMA). If your system has these > + regions, you should say Y here. > diff --git a/drivers/staging/android/ion/Makefile b/drivers/staging/android/ion/Makefile > index 9457090..eef022b 100644 > --- a/drivers/staging/android/ion/Makefile > +++ b/drivers/staging/android/ion/Makefile > @@ -1,6 +1,8 @@ > -obj-$(CONFIG_ION) += ion.o ion-ioctl.o ion_heap.o \ > - ion_page_pool.o ion_system_heap.o \ > - ion_carveout_heap.o ion_chunk_heap.o ion_cma_heap.o > +obj-$(CONFIG_ION) += ion.o ion-ioctl.o ion_heap.o > +obj-$(CONFIG_ION_SYSTEM_HEAP) += ion_system_heap.o ion_page_pool.o > +obj-$(CONFIG_ION_CARVEOUT_HEAP) += ion_carveout_heap.o > +obj-$(CONFIG_ION_CHUNK_HEAP) += ion_chunk_heap.o > +obj-$(CONFIG_ION_CMA_HEAP) += ion_cma_heap.o > obj-$(CONFIG_ION_TEST) += ion_test.o > ifdef CONFIG_COMPAT > obj-$(CONFIG_ION) += compat_ion.o > diff --git a/drivers/staging/android/ion/ion_priv.h b/drivers/staging/android/ion/ion_priv.h > index b09bc7c..6eafe0d 100644 > --- a/drivers/staging/android/ion/ion_priv.h > +++ b/drivers/staging/android/ion/ion_priv.h > @@ -369,21 +369,68 @@ size_t ion_heap_freelist_size(struct ion_heap *heap); > * heaps as appropriate. > */ > > + > struct ion_heap *ion_heap_create(struct ion_platform_heap *heap_data); > void ion_heap_destroy(struct ion_heap *heap); > + > +#ifdef CONFIG_ION_SYSTEM_HEAP > struct ion_heap *ion_system_heap_create(struct ion_platform_heap *unused); > void ion_system_heap_destroy(struct ion_heap *heap); > - > struct ion_heap *ion_system_contig_heap_create(struct ion_platform_heap *heap); > void ion_system_contig_heap_destroy(struct ion_heap *heap); > - > +#else > +static inline struct ion_heap * ion_system_heap_create( > + struct ion_platform_heap *unused) > +{ > + return ERR_PTR(-ENODEV); > +} > +static inline void ion_system_heap_destroy(struct ion_heap *heap) { } > + > +static inline struct ion_heap *ion_system_contig_heap_create( > + struct ion_platform_heap *heap) > +{ > + return ERR_PTR(-ENODEV); > +} > + > +static inline void ion_system_contig_heap_destroy(struct ion_heap *heap) { } > +#endif > + > +#ifdef CONFIG_ION_CARVEOUT_HEAP > struct ion_heap *ion_carveout_heap_create(struct ion_platform_heap *heap_data); > void ion_carveout_heap_destroy(struct ion_heap *heap); > - > +#else > +static inline struct ion_heap *ion_carveout_heap_create( > + struct ion_platform_heap *heap_data) > +{ > + return ERR_PTR(-ENODEV); > +} > +static inline void ion_carveout_heap_destroy(struct ion_heap *heap) { } > +#endif > + > +#ifdef CONFIG_ION_CHUNK_HEAP > struct ion_heap *ion_chunk_heap_create(struct ion_platform_heap *heap_data); > void ion_chunk_heap_destroy(struct ion_heap *heap); > +#else > +static inline struct ion_heap *ion_chunk_heap_create( > + struct ion_platform_heap *heap_data) > +{ > + return ERR_PTR(-ENODEV); > +} > +static inline void ion_chunk_heap_destroy(struct ion_heap *heap) { } > + > +#endif > + > +#ifdef CONFIG_ION_CMA_HEAP > struct ion_heap *ion_cma_heap_create(struct ion_platform_heap *data); > void ion_cma_heap_destroy(struct ion_heap *heap); > +#else > +static inline struct ion_heap *ion_cma_heap_create( > + struct ion_platform_heap *data) > +{ > + return ERR_PTR(-ENODEV); > +} > +static inline void ion_cma_heap_destroy(struct ion_heap *heap) { } > +#endif > > /** > * functions for creating and destroying a heap pool -- allows you > -- > 2.7.4 > > -- > To unsubscribe, send a message with 'unsubscribe linux-mm' in > the body to majordomo at kvack.org. For more info on Linux MM, > see: http://www.linux-mm.org/ . > Don't email: email at kvack.org -- Daniel Vetter Software Engineer, Intel Corporation http://blog.ffwll.ch From mboxrd@z Thu Jan 1 00:00:00 1970 From: Daniel Vetter Subject: Re: [RFC PATCH 11/12] staging: android: ion: Make Ion heaps selectable Date: Fri, 3 Mar 2017 11:33:04 +0100 Message-ID: <20170303103304.nxfn7zlccx24b3xq@phenom.ffwll.local> References: <1488491084-17252-1-git-send-email-labbott@redhat.com> <1488491084-17252-12-git-send-email-labbott@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: base64 Return-path: Received: from mail-wr0-x244.google.com (mail-wr0-x244.google.com [IPv6:2a00:1450:400c:c0c::244]) by gabe.freedesktop.org (Postfix) with ESMTPS id 6B0A96E021 for ; Fri, 3 Mar 2017 10:33:09 +0000 (UTC) Received: by mail-wr0-x244.google.com with SMTP id u108so8809739wrb.2 for ; Fri, 03 Mar 2017 02:33:09 -0800 (PST) Content-Disposition: inline In-Reply-To: <1488491084-17252-12-git-send-email-labbott@redhat.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" To: Laura Abbott Cc: devel@driverdev.osuosl.org, romlem@google.com, Greg Kroah-Hartman , arve@android.com, dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org, linaro-mm-sig@lists.linaro.org, linux-mm@kvack.org, Riley Andrews , Mark Brown , Daniel Vetter , linux-arm-kernel@lists.infradead.org, linux-media@vger.kernel.org List-Id: dri-devel@lists.freedesktop.org T24gVGh1LCBNYXIgMDIsIDIwMTcgYXQgMDE6NDQ6NDNQTSAtMDgwMCwgTGF1cmEgQWJib3R0IHdy b3RlOgo+IAo+IEN1cnJlbnRseSwgYWxsIGhlYXBzIGFyZSBjb21waWxlZCBpbiBhbGwgdGhlIHRp bWUuIEluIHN3aXRjaGluZyB0bwo+IGEgYmV0dGVyIHBsYXRmb3JtIG1vZGVsLCBsZXQncyBhbGxv dyB0aGVzZSB0byBiZSBjb21waWxlZCBvdXQgZm9yIGdvb2QKPiBtZWFzdXJlLgo+IAo+IFNpZ25l ZC1vZmYtYnk6IExhdXJhIEFiYm90dCA8bGFiYm90dEByZWRoYXQuY29tPgoKSSdtIG5vdCB0aGUg YmlnZ2VzdCBmYW4gb2YgbWFraW5nIGV2ZXJ5dGhpbmcgS2NvbmZpZy1zZWxlY3RhYmxlLiBBbmQg dGhlCiNpZmRlZiBzdHVmZiBkb2Vzbid0IGxvb2sgYWxsIHRoYXQgcHJldHR5LiBJZiB3ZSdkIGFs c28gdXNlIHRoaXMKb3Bwb3J0dW5pdHkgdG8gc3BsaXQgZWFjaCBoZWFwIGludG8gdGhlaXIgb3du IGZpbGUgSSB0aGluayB0aGlzIHBhdGNoIGhlcmUKd291bGQgYmUgYSBsb3QgbW9yZSB1c2VmdWwu CgpBbnl3YXksIG5vIHJlYWwgb3BpbmlvbiBmcm9tIG1lIG9uIHRoaXMsIGp1c3QgYW4gaWRlYS4K LURhbmllbAoKPiAtLS0KPiAgZHJpdmVycy9zdGFnaW5nL2FuZHJvaWQvaW9uL0tjb25maWcgICAg fCAzMiArKysrKysrKysrKysrKysrKysrKwo+ICBkcml2ZXJzL3N0YWdpbmcvYW5kcm9pZC9pb24v TWFrZWZpbGUg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