Loading drivers/cam_req_mgr/cam_mem_mgr.c +5 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. */ #include <linux/module.h> Loading Loading @@ -703,6 +703,9 @@ int cam_mem_mgr_alloc_and_map(struct cam_mem_mgr_alloc_cmd *cmd) } } if (cmd->flags & CAM_MEM_FLAG_KMD_DEBUG_FLAG) tbl.dbg_buf_idx = idx; tbl.bufq[idx].kmdvaddr = kvaddr; tbl.bufq[idx].vaddr = hw_vaddr; tbl.bufq[idx].dma_buf = dmabuf; Loading Loading @@ -959,6 +962,7 @@ void cam_mem_mgr_deinit(void) bitmap_zero(tbl.bitmap, tbl.bits); kfree(tbl.bitmap); tbl.bitmap = NULL; tbl.dbg_buf_idx = -1; mutex_unlock(&tbl.m_lock); mutex_destroy(&tbl.m_lock); } Loading drivers/cam_req_mgr/cam_mem_mgr.h +3 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. */ #ifndef _CAM_MEM_MGR_H_ Loading Loading @@ -67,6 +67,7 @@ struct cam_mem_buf_queue { * @bufq: array of buffers * @dentry: Debugfs entry * @alloc_profile_enable: Whether to enable alloc profiling * @dbg_buf_idx: debug buffer index to get usecases info */ struct cam_mem_table { struct mutex m_lock; Loading @@ -75,6 +76,7 @@ struct cam_mem_table { struct cam_mem_buf_queue bufq[CAM_MEM_BUFQ_MAX]; struct dentry *dentry; bool alloc_profile_enable; size_t dbg_buf_idx; }; /** Loading include/uapi/media/cam_req_mgr.h +2 −0 Original line number Diff line number Diff line Loading @@ -280,6 +280,8 @@ struct cam_req_mgr_link_control { #define CAM_MEM_FLAG_HW_SHARED_ACCESS (1<<11) #define CAM_MEM_FLAG_CDSP_OUTPUT (1<<12) #define CAM_MEM_FLAG_DISABLE_DELAYED_UNMAP (1<<13) #define CAM_MEM_FLAG_KMD_DEBUG_FLAG (1<<14) #define CAM_MEM_MMU_MAX_HANDLE 16 Loading Loading
drivers/cam_req_mgr/cam_mem_mgr.c +5 −1 Original line number Diff line number Diff line // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. */ #include <linux/module.h> Loading Loading @@ -703,6 +703,9 @@ int cam_mem_mgr_alloc_and_map(struct cam_mem_mgr_alloc_cmd *cmd) } } if (cmd->flags & CAM_MEM_FLAG_KMD_DEBUG_FLAG) tbl.dbg_buf_idx = idx; tbl.bufq[idx].kmdvaddr = kvaddr; tbl.bufq[idx].vaddr = hw_vaddr; tbl.bufq[idx].dma_buf = dmabuf; Loading Loading @@ -959,6 +962,7 @@ void cam_mem_mgr_deinit(void) bitmap_zero(tbl.bitmap, tbl.bits); kfree(tbl.bitmap); tbl.bitmap = NULL; tbl.dbg_buf_idx = -1; mutex_unlock(&tbl.m_lock); mutex_destroy(&tbl.m_lock); } Loading
drivers/cam_req_mgr/cam_mem_mgr.h +3 −1 Original line number Diff line number Diff line /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2016-2019, The Linux Foundation. All rights reserved. * Copyright (c) 2016-2020, The Linux Foundation. All rights reserved. */ #ifndef _CAM_MEM_MGR_H_ Loading Loading @@ -67,6 +67,7 @@ struct cam_mem_buf_queue { * @bufq: array of buffers * @dentry: Debugfs entry * @alloc_profile_enable: Whether to enable alloc profiling * @dbg_buf_idx: debug buffer index to get usecases info */ struct cam_mem_table { struct mutex m_lock; Loading @@ -75,6 +76,7 @@ struct cam_mem_table { struct cam_mem_buf_queue bufq[CAM_MEM_BUFQ_MAX]; struct dentry *dentry; bool alloc_profile_enable; size_t dbg_buf_idx; }; /** Loading
include/uapi/media/cam_req_mgr.h +2 −0 Original line number Diff line number Diff line Loading @@ -280,6 +280,8 @@ struct cam_req_mgr_link_control { #define CAM_MEM_FLAG_HW_SHARED_ACCESS (1<<11) #define CAM_MEM_FLAG_CDSP_OUTPUT (1<<12) #define CAM_MEM_FLAG_DISABLE_DELAYED_UNMAP (1<<13) #define CAM_MEM_FLAG_KMD_DEBUG_FLAG (1<<14) #define CAM_MEM_MMU_MAX_HANDLE 16 Loading