msm: camera: mem_mgr: Add refcount to track in use buffers

The function cam_mem_mgr_release can unmap the buffers when in use.

This change prevents unmapping the buffers when in use.

CRs-Fixed: 3489559
Change-Id: I2e72e795d39ac15abfa56c19043c419a03686966
Signed-off-by: Shivakumar Malke <quic_smalke@quicinc.com>
This commit is contained in:
Shivakumar Malke
2023-05-19 11:52:42 +05:30
committed by Camera Software Integration
父節點 87913e552d
當前提交 6d99262523
共有 24 個文件被更改,包括 361 次插入58 次删除

查看文件

@@ -80,6 +80,9 @@ struct cam_mem_buf_hw_hdl_info {
* @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
* @krefcount: Reference counter to track whether the buffer is
* mapped and in use
* @smmu_mapping_client: Client buffer (User or kernel)
* @presil_params: Parameters specific to presil environment
*/
struct cam_mem_buf_queue {
@@ -98,6 +101,8 @@ struct cam_mem_buf_queue {
bool is_imported;
bool is_internal;
struct timespec64 timestamp;
struct kref krefcount;
enum cam_smmu_mapping_client smmu_mapping_client;
#ifdef CONFIG_CAM_PRESIL
struct cam_presil_dmabuf_params presil_params;