Loading drivers/cam_req_mgr/cam_mem_mgr.c +7 −55 Original line number Diff line number Diff line Loading @@ -22,39 +22,6 @@ static struct cam_mem_table tbl; static atomic_t cam_mem_mgr_state = ATOMIC_INIT(CAM_MEM_MGR_UNINITIALIZED); static void cam_mem_mgr_print_tbl(void) { int i; uint64_t ms, tmp, hrs, min, sec; struct timespec64 *ts = NULL; struct timespec64 current_ts; ktime_get_real_ts64(&(current_ts)); tmp = current_ts.tv_sec; ms = (current_ts.tv_nsec) / 1000000; sec = do_div(tmp, 60); min = do_div(tmp, 60); hrs = do_div(tmp, 24); CAM_INFO(CAM_MEM, "***%llu:%llu:%llu:%llu Mem mgr table dump***", hrs, min, sec, ms); for (i = 1; i < CAM_MEM_BUFQ_MAX; i++) { if (tbl.bufq[i].active) { ts = &tbl.bufq[i].timestamp; tmp = ts->tv_sec; ms = (ts->tv_nsec) / 1000000; sec = do_div(tmp, 60); min = do_div(tmp, 60); hrs = do_div(tmp, 24); CAM_INFO(CAM_MEM, "%llu:%llu:%llu:%llu idx %d fd %d size %llu", hrs, min, sec, ms, i, tbl.bufq[i].fd, tbl.bufq[i].len); } } } static int cam_mem_util_get_dma_dir(uint32_t flags) { int rc = -EINVAL; Loading Loading @@ -218,7 +185,6 @@ static int32_t cam_mem_get_slot(void) set_bit(idx, tbl.bitmap); tbl.bufq[idx].active = true; ktime_get_real_ts64(&(tbl.bufq[idx].timestamp)); mutex_init(&tbl.bufq[idx].q_lock); mutex_unlock(&tbl.m_lock); Loading @@ -230,7 +196,6 @@ static void cam_mem_put_slot(int32_t idx) mutex_lock(&tbl.m_lock); mutex_lock(&tbl.bufq[idx].q_lock); tbl.bufq[idx].active = false; memset(&tbl.bufq[idx].timestamp, 0, sizeof(struct timespec64)); mutex_unlock(&tbl.bufq[idx].q_lock); mutex_destroy(&tbl.bufq[idx].q_lock); clear_bit(idx, tbl.bitmap); Loading Loading @@ -678,7 +643,6 @@ int cam_mem_mgr_alloc_and_map(struct cam_mem_mgr_alloc_cmd *cmd) CAM_ERR(CAM_MEM, "Ion Alloc failed, len=%llu, align=%llu, flags=0x%x, num_hdl=%d", cmd->len, cmd->align, cmd->flags, cmd->num_hdl); cam_mem_mgr_print_tbl(); return rc; } Loading Loading @@ -715,14 +679,9 @@ int cam_mem_mgr_alloc_and_map(struct cam_mem_mgr_alloc_cmd *cmd) if (rc) { CAM_ERR(CAM_MEM, "Failed in map_hw_va, [Size cmdlen=%llu dma %llu smmu %llu], flags=0x%x, fd=%d, region=%d, num_hdl=%d, rc=%d", cmd->len, dmabuf->size, len, cmd->flags, fd, region, cmd->num_hdl, rc); if (rc == -EALREADY) { if ((size_t)dmabuf->size != len) rc = -EBADR; cam_mem_mgr_print_tbl(); } "Failed in map_hw_va, len=%llu, flags=0x%x, fd=%d, region=%d, num_hdl=%d, rc=%d", cmd->len, cmd->flags, fd, region, cmd->num_hdl, rc); goto map_hw_fail; } } Loading Loading @@ -821,15 +780,9 @@ int cam_mem_mgr_map(struct cam_mem_mgr_map_cmd *cmd) CAM_SMMU_REGION_IO); if (rc) { CAM_ERR(CAM_MEM, "Failed in map_hw_va, flags=0x%x, fd=%d, [Size smmu %llu dma %llu], region=%d, num_hdl=%d, rc=%d", cmd->flags, cmd->fd, len, dmabuf->size, CAM_SMMU_REGION_IO, cmd->num_hdl, rc); if (rc == -EALREADY) { if ((size_t)dmabuf->size != len) { rc = -EBADR; cam_mem_mgr_print_tbl(); } } "Failed in map_hw_va, flags=0x%x, fd=%d, region=%d, num_hdl=%d, rc=%d", cmd->flags, cmd->fd, CAM_SMMU_REGION_IO, cmd->num_hdl, rc); goto map_fail; } } Loading Loading @@ -864,7 +817,7 @@ int cam_mem_mgr_map(struct cam_mem_mgr_map_cmd *cmd) cmd->out.buf_handle = tbl.bufq[idx].buf_handle; cmd->out.vaddr = 0; cmd->out.size = (uint32_t)len; CAM_DBG(CAM_MEM, "fd=%d, flags=0x%x, num_hdl=%d, idx=%d, buf handle=%x, len=%zu", cmd->fd, cmd->flags, cmd->num_hdl, idx, cmd->out.buf_handle, Loading Loading @@ -1084,7 +1037,6 @@ static int cam_mem_util_unmap(int32_t idx, tbl.bufq[idx].len = 0; tbl.bufq[idx].num_hdl = 0; tbl.bufq[idx].active = false; memset(&tbl.bufq[idx].timestamp, 0, sizeof(struct timespec64)); mutex_unlock(&tbl.bufq[idx].q_lock); mutex_destroy(&tbl.bufq[idx].q_lock); clear_bit(idx, tbl.bitmap); Loading drivers/cam_req_mgr/cam_mem_mgr.h +0 −2 Original line number Diff line number Diff line Loading @@ -41,7 +41,6 @@ enum cam_smmu_mapping_client { * @kmdvaddr: Kernel virtual address * @active: state of the buffer * @is_imported: Flag indicating if buffer is imported from an FD in user space * @timestamp: Timestamp at which this entry in tbl was made */ struct cam_mem_buf_queue { struct dma_buf *dma_buf; Loading @@ -57,7 +56,6 @@ struct cam_mem_buf_queue { uintptr_t kmdvaddr; bool active; bool is_imported; struct timespec64 timestamp; }; /** Loading drivers/cam_smmu/cam_smmu_api.c +12 −50 Original line number Diff line number Diff line Loading @@ -196,7 +196,6 @@ struct cam_dma_buff_info { int ion_fd; size_t len; size_t phys_len; struct timespec64 ts; }; struct cam_sec_buff_info { Loading Loading @@ -402,9 +401,6 @@ static void cam_smmu_dump_cb_info(int idx) size_t shared_reg_len = 0, io_reg_len = 0; size_t shared_free_len = 0, io_free_len = 0; uint32_t i = 0; uint64_t ms, tmp, hrs, min, sec; struct timespec64 *ts = NULL; struct timespec64 current_ts; struct cam_context_bank_info *cb_info = &iommu_cb_set.cb_info[idx]; Loading @@ -418,15 +414,9 @@ static void cam_smmu_dump_cb_info(int idx) io_free_len = io_reg_len - cb_info->io_mapping_size; } ktime_get_real_ts64(&(current_ts)); tmp = current_ts.tv_sec; ms = (current_ts.tv_nsec) / 1000000; sec = do_div(tmp, 60); min = do_div(tmp, 60); hrs = do_div(tmp, 24); CAM_ERR(CAM_SMMU, "********** %llu:%llu:%llu:%llu Context bank dump for %s **********", hrs, min, sec, ms, cb_info->name); "********** Context bank dump for %s **********", cb_info->name); CAM_ERR(CAM_SMMU, "Usage: shared_usage=%u io_usage=%u shared_free=%u io_free=%u", (unsigned int)cb_info->shared_mapping_size, Loading @@ -438,16 +428,9 @@ static void cam_smmu_dump_cb_info(int idx) list_for_each_entry_safe(mapping, mapping_temp, &iommu_cb_set.cb_info[idx].smmu_buf_list, list) { i++; ts = &mapping->ts; tmp = ts->tv_sec; ms = (ts->tv_nsec) / 1000000; sec = do_div(tmp, 60); min = do_div(tmp, 60); hrs = do_div(tmp, 24); CAM_ERR(CAM_SMMU, "%llu:%llu:%llu:%llu: %u ion_fd=%d start=0x%x end=0x%x len=%u region=%d", hrs, min, sec, ms, i, mapping->ion_fd, (void *)mapping->paddr, "%u. ion_fd=%d start=0x%x end=0x%x len=%u region=%d", i, mapping->ion_fd, (void *)mapping->paddr, ((uint64_t)mapping->paddr + (uint64_t)mapping->len), (unsigned int)mapping->len, Loading Loading @@ -2016,7 +1999,6 @@ static int cam_smmu_map_buffer_and_add_to_list(int idx, int ion_fd, } mapping_info->ion_fd = ion_fd; ktime_get_real_ts64(&mapping_info->ts); /* add to the list */ list_add(&mapping_info->list, &iommu_cb_set.cb_info[idx].smmu_buf_list); Loading Loading @@ -2044,7 +2026,7 @@ static int cam_smmu_map_kernel_buffer_and_add_to_list(int idx, } mapping_info->ion_fd = -1; ktime_get_real_ts64(&mapping_info->ts); /* add to the list */ list_add(&mapping_info->list, &iommu_cb_set.cb_info[idx].smmu_buf_kernel_list); Loading Loading @@ -2142,28 +2124,15 @@ static int cam_smmu_unmap_buf_and_remove_from_list( } static enum cam_smmu_buf_state cam_smmu_check_fd_in_list(int idx, int ion_fd, dma_addr_t *paddr_ptr, size_t *len_ptr, size_t *dma_buf_len) int ion_fd, dma_addr_t *paddr_ptr, size_t *len_ptr) { struct cam_dma_buff_info *mapping; struct timespec64 *ts = NULL; uint64_t ms, tmp, hrs, min, sec; list_for_each_entry(mapping, &iommu_cb_set.cb_info[idx].smmu_buf_list, list) { if (mapping->ion_fd == ion_fd) { *paddr_ptr = mapping->paddr; *len_ptr = mapping->len; *dma_buf_len = mapping->buf->size; ts = &mapping->ts; tmp = ts->tv_sec; ms = (ts->tv_nsec) / 1000000; sec = do_div(tmp, 60); min = do_div(tmp, 60); hrs = do_div(tmp, 24); CAM_WARN(CAM_SMMU, "Mapping found ts %llu:%llu:%llu:%llu paddr 0x%p len %llu dma_len %llu", hrs, min, sec, ms, (void *)mapping->paddr, mapping->len, *dma_buf_len); return CAM_SMMU_BUFF_EXIST; } } Loading Loading @@ -2894,7 +2863,6 @@ int cam_smmu_map_user_iova(int handle, int ion_fd, bool dis_delayed_unmap, size_t *len_ptr, enum cam_smmu_region_id region_id) { int idx, rc = 0; size_t dma_len = 0; enum cam_smmu_buf_state buf_state; enum dma_data_direction dma_dir; Loading Loading @@ -2932,14 +2900,11 @@ int cam_smmu_map_user_iova(int handle, int ion_fd, bool dis_delayed_unmap, goto get_addr_end; } buf_state = cam_smmu_check_fd_in_list(idx, ion_fd, paddr_ptr, len_ptr, &dma_len); buf_state = cam_smmu_check_fd_in_list(idx, ion_fd, paddr_ptr, len_ptr); if (buf_state == CAM_SMMU_BUFF_EXIST) { CAM_ERR(CAM_SMMU, "fd:%d already in list cb:%s idx:%d handle=%d len=%llu dma_len=%llu, give same addr back", ion_fd, iommu_cb_set.cb_info[idx].name, idx, handle, *len_ptr, dma_len); *len_ptr = dma_len; "fd:%d already in list idx:%d, handle=%d, give same addr back", ion_fd, idx, handle); rc = -EALREADY; goto get_addr_end; } Loading @@ -2948,9 +2913,8 @@ int cam_smmu_map_user_iova(int handle, int ion_fd, bool dis_delayed_unmap, dis_delayed_unmap, dma_dir, paddr_ptr, len_ptr, region_id); if (rc < 0) { CAM_ERR(CAM_SMMU, "mapping or add list fail cb:%s idx=%d, fd=%d, region=%d, rc=%d", iommu_cb_set.cb_info[idx].name, idx, ion_fd, region_id, rc); "mapping or add list fail, idx=%d, fd=%d, region=%d, rc=%d", idx, ion_fd, region_id, rc); cam_smmu_dump_cb_info(idx); } Loading Loading @@ -3024,7 +2988,6 @@ int cam_smmu_get_iova(int handle, int ion_fd, dma_addr_t *paddr_ptr, size_t *len_ptr) { int idx, rc = 0; size_t dma_buf_size = 0; enum cam_smmu_buf_state buf_state; if (!paddr_ptr || !len_ptr) { Loading Loading @@ -3064,8 +3027,7 @@ int cam_smmu_get_iova(int handle, int ion_fd, goto get_addr_end; } buf_state = cam_smmu_check_fd_in_list(idx, ion_fd, paddr_ptr, len_ptr, &dma_buf_size); buf_state = cam_smmu_check_fd_in_list(idx, ion_fd, paddr_ptr, len_ptr); if (buf_state == CAM_SMMU_BUFF_NOT_EXIST) { CAM_ERR(CAM_SMMU, "ion_fd:%d not in the mapped list", ion_fd); rc = -EINVAL; Loading include/uapi/media/cam_req_mgr.h +2 −2 Original line number Diff line number Diff line Loading @@ -341,12 +341,12 @@ struct cam_mem_alloc_out_params { /** * struct cam_mem_map_out_params * @buf_handle: buffer handle * @size: size of the buffer being mapped * @reserved: reserved for future * @vaddr: virtual address pointer */ struct cam_mem_map_out_params { uint32_t buf_handle; uint32_t size; uint32_t reserved; uint64_t vaddr; }; Loading Loading
drivers/cam_req_mgr/cam_mem_mgr.c +7 −55 Original line number Diff line number Diff line Loading @@ -22,39 +22,6 @@ static struct cam_mem_table tbl; static atomic_t cam_mem_mgr_state = ATOMIC_INIT(CAM_MEM_MGR_UNINITIALIZED); static void cam_mem_mgr_print_tbl(void) { int i; uint64_t ms, tmp, hrs, min, sec; struct timespec64 *ts = NULL; struct timespec64 current_ts; ktime_get_real_ts64(&(current_ts)); tmp = current_ts.tv_sec; ms = (current_ts.tv_nsec) / 1000000; sec = do_div(tmp, 60); min = do_div(tmp, 60); hrs = do_div(tmp, 24); CAM_INFO(CAM_MEM, "***%llu:%llu:%llu:%llu Mem mgr table dump***", hrs, min, sec, ms); for (i = 1; i < CAM_MEM_BUFQ_MAX; i++) { if (tbl.bufq[i].active) { ts = &tbl.bufq[i].timestamp; tmp = ts->tv_sec; ms = (ts->tv_nsec) / 1000000; sec = do_div(tmp, 60); min = do_div(tmp, 60); hrs = do_div(tmp, 24); CAM_INFO(CAM_MEM, "%llu:%llu:%llu:%llu idx %d fd %d size %llu", hrs, min, sec, ms, i, tbl.bufq[i].fd, tbl.bufq[i].len); } } } static int cam_mem_util_get_dma_dir(uint32_t flags) { int rc = -EINVAL; Loading Loading @@ -218,7 +185,6 @@ static int32_t cam_mem_get_slot(void) set_bit(idx, tbl.bitmap); tbl.bufq[idx].active = true; ktime_get_real_ts64(&(tbl.bufq[idx].timestamp)); mutex_init(&tbl.bufq[idx].q_lock); mutex_unlock(&tbl.m_lock); Loading @@ -230,7 +196,6 @@ static void cam_mem_put_slot(int32_t idx) mutex_lock(&tbl.m_lock); mutex_lock(&tbl.bufq[idx].q_lock); tbl.bufq[idx].active = false; memset(&tbl.bufq[idx].timestamp, 0, sizeof(struct timespec64)); mutex_unlock(&tbl.bufq[idx].q_lock); mutex_destroy(&tbl.bufq[idx].q_lock); clear_bit(idx, tbl.bitmap); Loading Loading @@ -678,7 +643,6 @@ int cam_mem_mgr_alloc_and_map(struct cam_mem_mgr_alloc_cmd *cmd) CAM_ERR(CAM_MEM, "Ion Alloc failed, len=%llu, align=%llu, flags=0x%x, num_hdl=%d", cmd->len, cmd->align, cmd->flags, cmd->num_hdl); cam_mem_mgr_print_tbl(); return rc; } Loading Loading @@ -715,14 +679,9 @@ int cam_mem_mgr_alloc_and_map(struct cam_mem_mgr_alloc_cmd *cmd) if (rc) { CAM_ERR(CAM_MEM, "Failed in map_hw_va, [Size cmdlen=%llu dma %llu smmu %llu], flags=0x%x, fd=%d, region=%d, num_hdl=%d, rc=%d", cmd->len, dmabuf->size, len, cmd->flags, fd, region, cmd->num_hdl, rc); if (rc == -EALREADY) { if ((size_t)dmabuf->size != len) rc = -EBADR; cam_mem_mgr_print_tbl(); } "Failed in map_hw_va, len=%llu, flags=0x%x, fd=%d, region=%d, num_hdl=%d, rc=%d", cmd->len, cmd->flags, fd, region, cmd->num_hdl, rc); goto map_hw_fail; } } Loading Loading @@ -821,15 +780,9 @@ int cam_mem_mgr_map(struct cam_mem_mgr_map_cmd *cmd) CAM_SMMU_REGION_IO); if (rc) { CAM_ERR(CAM_MEM, "Failed in map_hw_va, flags=0x%x, fd=%d, [Size smmu %llu dma %llu], region=%d, num_hdl=%d, rc=%d", cmd->flags, cmd->fd, len, dmabuf->size, CAM_SMMU_REGION_IO, cmd->num_hdl, rc); if (rc == -EALREADY) { if ((size_t)dmabuf->size != len) { rc = -EBADR; cam_mem_mgr_print_tbl(); } } "Failed in map_hw_va, flags=0x%x, fd=%d, region=%d, num_hdl=%d, rc=%d", cmd->flags, cmd->fd, CAM_SMMU_REGION_IO, cmd->num_hdl, rc); goto map_fail; } } Loading Loading @@ -864,7 +817,7 @@ int cam_mem_mgr_map(struct cam_mem_mgr_map_cmd *cmd) cmd->out.buf_handle = tbl.bufq[idx].buf_handle; cmd->out.vaddr = 0; cmd->out.size = (uint32_t)len; CAM_DBG(CAM_MEM, "fd=%d, flags=0x%x, num_hdl=%d, idx=%d, buf handle=%x, len=%zu", cmd->fd, cmd->flags, cmd->num_hdl, idx, cmd->out.buf_handle, Loading Loading @@ -1084,7 +1037,6 @@ static int cam_mem_util_unmap(int32_t idx, tbl.bufq[idx].len = 0; tbl.bufq[idx].num_hdl = 0; tbl.bufq[idx].active = false; memset(&tbl.bufq[idx].timestamp, 0, sizeof(struct timespec64)); mutex_unlock(&tbl.bufq[idx].q_lock); mutex_destroy(&tbl.bufq[idx].q_lock); clear_bit(idx, tbl.bitmap); Loading
drivers/cam_req_mgr/cam_mem_mgr.h +0 −2 Original line number Diff line number Diff line Loading @@ -41,7 +41,6 @@ enum cam_smmu_mapping_client { * @kmdvaddr: Kernel virtual address * @active: state of the buffer * @is_imported: Flag indicating if buffer is imported from an FD in user space * @timestamp: Timestamp at which this entry in tbl was made */ struct cam_mem_buf_queue { struct dma_buf *dma_buf; Loading @@ -57,7 +56,6 @@ struct cam_mem_buf_queue { uintptr_t kmdvaddr; bool active; bool is_imported; struct timespec64 timestamp; }; /** Loading
drivers/cam_smmu/cam_smmu_api.c +12 −50 Original line number Diff line number Diff line Loading @@ -196,7 +196,6 @@ struct cam_dma_buff_info { int ion_fd; size_t len; size_t phys_len; struct timespec64 ts; }; struct cam_sec_buff_info { Loading Loading @@ -402,9 +401,6 @@ static void cam_smmu_dump_cb_info(int idx) size_t shared_reg_len = 0, io_reg_len = 0; size_t shared_free_len = 0, io_free_len = 0; uint32_t i = 0; uint64_t ms, tmp, hrs, min, sec; struct timespec64 *ts = NULL; struct timespec64 current_ts; struct cam_context_bank_info *cb_info = &iommu_cb_set.cb_info[idx]; Loading @@ -418,15 +414,9 @@ static void cam_smmu_dump_cb_info(int idx) io_free_len = io_reg_len - cb_info->io_mapping_size; } ktime_get_real_ts64(&(current_ts)); tmp = current_ts.tv_sec; ms = (current_ts.tv_nsec) / 1000000; sec = do_div(tmp, 60); min = do_div(tmp, 60); hrs = do_div(tmp, 24); CAM_ERR(CAM_SMMU, "********** %llu:%llu:%llu:%llu Context bank dump for %s **********", hrs, min, sec, ms, cb_info->name); "********** Context bank dump for %s **********", cb_info->name); CAM_ERR(CAM_SMMU, "Usage: shared_usage=%u io_usage=%u shared_free=%u io_free=%u", (unsigned int)cb_info->shared_mapping_size, Loading @@ -438,16 +428,9 @@ static void cam_smmu_dump_cb_info(int idx) list_for_each_entry_safe(mapping, mapping_temp, &iommu_cb_set.cb_info[idx].smmu_buf_list, list) { i++; ts = &mapping->ts; tmp = ts->tv_sec; ms = (ts->tv_nsec) / 1000000; sec = do_div(tmp, 60); min = do_div(tmp, 60); hrs = do_div(tmp, 24); CAM_ERR(CAM_SMMU, "%llu:%llu:%llu:%llu: %u ion_fd=%d start=0x%x end=0x%x len=%u region=%d", hrs, min, sec, ms, i, mapping->ion_fd, (void *)mapping->paddr, "%u. ion_fd=%d start=0x%x end=0x%x len=%u region=%d", i, mapping->ion_fd, (void *)mapping->paddr, ((uint64_t)mapping->paddr + (uint64_t)mapping->len), (unsigned int)mapping->len, Loading Loading @@ -2016,7 +1999,6 @@ static int cam_smmu_map_buffer_and_add_to_list(int idx, int ion_fd, } mapping_info->ion_fd = ion_fd; ktime_get_real_ts64(&mapping_info->ts); /* add to the list */ list_add(&mapping_info->list, &iommu_cb_set.cb_info[idx].smmu_buf_list); Loading Loading @@ -2044,7 +2026,7 @@ static int cam_smmu_map_kernel_buffer_and_add_to_list(int idx, } mapping_info->ion_fd = -1; ktime_get_real_ts64(&mapping_info->ts); /* add to the list */ list_add(&mapping_info->list, &iommu_cb_set.cb_info[idx].smmu_buf_kernel_list); Loading Loading @@ -2142,28 +2124,15 @@ static int cam_smmu_unmap_buf_and_remove_from_list( } static enum cam_smmu_buf_state cam_smmu_check_fd_in_list(int idx, int ion_fd, dma_addr_t *paddr_ptr, size_t *len_ptr, size_t *dma_buf_len) int ion_fd, dma_addr_t *paddr_ptr, size_t *len_ptr) { struct cam_dma_buff_info *mapping; struct timespec64 *ts = NULL; uint64_t ms, tmp, hrs, min, sec; list_for_each_entry(mapping, &iommu_cb_set.cb_info[idx].smmu_buf_list, list) { if (mapping->ion_fd == ion_fd) { *paddr_ptr = mapping->paddr; *len_ptr = mapping->len; *dma_buf_len = mapping->buf->size; ts = &mapping->ts; tmp = ts->tv_sec; ms = (ts->tv_nsec) / 1000000; sec = do_div(tmp, 60); min = do_div(tmp, 60); hrs = do_div(tmp, 24); CAM_WARN(CAM_SMMU, "Mapping found ts %llu:%llu:%llu:%llu paddr 0x%p len %llu dma_len %llu", hrs, min, sec, ms, (void *)mapping->paddr, mapping->len, *dma_buf_len); return CAM_SMMU_BUFF_EXIST; } } Loading Loading @@ -2894,7 +2863,6 @@ int cam_smmu_map_user_iova(int handle, int ion_fd, bool dis_delayed_unmap, size_t *len_ptr, enum cam_smmu_region_id region_id) { int idx, rc = 0; size_t dma_len = 0; enum cam_smmu_buf_state buf_state; enum dma_data_direction dma_dir; Loading Loading @@ -2932,14 +2900,11 @@ int cam_smmu_map_user_iova(int handle, int ion_fd, bool dis_delayed_unmap, goto get_addr_end; } buf_state = cam_smmu_check_fd_in_list(idx, ion_fd, paddr_ptr, len_ptr, &dma_len); buf_state = cam_smmu_check_fd_in_list(idx, ion_fd, paddr_ptr, len_ptr); if (buf_state == CAM_SMMU_BUFF_EXIST) { CAM_ERR(CAM_SMMU, "fd:%d already in list cb:%s idx:%d handle=%d len=%llu dma_len=%llu, give same addr back", ion_fd, iommu_cb_set.cb_info[idx].name, idx, handle, *len_ptr, dma_len); *len_ptr = dma_len; "fd:%d already in list idx:%d, handle=%d, give same addr back", ion_fd, idx, handle); rc = -EALREADY; goto get_addr_end; } Loading @@ -2948,9 +2913,8 @@ int cam_smmu_map_user_iova(int handle, int ion_fd, bool dis_delayed_unmap, dis_delayed_unmap, dma_dir, paddr_ptr, len_ptr, region_id); if (rc < 0) { CAM_ERR(CAM_SMMU, "mapping or add list fail cb:%s idx=%d, fd=%d, region=%d, rc=%d", iommu_cb_set.cb_info[idx].name, idx, ion_fd, region_id, rc); "mapping or add list fail, idx=%d, fd=%d, region=%d, rc=%d", idx, ion_fd, region_id, rc); cam_smmu_dump_cb_info(idx); } Loading Loading @@ -3024,7 +2988,6 @@ int cam_smmu_get_iova(int handle, int ion_fd, dma_addr_t *paddr_ptr, size_t *len_ptr) { int idx, rc = 0; size_t dma_buf_size = 0; enum cam_smmu_buf_state buf_state; if (!paddr_ptr || !len_ptr) { Loading Loading @@ -3064,8 +3027,7 @@ int cam_smmu_get_iova(int handle, int ion_fd, goto get_addr_end; } buf_state = cam_smmu_check_fd_in_list(idx, ion_fd, paddr_ptr, len_ptr, &dma_buf_size); buf_state = cam_smmu_check_fd_in_list(idx, ion_fd, paddr_ptr, len_ptr); if (buf_state == CAM_SMMU_BUFF_NOT_EXIST) { CAM_ERR(CAM_SMMU, "ion_fd:%d not in the mapped list", ion_fd); rc = -EINVAL; Loading
include/uapi/media/cam_req_mgr.h +2 −2 Original line number Diff line number Diff line Loading @@ -341,12 +341,12 @@ struct cam_mem_alloc_out_params { /** * struct cam_mem_map_out_params * @buf_handle: buffer handle * @size: size of the buffer being mapped * @reserved: reserved for future * @vaddr: virtual address pointer */ struct cam_mem_map_out_params { uint32_t buf_handle; uint32_t size; uint32_t reserved; uint64_t vaddr; }; Loading