msm: camera: memmgr: Add presil memory API implementation

Add code for dmabuf, fd conversion and copying all buffers
using presil framework APIs.

CRs-Fixed: 2932495
Change-Id: Icfb6dc1a3326ea8214a71fd39871a8583a6e902c
Signed-off-by: Suraj Dongre <sdongre@codeaurora.org>
Signed-off-by: Mukund Madhusudan Atre <matre@codeaurora.org>
This commit is contained in:
Suraj Dongre
2021-06-07 16:03:21 -07:00
committed by Gerrit - the friendly Code Review server
父節點 9b31a3dc93
當前提交 37de6613a8
共有 2 個文件被更改,包括 308 次插入18 次删除

查看文件

@@ -26,25 +26,33 @@ enum cam_smmu_mapping_client {
CAM_SMMU_MAPPING_KERNEL,
};
#ifdef CONFIG_CAM_PRESIL
struct cam_presil_dmabuf_params {
int32_t fd_for_umd_daemon;
uint32_t refcount;
};
#endif
/**
* struct cam_mem_buf_queue
*
* @dma_buf: pointer to the allocated dma_buf in the table
* @q_lock: mutex lock for buffer
* @hdls: list of mapped handles
* @num_hdl: number of handles
* @fd: file descriptor of buffer
* @i_ino: inode number of this dmabuf. Uniquely identifies a buffer
* @buf_handle: unique handle for buffer
* @align: alignment for allocation
* @len: size of buffer
* @flags: attributes of buffer
* @vaddr: IOVA of buffer
* @kmdvaddr: Kernel virtual address
* @active: state of the buffer
* @is_imported: Flag indicating if buffer is imported from an FD in user space
* @is_internal: Flag indicating kernel allocated buffer
* @timestamp: Timestamp at which this entry in tbl was made
* @dma_buf: pointer to the allocated dma_buf in the table
* @q_lock: mutex lock for buffer
* @hdls: list of mapped handles
* @num_hdl: number of handles
* @fd: file descriptor of buffer
* @i_ino: inode number of this dmabuf. Uniquely identifies a buffer
* @buf_handle: unique handle for buffer
* @align: alignment for allocation
* @len: size of buffer
* @flags: attributes of buffer
* @vaddr: IOVA of buffer
* @kmdvaddr: Kernel virtual address
* @active: state of the buffer
* @is_imported: Flag indicating if buffer is imported from an FD in user space
* @is_internal: Flag indicating kernel allocated buffer
* @timestamp: Timestamp at which this entry in tbl was made
* @presil_params: Parameters specific to presil environment
*/
struct cam_mem_buf_queue {
struct dma_buf *dma_buf;
@@ -63,6 +71,10 @@ struct cam_mem_buf_queue {
bool is_imported;
bool is_internal;
struct timespec64 timestamp;
#ifdef CONFIG_CAM_PRESIL
struct cam_presil_dmabuf_params presil_params;
#endif
};
/**