|
@@ -13,7 +13,7 @@
|
|
#include "cam_isp_hw_mgr_intf.h"
|
|
#include "cam_isp_hw_mgr_intf.h"
|
|
|
|
|
|
int cam_isp_add_change_base(
|
|
int cam_isp_add_change_base(
|
|
- struct cam_isp_hw_update_args *prepare,
|
|
|
|
|
|
+ struct cam_hw_prepare_update_args *prepare,
|
|
struct list_head *res_list_isp_src,
|
|
struct list_head *res_list_isp_src,
|
|
uint32_t base_idx,
|
|
uint32_t base_idx,
|
|
struct cam_kmd_buf_info *kmd_buf_info)
|
|
struct cam_kmd_buf_info *kmd_buf_info)
|
|
@@ -25,8 +25,8 @@ int cam_isp_add_change_base(
|
|
struct cam_hw_update_entry *hw_entry;
|
|
struct cam_hw_update_entry *hw_entry;
|
|
uint32_t num_ent, i;
|
|
uint32_t num_ent, i;
|
|
|
|
|
|
- hw_entry = prepare->hw_update_info[base_idx].hw_entries;
|
|
|
|
- num_ent = prepare->hw_update_info[base_idx].num_hw_entries;
|
|
|
|
|
|
+ hw_entry = prepare->hw_update_entries;
|
|
|
|
+ num_ent = prepare->num_hw_update_entries;
|
|
|
|
|
|
/* Max one hw entries required for each base */
|
|
/* Max one hw entries required for each base */
|
|
if (num_ent + 1 >= prepare->max_hw_update_entries) {
|
|
if (num_ent + 1 >= prepare->max_hw_update_entries) {
|
|
@@ -77,8 +77,7 @@ int cam_isp_add_change_base(
|
|
kmd_buf_info->used_bytes += get_base.cmd.used_bytes;
|
|
kmd_buf_info->used_bytes += get_base.cmd.used_bytes;
|
|
kmd_buf_info->offset += get_base.cmd.used_bytes;
|
|
kmd_buf_info->offset += get_base.cmd.used_bytes;
|
|
num_ent++;
|
|
num_ent++;
|
|
- prepare->hw_update_info[base_idx].num_hw_entries
|
|
|
|
- = num_ent;
|
|
|
|
|
|
+ prepare->num_hw_update_entries = num_ent;
|
|
|
|
|
|
/* return success */
|
|
/* return success */
|
|
return 0;
|
|
return 0;
|
|
@@ -89,7 +88,6 @@ int cam_isp_add_change_base(
|
|
}
|
|
}
|
|
|
|
|
|
static int cam_isp_update_dual_config(
|
|
static int cam_isp_update_dual_config(
|
|
- struct cam_isp_hw_update_args *prepare,
|
|
|
|
struct cam_cmd_buf_desc *cmd_desc,
|
|
struct cam_cmd_buf_desc *cmd_desc,
|
|
uint32_t split_id,
|
|
uint32_t split_id,
|
|
uint32_t base_idx,
|
|
uint32_t base_idx,
|
|
@@ -243,7 +241,7 @@ int cam_isp_add_cmd_buf_update(
|
|
}
|
|
}
|
|
|
|
|
|
int cam_isp_add_command_buffers(
|
|
int cam_isp_add_command_buffers(
|
|
- struct cam_isp_hw_update_args *prepare,
|
|
|
|
|
|
+ struct cam_hw_prepare_update_args *prepare,
|
|
struct cam_kmd_buf_info *kmd_buf_info,
|
|
struct cam_kmd_buf_info *kmd_buf_info,
|
|
struct cam_isp_ctx_base_info *base_info,
|
|
struct cam_isp_ctx_base_info *base_info,
|
|
cam_packet_generic_blob_handler blob_handler_cb,
|
|
cam_packet_generic_blob_handler blob_handler_cb,
|
|
@@ -256,12 +254,11 @@ int cam_isp_add_command_buffers(
|
|
enum cam_isp_hw_split_id split_id;
|
|
enum cam_isp_hw_split_id split_id;
|
|
struct cam_cmd_buf_desc *cmd_desc = NULL;
|
|
struct cam_cmd_buf_desc *cmd_desc = NULL;
|
|
struct cam_hw_update_entry *hw_entry = NULL;
|
|
struct cam_hw_update_entry *hw_entry = NULL;
|
|
- struct cam_isp_hw_update_entry_info *hw_info;
|
|
|
|
|
|
|
|
split_id = base_info->split_id;
|
|
split_id = base_info->split_id;
|
|
base_idx = base_info->idx;
|
|
base_idx = base_info->idx;
|
|
- hw_entry = prepare->hw_update_info[base_idx].hw_entries;
|
|
|
|
- hw_info = prepare->hw_update_info;
|
|
|
|
|
|
+ hw_entry = prepare->hw_update_entries;
|
|
|
|
+
|
|
/*
|
|
/*
|
|
* set the cmd_desc to point the first command descriptor in the
|
|
* set the cmd_desc to point the first command descriptor in the
|
|
* packet
|
|
* packet
|
|
@@ -274,8 +271,7 @@ int cam_isp_add_command_buffers(
|
|
split_id, prepare->packet->num_cmd_buf);
|
|
split_id, prepare->packet->num_cmd_buf);
|
|
|
|
|
|
for (i = 0; i < prepare->packet->num_cmd_buf; i++) {
|
|
for (i = 0; i < prepare->packet->num_cmd_buf; i++) {
|
|
- num_ent =
|
|
|
|
- prepare->hw_update_info[base_idx].num_hw_entries;
|
|
|
|
|
|
+ num_ent = prepare->num_hw_update_entries;
|
|
if (!cmd_desc[i].length)
|
|
if (!cmd_desc[i].length)
|
|
continue;
|
|
continue;
|
|
|
|
|
|
@@ -351,8 +347,8 @@ int cam_isp_add_command_buffers(
|
|
num_ent++;
|
|
num_ent++;
|
|
break;
|
|
break;
|
|
case CAM_ISP_PACKET_META_DUAL_CONFIG:
|
|
case CAM_ISP_PACKET_META_DUAL_CONFIG:
|
|
- rc = cam_isp_update_dual_config(prepare,
|
|
|
|
- &cmd_desc[i], split_id, base_idx,
|
|
|
|
|
|
+ rc = cam_isp_update_dual_config(&cmd_desc[i],
|
|
|
|
+ split_id, base_idx,
|
|
res_list_isp_out, size_isp_out);
|
|
res_list_isp_out, size_isp_out);
|
|
|
|
|
|
if (rc)
|
|
if (rc)
|
|
@@ -362,8 +358,7 @@ int cam_isp_add_command_buffers(
|
|
if (split_id == CAM_ISP_HW_SPLIT_LEFT) {
|
|
if (split_id == CAM_ISP_HW_SPLIT_LEFT) {
|
|
struct cam_isp_generic_blob_info blob_info;
|
|
struct cam_isp_generic_blob_info blob_info;
|
|
|
|
|
|
- prepare->hw_update_info[base_idx].num_hw_entries
|
|
|
|
- = num_ent;
|
|
|
|
|
|
+ prepare->num_hw_update_entries = num_ent;
|
|
blob_info.prepare = prepare;
|
|
blob_info.prepare = prepare;
|
|
blob_info.base_info = base_info;
|
|
blob_info.base_info = base_info;
|
|
blob_info.kmd_buf_info = kmd_buf_info;
|
|
blob_info.kmd_buf_info = kmd_buf_info;
|
|
@@ -379,15 +374,14 @@ int cam_isp_add_command_buffers(
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
hw_entry[num_ent].flags = CAM_ISP_IQ_BL;
|
|
hw_entry[num_ent].flags = CAM_ISP_IQ_BL;
|
|
- num_ent = hw_info[base_idx].num_hw_entries;
|
|
|
|
|
|
+ num_ent = prepare->num_hw_update_entries;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case CAM_ISP_PACKET_META_GENERIC_BLOB_RIGHT:
|
|
case CAM_ISP_PACKET_META_GENERIC_BLOB_RIGHT:
|
|
if (split_id == CAM_ISP_HW_SPLIT_RIGHT) {
|
|
if (split_id == CAM_ISP_HW_SPLIT_RIGHT) {
|
|
struct cam_isp_generic_blob_info blob_info;
|
|
struct cam_isp_generic_blob_info blob_info;
|
|
|
|
|
|
- prepare->hw_update_info[base_idx].num_hw_entries
|
|
|
|
- = num_ent;
|
|
|
|
|
|
+ prepare->num_hw_update_entries = num_ent;
|
|
blob_info.prepare = prepare;
|
|
blob_info.prepare = prepare;
|
|
blob_info.base_info = base_info;
|
|
blob_info.base_info = base_info;
|
|
blob_info.kmd_buf_info = kmd_buf_info;
|
|
blob_info.kmd_buf_info = kmd_buf_info;
|
|
@@ -403,14 +397,13 @@ int cam_isp_add_command_buffers(
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
hw_entry[num_ent].flags = CAM_ISP_IQ_BL;
|
|
hw_entry[num_ent].flags = CAM_ISP_IQ_BL;
|
|
- num_ent = hw_info[base_idx].num_hw_entries;
|
|
|
|
|
|
+ num_ent = prepare->num_hw_update_entries;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case CAM_ISP_PACKET_META_GENERIC_BLOB_COMMON: {
|
|
case CAM_ISP_PACKET_META_GENERIC_BLOB_COMMON: {
|
|
struct cam_isp_generic_blob_info blob_info;
|
|
struct cam_isp_generic_blob_info blob_info;
|
|
|
|
|
|
- prepare->hw_update_info[base_idx].num_hw_entries =
|
|
|
|
- num_ent;
|
|
|
|
|
|
+ prepare->num_hw_update_entries = num_ent;
|
|
blob_info.prepare = prepare;
|
|
blob_info.prepare = prepare;
|
|
blob_info.base_info = base_info;
|
|
blob_info.base_info = base_info;
|
|
blob_info.kmd_buf_info = kmd_buf_info;
|
|
blob_info.kmd_buf_info = kmd_buf_info;
|
|
@@ -425,7 +418,7 @@ int cam_isp_add_command_buffers(
|
|
return rc;
|
|
return rc;
|
|
}
|
|
}
|
|
hw_entry[num_ent].flags = CAM_ISP_IQ_BL;
|
|
hw_entry[num_ent].flags = CAM_ISP_IQ_BL;
|
|
- num_ent = hw_info[base_idx].num_hw_entries;
|
|
|
|
|
|
+ num_ent = prepare->num_hw_update_entries;
|
|
}
|
|
}
|
|
break;
|
|
break;
|
|
case CAM_ISP_PACKET_META_REG_DUMP_ON_FLUSH:
|
|
case CAM_ISP_PACKET_META_REG_DUMP_ON_FLUSH:
|
|
@@ -455,8 +448,7 @@ int cam_isp_add_command_buffers(
|
|
cmd_meta_data);
|
|
cmd_meta_data);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
- prepare->hw_update_info[base_idx].num_hw_entries
|
|
|
|
- = num_ent;
|
|
|
|
|
|
+ prepare->num_hw_update_entries = num_ent;
|
|
}
|
|
}
|
|
|
|
|
|
return rc;
|
|
return rc;
|
|
@@ -465,7 +457,7 @@ int cam_isp_add_command_buffers(
|
|
int cam_isp_add_io_buffers(
|
|
int cam_isp_add_io_buffers(
|
|
int iommu_hdl,
|
|
int iommu_hdl,
|
|
int sec_iommu_hdl,
|
|
int sec_iommu_hdl,
|
|
- struct cam_isp_hw_update_args *prepare,
|
|
|
|
|
|
+ struct cam_hw_prepare_update_args *prepare,
|
|
uint32_t base_idx,
|
|
uint32_t base_idx,
|
|
struct cam_kmd_buf_info *kmd_buf_info,
|
|
struct cam_kmd_buf_info *kmd_buf_info,
|
|
struct cam_isp_hw_mgr_res *res_list_isp_out,
|
|
struct cam_isp_hw_mgr_res *res_list_isp_out,
|
|
@@ -481,7 +473,6 @@ int cam_isp_add_io_buffers(
|
|
struct cam_isp_hw_mgr_res *hw_mgr_res;
|
|
struct cam_isp_hw_mgr_res *hw_mgr_res;
|
|
struct cam_isp_hw_get_cmd_update update_buf;
|
|
struct cam_isp_hw_get_cmd_update update_buf;
|
|
struct cam_isp_hw_get_wm_update wm_update;
|
|
struct cam_isp_hw_get_wm_update wm_update;
|
|
- struct cam_hw_update_entry *hw_entry;
|
|
|
|
struct cam_isp_hw_get_wm_update bus_rd_update;
|
|
struct cam_isp_hw_get_wm_update bus_rd_update;
|
|
struct cam_hw_fence_map_entry *out_map_entries;
|
|
struct cam_hw_fence_map_entry *out_map_entries;
|
|
struct cam_hw_fence_map_entry *in_map_entries;
|
|
struct cam_hw_fence_map_entry *in_map_entries;
|
|
@@ -504,14 +495,12 @@ int cam_isp_add_io_buffers(
|
|
num_in_buf = 0;
|
|
num_in_buf = 0;
|
|
io_cfg_used_bytes = 0;
|
|
io_cfg_used_bytes = 0;
|
|
prepare->pf_data->packet = prepare->packet;
|
|
prepare->pf_data->packet = prepare->packet;
|
|
- hw_entry = prepare->hw_update_info[base_idx].hw_entries;
|
|
|
|
- num_ent = prepare->hw_update_info[base_idx].num_hw_entries;
|
|
|
|
|
|
|
|
/* Max one hw entries required for each base */
|
|
/* Max one hw entries required for each base */
|
|
- if (num_ent + 1 >=
|
|
|
|
|
|
+ if (prepare->num_hw_update_entries + 1 >=
|
|
prepare->max_hw_update_entries) {
|
|
prepare->max_hw_update_entries) {
|
|
CAM_ERR(CAM_ISP, "Insufficient HW entries :%d %d",
|
|
CAM_ERR(CAM_ISP, "Insufficient HW entries :%d %d",
|
|
- prepare->hw_update_info[base_idx].num_hw_entries,
|
|
|
|
|
|
+ prepare->num_hw_update_entries,
|
|
prepare->max_hw_update_entries);
|
|
prepare->max_hw_update_entries);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
@@ -863,21 +852,25 @@ int cam_isp_add_io_buffers(
|
|
io_cfg_used_bytes, fill_fence);
|
|
io_cfg_used_bytes, fill_fence);
|
|
if (io_cfg_used_bytes) {
|
|
if (io_cfg_used_bytes) {
|
|
/* Update the HW entries */
|
|
/* Update the HW entries */
|
|
- hw_entry[num_ent].handle = kmd_buf_info->handle;
|
|
|
|
- hw_entry[num_ent].len = io_cfg_used_bytes;
|
|
|
|
- hw_entry[num_ent].offset = kmd_buf_info->offset;
|
|
|
|
- hw_entry[num_ent].flags = CAM_ISP_IOCFG_BL;
|
|
|
|
|
|
+ num_ent = prepare->num_hw_update_entries;
|
|
|
|
+ prepare->hw_update_entries[num_ent].handle =
|
|
|
|
+ kmd_buf_info->handle;
|
|
|
|
+ prepare->hw_update_entries[num_ent].len =
|
|
|
|
+ io_cfg_used_bytes;
|
|
|
|
+ prepare->hw_update_entries[num_ent].offset =
|
|
|
|
+ kmd_buf_info->offset;
|
|
|
|
+ prepare->hw_update_entries[num_ent].flags = CAM_ISP_IOCFG_BL;
|
|
CAM_DBG(CAM_ISP,
|
|
CAM_DBG(CAM_ISP,
|
|
"num_ent=%d handle=0x%x, len=%u, offset=%u",
|
|
"num_ent=%d handle=0x%x, len=%u, offset=%u",
|
|
num_ent,
|
|
num_ent,
|
|
- hw_entry[num_ent].handle,
|
|
|
|
- hw_entry[num_ent].len,
|
|
|
|
- hw_entry[num_ent].offset);
|
|
|
|
|
|
+ prepare->hw_update_entries[num_ent].handle,
|
|
|
|
+ prepare->hw_update_entries[num_ent].len,
|
|
|
|
+ prepare->hw_update_entries[num_ent].offset);
|
|
num_ent++;
|
|
num_ent++;
|
|
|
|
|
|
kmd_buf_info->used_bytes += io_cfg_used_bytes;
|
|
kmd_buf_info->used_bytes += io_cfg_used_bytes;
|
|
kmd_buf_info->offset += io_cfg_used_bytes;
|
|
kmd_buf_info->offset += io_cfg_used_bytes;
|
|
- prepare->hw_update_info[base_idx].num_hw_entries = num_ent;
|
|
|
|
|
|
+ prepare->num_hw_update_entries = num_ent;
|
|
}
|
|
}
|
|
|
|
|
|
if (fill_fence) {
|
|
if (fill_fence) {
|
|
@@ -889,7 +882,7 @@ int cam_isp_add_io_buffers(
|
|
}
|
|
}
|
|
|
|
|
|
int cam_isp_add_reg_update(
|
|
int cam_isp_add_reg_update(
|
|
- struct cam_isp_hw_update_args *prepare,
|
|
|
|
|
|
+ struct cam_hw_prepare_update_args *prepare,
|
|
struct list_head *res_list_isp_src,
|
|
struct list_head *res_list_isp_src,
|
|
uint32_t base_idx,
|
|
uint32_t base_idx,
|
|
struct cam_kmd_buf_info *kmd_buf_info)
|
|
struct cam_kmd_buf_info *kmd_buf_info)
|
|
@@ -897,17 +890,14 @@ int cam_isp_add_reg_update(
|
|
int rc = -EINVAL;
|
|
int rc = -EINVAL;
|
|
struct cam_isp_resource_node *res;
|
|
struct cam_isp_resource_node *res;
|
|
struct cam_isp_hw_mgr_res *hw_mgr_res;
|
|
struct cam_isp_hw_mgr_res *hw_mgr_res;
|
|
- struct cam_hw_update_entry *hw_entry;
|
|
|
|
struct cam_isp_hw_get_cmd_update get_regup;
|
|
struct cam_isp_hw_get_cmd_update get_regup;
|
|
uint32_t kmd_buf_remain_size, num_ent, i, reg_update_size;
|
|
uint32_t kmd_buf_remain_size, num_ent, i, reg_update_size;
|
|
|
|
|
|
- hw_entry = prepare->hw_update_info[base_idx].hw_entries;
|
|
|
|
- num_ent = prepare->hw_update_info[base_idx].num_hw_entries;
|
|
|
|
-
|
|
|
|
/* Max one hw entries required for each base */
|
|
/* Max one hw entries required for each base */
|
|
- if (num_ent + 1 >= prepare->max_hw_update_entries) {
|
|
|
|
|
|
+ if (prepare->num_hw_update_entries + 1 >=
|
|
|
|
+ prepare->max_hw_update_entries) {
|
|
CAM_ERR(CAM_ISP, "Insufficient HW entries :%d %d",
|
|
CAM_ERR(CAM_ISP, "Insufficient HW entries :%d %d",
|
|
- num_ent,
|
|
|
|
|
|
+ prepare->num_hw_update_entries,
|
|
prepare->max_hw_update_entries);
|
|
prepare->max_hw_update_entries);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
@@ -962,23 +952,26 @@ int cam_isp_add_reg_update(
|
|
|
|
|
|
if (reg_update_size) {
|
|
if (reg_update_size) {
|
|
/* Update the HW entries */
|
|
/* Update the HW entries */
|
|
- hw_entry[num_ent].handle = kmd_buf_info->handle;
|
|
|
|
- hw_entry[num_ent].len = reg_update_size;
|
|
|
|
- hw_entry[num_ent].offset = kmd_buf_info->offset;
|
|
|
|
|
|
+ num_ent = prepare->num_hw_update_entries;
|
|
|
|
+ prepare->hw_update_entries[num_ent].handle =
|
|
|
|
+ kmd_buf_info->handle;
|
|
|
|
+ prepare->hw_update_entries[num_ent].len = reg_update_size;
|
|
|
|
+ prepare->hw_update_entries[num_ent].offset =
|
|
|
|
+ kmd_buf_info->offset;
|
|
|
|
|
|
/* Marking reg update as IOCFG to reapply on bubble */
|
|
/* Marking reg update as IOCFG to reapply on bubble */
|
|
- hw_entry[num_ent].flags = CAM_ISP_IOCFG_BL;
|
|
|
|
|
|
+ prepare->hw_update_entries[num_ent].flags = CAM_ISP_IOCFG_BL;
|
|
CAM_DBG(CAM_ISP,
|
|
CAM_DBG(CAM_ISP,
|
|
"num_ent=%d handle=0x%x, len=%u, offset=%u",
|
|
"num_ent=%d handle=0x%x, len=%u, offset=%u",
|
|
num_ent,
|
|
num_ent,
|
|
- hw_entry[num_ent].handle,
|
|
|
|
- hw_entry[num_ent].len,
|
|
|
|
- hw_entry[num_ent].offset);
|
|
|
|
|
|
+ prepare->hw_update_entries[num_ent].handle,
|
|
|
|
+ prepare->hw_update_entries[num_ent].len,
|
|
|
|
+ prepare->hw_update_entries[num_ent].offset);
|
|
num_ent++;
|
|
num_ent++;
|
|
|
|
|
|
kmd_buf_info->used_bytes += reg_update_size;
|
|
kmd_buf_info->used_bytes += reg_update_size;
|
|
kmd_buf_info->offset += reg_update_size;
|
|
kmd_buf_info->offset += reg_update_size;
|
|
- prepare->hw_update_info[base_idx].num_hw_entries = num_ent;
|
|
|
|
|
|
+ prepare->num_hw_update_entries = num_ent;
|
|
/* reg update is success return status 0 */
|
|
/* reg update is success return status 0 */
|
|
rc = 0;
|
|
rc = 0;
|
|
}
|
|
}
|
|
@@ -987,7 +980,7 @@ int cam_isp_add_reg_update(
|
|
}
|
|
}
|
|
|
|
|
|
int cam_isp_add_go_cmd(
|
|
int cam_isp_add_go_cmd(
|
|
- struct cam_isp_hw_update_args *prepare,
|
|
|
|
|
|
+ struct cam_hw_prepare_update_args *prepare,
|
|
struct list_head *res_list_isp_rd,
|
|
struct list_head *res_list_isp_rd,
|
|
uint32_t base_idx,
|
|
uint32_t base_idx,
|
|
struct cam_kmd_buf_info *kmd_buf_info)
|
|
struct cam_kmd_buf_info *kmd_buf_info)
|
|
@@ -995,17 +988,14 @@ int cam_isp_add_go_cmd(
|
|
int rc = -EINVAL;
|
|
int rc = -EINVAL;
|
|
struct cam_isp_resource_node *res;
|
|
struct cam_isp_resource_node *res;
|
|
struct cam_isp_hw_mgr_res *hw_mgr_res;
|
|
struct cam_isp_hw_mgr_res *hw_mgr_res;
|
|
- struct cam_hw_update_entry *hw_entry;
|
|
|
|
struct cam_isp_hw_get_cmd_update get_regup;
|
|
struct cam_isp_hw_get_cmd_update get_regup;
|
|
uint32_t kmd_buf_remain_size, num_ent, i, reg_update_size;
|
|
uint32_t kmd_buf_remain_size, num_ent, i, reg_update_size;
|
|
|
|
|
|
- hw_entry = prepare->hw_update_info[base_idx].hw_entries;
|
|
|
|
- num_ent = prepare->hw_update_info[base_idx].num_hw_entries;
|
|
|
|
-
|
|
|
|
/* Max one hw entries required for each base */
|
|
/* Max one hw entries required for each base */
|
|
- if (num_ent + 1 >= prepare->max_hw_update_entries) {
|
|
|
|
|
|
+ if (prepare->num_hw_update_entries + 1 >=
|
|
|
|
+ prepare->max_hw_update_entries) {
|
|
CAM_ERR(CAM_ISP, "Insufficient HW entries :%d %d",
|
|
CAM_ERR(CAM_ISP, "Insufficient HW entries :%d %d",
|
|
- num_ent,
|
|
|
|
|
|
+ prepare->num_hw_update_entries,
|
|
prepare->max_hw_update_entries);
|
|
prepare->max_hw_update_entries);
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
@@ -1058,22 +1048,24 @@ int cam_isp_add_go_cmd(
|
|
|
|
|
|
if (reg_update_size) {
|
|
if (reg_update_size) {
|
|
/* Update the HW entries */
|
|
/* Update the HW entries */
|
|
- hw_entry[num_ent].handle = kmd_buf_info->handle;
|
|
|
|
- hw_entry[num_ent].len = reg_update_size;
|
|
|
|
- hw_entry[num_ent].offset = kmd_buf_info->offset;
|
|
|
|
-
|
|
|
|
- hw_entry[num_ent].flags = CAM_ISP_IOCFG_BL;
|
|
|
|
|
|
+ num_ent = prepare->num_hw_update_entries;
|
|
|
|
+ prepare->hw_update_entries[num_ent].handle =
|
|
|
|
+ kmd_buf_info->handle;
|
|
|
|
+ prepare->hw_update_entries[num_ent].len = reg_update_size;
|
|
|
|
+ prepare->hw_update_entries[num_ent].offset =
|
|
|
|
+ kmd_buf_info->offset;
|
|
|
|
+ prepare->hw_update_entries[num_ent].flags = CAM_ISP_IOCFG_BL;
|
|
CAM_DBG(CAM_ISP,
|
|
CAM_DBG(CAM_ISP,
|
|
"num_ent=%d handle=0x%x, len=%u, offset=%u",
|
|
"num_ent=%d handle=0x%x, len=%u, offset=%u",
|
|
num_ent,
|
|
num_ent,
|
|
- hw_entry[num_ent].handle,
|
|
|
|
- hw_entry[num_ent].len,
|
|
|
|
- hw_entry[num_ent].offset);
|
|
|
|
|
|
+ prepare->hw_update_entries[num_ent].handle,
|
|
|
|
+ prepare->hw_update_entries[num_ent].len,
|
|
|
|
+ prepare->hw_update_entries[num_ent].offset);
|
|
num_ent++;
|
|
num_ent++;
|
|
|
|
|
|
kmd_buf_info->used_bytes += reg_update_size;
|
|
kmd_buf_info->used_bytes += reg_update_size;
|
|
kmd_buf_info->offset += reg_update_size;
|
|
kmd_buf_info->offset += reg_update_size;
|
|
- prepare->hw_update_info[base_idx].num_hw_entries = num_ent;
|
|
|
|
|
|
+ prepare->num_hw_update_entries = num_ent;
|
|
|
|
|
|
rc = 0;
|
|
rc = 0;
|
|
}
|
|
}
|
|
@@ -1082,24 +1074,20 @@ int cam_isp_add_go_cmd(
|
|
}
|
|
}
|
|
|
|
|
|
int cam_isp_add_comp_wait(
|
|
int cam_isp_add_comp_wait(
|
|
- struct cam_isp_hw_update_args *prepare,
|
|
|
|
|
|
+ struct cam_hw_prepare_update_args *prepare,
|
|
struct list_head *res_list_isp_src,
|
|
struct list_head *res_list_isp_src,
|
|
uint32_t base_idx,
|
|
uint32_t base_idx,
|
|
struct cam_kmd_buf_info *kmd_buf_info)
|
|
struct cam_kmd_buf_info *kmd_buf_info)
|
|
{
|
|
{
|
|
int rc = -EINVAL;
|
|
int rc = -EINVAL;
|
|
struct cam_isp_hw_mgr_res *hw_mgr_res;
|
|
struct cam_isp_hw_mgr_res *hw_mgr_res;
|
|
- struct cam_hw_update_entry *hw_entry;
|
|
|
|
struct cam_isp_hw_get_cmd_update add_wait;
|
|
struct cam_isp_hw_get_cmd_update add_wait;
|
|
struct cam_hw_intf *hw_intf;
|
|
struct cam_hw_intf *hw_intf;
|
|
bool hw_res_valid = false;
|
|
bool hw_res_valid = false;
|
|
uint32_t kmd_buf_remain_size, num_ent, add_wait_size;
|
|
uint32_t kmd_buf_remain_size, num_ent, add_wait_size;
|
|
|
|
|
|
- hw_entry = prepare->hw_update_info[base_idx].hw_entries;
|
|
|
|
- num_ent = prepare->hw_update_info[base_idx].num_hw_entries;
|
|
|
|
-
|
|
|
|
/* Max one hw entries required for each base */
|
|
/* Max one hw entries required for each base */
|
|
- if (num_ent >= prepare->max_hw_update_entries) {
|
|
|
|
|
|
+ if (prepare->num_hw_update_entries >= prepare->max_hw_update_entries) {
|
|
CAM_ERR(CAM_ISP, "Insufficient HW entries");
|
|
CAM_ERR(CAM_ISP, "Insufficient HW entries");
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
@@ -1157,25 +1145,24 @@ int cam_isp_add_comp_wait(
|
|
add_wait_size += add_wait.cmd.used_bytes;
|
|
add_wait_size += add_wait.cmd.used_bytes;
|
|
if (add_wait_size) {
|
|
if (add_wait_size) {
|
|
/* Update the HW entries */
|
|
/* Update the HW entries */
|
|
- hw_entry[num_ent].handle =
|
|
|
|
|
|
+ num_ent = prepare->num_hw_update_entries;
|
|
|
|
+ prepare->hw_update_entries[num_ent].handle =
|
|
kmd_buf_info->handle;
|
|
kmd_buf_info->handle;
|
|
- hw_entry[num_ent].len =
|
|
|
|
- add_wait_size;
|
|
|
|
- hw_entry[num_ent].offset =
|
|
|
|
|
|
+ prepare->hw_update_entries[num_ent].len = add_wait_size;
|
|
|
|
+ prepare->hw_update_entries[num_ent].offset =
|
|
kmd_buf_info->offset;
|
|
kmd_buf_info->offset;
|
|
- hw_entry[num_ent].flags = CAM_ISP_IOCFG_BL;
|
|
|
|
|
|
+ prepare->hw_update_entries[num_ent].flags = CAM_ISP_IOCFG_BL;
|
|
CAM_DBG(CAM_ISP,
|
|
CAM_DBG(CAM_ISP,
|
|
"num_ent=%d handle=0x%x, len=%u, offset=%u",
|
|
"num_ent=%d handle=0x%x, len=%u, offset=%u",
|
|
num_ent,
|
|
num_ent,
|
|
- hw_entry[num_ent].handle,
|
|
|
|
- hw_entry[num_ent].len,
|
|
|
|
- hw_entry[num_ent].offset);
|
|
|
|
|
|
+ prepare->hw_update_entries[num_ent].handle,
|
|
|
|
+ prepare->hw_update_entries[num_ent].len,
|
|
|
|
+ prepare->hw_update_entries[num_ent].offset);
|
|
num_ent++;
|
|
num_ent++;
|
|
|
|
|
|
kmd_buf_info->used_bytes += add_wait_size;
|
|
kmd_buf_info->used_bytes += add_wait_size;
|
|
kmd_buf_info->offset += add_wait_size;
|
|
kmd_buf_info->offset += add_wait_size;
|
|
- prepare->hw_update_info[base_idx].num_hw_entries
|
|
|
|
- = num_ent;
|
|
|
|
|
|
+ prepare->num_hw_update_entries = num_ent;
|
|
/* add wait_comp_event is success return status 0 */
|
|
/* add wait_comp_event is success return status 0 */
|
|
rc = 0;
|
|
rc = 0;
|
|
}
|
|
}
|
|
@@ -1184,7 +1171,7 @@ int cam_isp_add_comp_wait(
|
|
}
|
|
}
|
|
|
|
|
|
int cam_isp_add_wait_trigger(
|
|
int cam_isp_add_wait_trigger(
|
|
- struct cam_isp_hw_update_args *prepare,
|
|
|
|
|
|
+ struct cam_hw_prepare_update_args *prepare,
|
|
struct list_head *res_list_isp_src,
|
|
struct list_head *res_list_isp_src,
|
|
uint32_t base_idx,
|
|
uint32_t base_idx,
|
|
struct cam_kmd_buf_info *kmd_buf_info,
|
|
struct cam_kmd_buf_info *kmd_buf_info,
|
|
@@ -1192,19 +1179,15 @@ int cam_isp_add_wait_trigger(
|
|
{
|
|
{
|
|
int rc = -EINVAL;
|
|
int rc = -EINVAL;
|
|
struct cam_isp_hw_mgr_res *hw_mgr_res;
|
|
struct cam_isp_hw_mgr_res *hw_mgr_res;
|
|
- struct cam_hw_update_entry *hw_entry;
|
|
|
|
struct cam_isp_hw_get_cmd_update add_trigger;
|
|
struct cam_isp_hw_get_cmd_update add_trigger;
|
|
struct cam_hw_intf *hw_intf;
|
|
struct cam_hw_intf *hw_intf;
|
|
bool hw_res_valid = false;
|
|
bool hw_res_valid = false;
|
|
uint32_t kmd_buf_remain_size, num_ent, add_trigger_size;
|
|
uint32_t kmd_buf_remain_size, num_ent, add_trigger_size;
|
|
|
|
|
|
- hw_entry = prepare->hw_update_info[base_idx].hw_entries;
|
|
|
|
- num_ent = prepare->hw_update_info[base_idx].num_hw_entries;
|
|
|
|
-
|
|
|
|
/* Max one hw entries required for each base */
|
|
/* Max one hw entries required for each base */
|
|
- if (num_ent + 1 >=
|
|
|
|
|
|
+ if (prepare->num_hw_update_entries + 1 >=
|
|
prepare->max_hw_update_entries) {
|
|
prepare->max_hw_update_entries) {
|
|
- CAM_ERR(CAM_ISP, "Insufficient HW entries :%d %d");
|
|
|
|
|
|
+ CAM_ERR(CAM_ISP, "Insufficient HW entries");
|
|
return -EINVAL;
|
|
return -EINVAL;
|
|
}
|
|
}
|
|
|
|
|
|
@@ -1247,11 +1230,6 @@ int cam_isp_add_wait_trigger(
|
|
add_trigger.cmd_type = CAM_ISP_HW_CMD_ADD_WAIT_TRIGGER;
|
|
add_trigger.cmd_type = CAM_ISP_HW_CMD_ADD_WAIT_TRIGGER;
|
|
add_trigger.res = hw_mgr_res->hw_res[CAM_ISP_HW_SPLIT_RIGHT];
|
|
add_trigger.res = hw_mgr_res->hw_res[CAM_ISP_HW_SPLIT_RIGHT];
|
|
|
|
|
|
- if (trigger_cdm_en)
|
|
|
|
- add_trigger.trigger_cdm_en = true;
|
|
|
|
- else
|
|
|
|
- add_trigger.trigger_cdm_en = false;
|
|
|
|
-
|
|
|
|
rc = hw_intf->hw_ops.process_cmd(
|
|
rc = hw_intf->hw_ops.process_cmd(
|
|
hw_intf->hw_priv,
|
|
hw_intf->hw_priv,
|
|
CAM_ISP_HW_CMD_ADD_WAIT_TRIGGER,
|
|
CAM_ISP_HW_CMD_ADD_WAIT_TRIGGER,
|
|
@@ -1268,25 +1246,24 @@ int cam_isp_add_wait_trigger(
|
|
|
|
|
|
if (add_trigger_size) {
|
|
if (add_trigger_size) {
|
|
/* Update the HW entries */
|
|
/* Update the HW entries */
|
|
- hw_entry[num_ent].handle =
|
|
|
|
|
|
+ num_ent = prepare->num_hw_update_entries;
|
|
|
|
+ prepare->hw_update_entries[num_ent].handle =
|
|
kmd_buf_info->handle;
|
|
kmd_buf_info->handle;
|
|
- hw_entry[num_ent].len =
|
|
|
|
- add_trigger_size;
|
|
|
|
- hw_entry[num_ent].offset =
|
|
|
|
|
|
+ prepare->hw_update_entries[num_ent].len = add_trigger_size;
|
|
|
|
+ prepare->hw_update_entries[num_ent].offset =
|
|
kmd_buf_info->offset;
|
|
kmd_buf_info->offset;
|
|
- hw_entry[num_ent].flags = CAM_ISP_IOCFG_BL;
|
|
|
|
|
|
+ prepare->hw_update_entries[num_ent].flags = CAM_ISP_IOCFG_BL;
|
|
CAM_DBG(CAM_ISP,
|
|
CAM_DBG(CAM_ISP,
|
|
"num_ent=%d handle=0x%x, len=%u, offset=%u",
|
|
"num_ent=%d handle=0x%x, len=%u, offset=%u",
|
|
num_ent,
|
|
num_ent,
|
|
- hw_entry[num_ent].handle,
|
|
|
|
- hw_entry[num_ent].len,
|
|
|
|
- hw_entry[num_ent].offset);
|
|
|
|
|
|
+ prepare->hw_update_entries[num_ent].handle,
|
|
|
|
+ prepare->hw_update_entries[num_ent].len,
|
|
|
|
+ prepare->hw_update_entries[num_ent].offset);
|
|
num_ent++;
|
|
num_ent++;
|
|
|
|
|
|
kmd_buf_info->used_bytes += add_trigger_size;
|
|
kmd_buf_info->used_bytes += add_trigger_size;
|
|
kmd_buf_info->offset += add_trigger_size;
|
|
kmd_buf_info->offset += add_trigger_size;
|
|
- prepare->hw_update_info[base_idx].num_hw_entries
|
|
|
|
- = num_ent;
|
|
|
|
|
|
+ prepare->num_hw_update_entries = num_ent;
|
|
/* add wait trigger is success return status 0 */
|
|
/* add wait trigger is success return status 0 */
|
|
rc = 0;
|
|
rc = 0;
|
|
}
|
|
}
|