msm: camera: memmgr: Add dma-buf-heaps usage in camera

Use dma-buf-heaps for allocating buffers. Keep ion usage
to support kernels without dma-buf-heaps support.

CRs-Fixed: 2852327
Change-Id: I3ebcb591827d9b8e5366f716efd08e4cd6f1070a
Signed-off-by: Pavan Kumar Chilamkurthi <pchilamk@codeaurora.org>
This commit is contained in:
Pavan Kumar Chilamkurthi
2020-11-23 01:58:38 -08:00
parent 7f497cf736
commit 68eda98831
3 changed files with 239 additions and 12 deletions

View File

@@ -1,6 +1,6 @@
/* SPDX-License-Identifier: GPL-2.0-only */
/*
* Copyright (c) 2016-2020, The Linux Foundation. All rights reserved.
* Copyright (c) 2016-2021, The Linux Foundation. All rights reserved.
*/
#ifndef _CAM_MEM_MGR_H_
@@ -8,6 +8,9 @@
#include <linux/mutex.h>
#include <linux/dma-buf.h>
#if IS_REACHABLE(CONFIG_DMABUF_HEAPS)
#include <linux/dma-heap.h>
#endif
#include <media/cam_req_mgr.h>
#include "cam_mem_mgr_api.h"
@@ -81,6 +84,14 @@ struct cam_mem_table {
bool alloc_profile_enable;
size_t dbg_buf_idx;
bool force_cache_allocs;
#if IS_REACHABLE(CONFIG_DMABUF_HEAPS)
struct dma_heap *system_heap;
struct dma_heap *system_uncached_heap;
struct dma_heap *camera_heap;
struct dma_heap *camera_uncached_heap;
struct dma_heap *secure_display_heap;
#endif
};
/**