/* * Copyright (c) Hisilicon Technologies Co., Ltd.. 2018-2019. All rights reserved. * Description: Gralloc * Author: Hisilicon * Created: 2019.11.07 */ #ifndef GRALLOC_ION_H_ #define GRALLOC_ION_H_ #include "gralloc_internal_priv.h" #include "gralloc_descriptor.h" #ifndef GRALLOC_NEED_SMMU_MAP /* defined in linux-4.14.y/drivers/staging/android/uapi/ion.h. if heap is ION_HEAP_SYSTEM, it need to call ion_map_iommu to get smmu address */ enum ion_heap_type_ext { ION_HEAP_ID_CMA = 15, /* ION_HEAP_ID_CMA(15) is ext heap */ ION_HEAP_ID_SMMU, ION_HEAP_ID_SEC_SMMU, ION_HEAP_ID_SEC_CMA, }; #define ION_HEAP_SMMU_MASK (1 << ION_HEAP_ID_SMMU) #define ION_HEAP_SEC_SMMU_MASK (1 << ION_HEAP_ID_SEC_SMMU) #endif int gralloc_ion_device_open(private_module_t *m); int gralloc_ion_device_close(struct hw_device_t *device); int gralloc_ion_allocate(const private_module_t *m, const buffer_descriptor_t *descriptors, private_internal_handle_t *handle); void gralloc_ion_free(const private_module_t *m, private_internal_handle_t *handle); int gralloc_ion_map(const private_module_t *m, private_internal_handle_t *handle); int gralloc_ion_unmap(const private_module_t *m, private_internal_handle_t *handle); int gralloc_ion_sync(const private_module_t *m, const private_internal_handle_t *handle); int gralloc_dmabuf_sync(const private_internal_handle_t *handle, bool start); #endif /* GRALLOC_ION_H_ */