msm: camera: isp: Optimize number of buf done callbacks

ISP context supports handling one composite group per IRQ callback. Use
this capability to reduce number of callbacks per IRQ.

CRs-Fixed: 2977031
Change-Id: I514e3e8f8f4b5998b98f2c2c6131e322231dacad
Signed-off-by: Anand Ravi <ananravi@codeaurora.org>
This commit is contained in:
Anand Ravi
2021-05-28 18:07:43 -07:00
والد c6903209f2
کامیت 0364ef7135
5فایلهای تغییر یافته به همراه80 افزوده شده و 53 حذف شده

مشاهده پرونده

@@ -11562,28 +11562,36 @@ static int cam_ife_hw_mgr_handle_hw_buf_done(
void *ctx,
void *evt_info)
{
cam_hw_event_cb_func ife_hwr_irq_wm_done_cb;
struct cam_ife_hw_mgr_ctx *ife_hw_mgr_ctx = ctx;
struct cam_isp_hw_done_event_data buf_done_event_data = {0};
struct cam_isp_hw_event_info *event_info = evt_info;
int32_t rc = 0;
cam_hw_event_cb_func ife_hwr_irq_wm_done_cb;
struct cam_ife_hw_mgr_ctx *ife_hw_mgr_ctx = ctx;
struct cam_isp_hw_done_event_data buf_done_event_data = {0};
struct cam_isp_hw_compdone_event_info *event_info = evt_info;
int32_t rc = 0, i;
ife_hwr_irq_wm_done_cb = ife_hw_mgr_ctx->common.event_cb;
buf_done_event_data.num_handles = 1;
buf_done_event_data.resource_handle[0] = event_info->res_id;
buf_done_event_data.last_consumed_addr[0] =
event_info->reg_val;
buf_done_event_data.num_handles = event_info->num_res;
if (cam_ife_hw_mgr_is_sfe_rdi_for_fetch(event_info->res_id)) {
rc = cam_ife_hw_mgr_check_rdi_scratch_buf_done(
ife_hw_mgr_ctx->ctx_index,
ife_hw_mgr_ctx->sfe_info.scratch_config,
event_info->res_id, event_info->reg_val);
if (rc)
goto end;
for (i = 0; i < event_info->num_res; i++) {
buf_done_event_data.resource_handle[i] = event_info->res_id[i];
buf_done_event_data.last_consumed_addr[i] = event_info->last_consumed_addr[i];
CAM_DBG(CAM_ISP, "Buf done for %s: %d res_id: 0x%x last consumed addr: 0x%x",
((event_info->hw_type == CAM_ISP_HW_TYPE_SFE) ? "SFE" : "IFE"),
event_info->hw_idx, event_info->res_id[i], event_info->last_consumed_addr[i]);
if (cam_ife_hw_mgr_is_sfe_rdi_for_fetch(event_info->res_id[i])) {
rc = cam_ife_hw_mgr_check_rdi_scratch_buf_done(
ife_hw_mgr_ctx->ctx_index,
ife_hw_mgr_ctx->sfe_info.scratch_config,
event_info->res_id[i],
event_info->last_consumed_addr[i]);
if (rc)
goto end;
}
}
if (atomic_read(&ife_hw_mgr_ctx->overflow_pending))
return 0;
@@ -11594,11 +11602,6 @@ static int cam_ife_hw_mgr_handle_hw_buf_done(
}
end:
CAM_DBG(CAM_ISP,
"Buf done for %s: %d res_id: 0x%x last consumed addr: 0x%x",
((event_info->hw_type == CAM_ISP_HW_TYPE_SFE) ? "SFE" : "IFE"),
event_info->hw_idx, event_info->res_id, event_info->reg_val);
return 0;
}

مشاهده پرونده

@@ -13,6 +13,7 @@
#include "cam_irq_controller.h"
#include "cam_hw_intf.h"
#include "cam_cdm_intf_api.h"
#include "cam_hw_mgr_intf.h"
/* Maximum length of tag while dumping */
#define CAM_ISP_HW_DUMP_TAG_MAX_LEN 32
@@ -256,6 +257,28 @@ struct cam_isp_hw_event_info {
uint32_t in_core_type;
};
/**
* struct cam_isp_hw_compdone_event_info:
*
* @brief: Structure to pass bufdone event details to hw mgr
*
* @res_type: Type of IFE/SFE resource
* @hw_idx: IFE/SFE hw index
* @num_res: Number of valid resource IDs in this event
* @hw_type: Hw Type sending the event (IFE or SFE)
* @res_id: Resource IDs to report buf dones
* @last_consumed_addr: Last consumed addr for resource ID at that index
*
*/
struct cam_isp_hw_compdone_event_info {
enum cam_isp_resource_type res_type;
uint32_t hw_idx;
uint32_t hw_type;
uint32_t num_res;
uint32_t res_id[CAM_NUM_OUT_PER_COMP_IRQ_MAX];
uint32_t last_consumed_addr[CAM_NUM_OUT_PER_COMP_IRQ_MAX];
};
/*
* struct cam_isp_hw_cmd_buf_update:
*

مشاهده پرونده

@@ -1688,7 +1688,7 @@ static int cam_sfe_bus_handle_sfe_out_done_bottom_half(
struct cam_isp_resource_node *sfe_out = handler_priv;
struct cam_sfe_bus_wr_out_data *rsrc_data = sfe_out->res_priv;
struct cam_sfe_bus_wr_irq_evt_payload *evt_payload = evt_payload_priv;
struct cam_isp_hw_event_info evt_info;
struct cam_isp_hw_compdone_event_info evt_info = {0};
void *ctx = NULL;
uint32_t out_list[CAM_SFE_BUS_SFE_OUT_MAX];
@@ -1711,16 +1711,17 @@ static int cam_sfe_bus_handle_sfe_out_done_bottom_half(
rc = cam_sfe_bus_get_comp_sfe_out_res_id_list(
comp_mask, out_list, &num_out);
evt_info.num_res = num_out;
for (i = 0; i < num_out; i++) {
evt_info.res_id = out_list[i];
cam_sfe_bus_get_last_consumed_addr(
evt_info.res_id[i] = out_list[i];
cam_sfe_bus_get_last_consumed_addr(
rsrc_data->bus_priv,
evt_info.res_id, &val);
evt_info.reg_val = val;
if (rsrc_data->common_data->event_cb)
rsrc_data->common_data->event_cb(ctx, evt_id,
(void *)&evt_info);
evt_info.res_id[i], &val);
evt_info.last_consumed_addr[i] = val;
}
if (rsrc_data->common_data->event_cb)
rsrc_data->common_data->event_cb(ctx, evt_id,
(void *)&evt_info);
break;
default:
break;

مشاهده پرونده

@@ -2419,7 +2419,7 @@ static int cam_vfe_bus_handle_vfe_out_done_bottom_half(
int rc = -EINVAL;
struct cam_isp_resource_node *vfe_out = handler_priv;
struct cam_vfe_bus_ver2_vfe_out_data *rsrc_data = vfe_out->res_priv;
struct cam_isp_hw_event_info evt_info;
struct cam_isp_hw_compdone_event_info evt_info = {0};
void *ctx = NULL;
uint32_t evt_id = 0;
uint32_t comp_mask = 0;
@@ -2452,18 +2452,17 @@ static int cam_vfe_bus_handle_vfe_out_done_bottom_half(
if (rsrc_data->comp_grp) {
cam_vfe_bus_get_comp_vfe_out_res_id_list(
comp_mask, out_list, &num_out);
evt_info.num_res = num_out;
for (i = 0; i < num_out; i++) {
evt_info.res_id = out_list[i];
if (rsrc_data->common_data->event_cb)
rsrc_data->common_data->event_cb(ctx,
evt_id, (void *)&evt_info);
evt_info.res_id[i] = out_list[i];
}
} else {
evt_info.res_id = vfe_out->res_id;
if (rsrc_data->common_data->event_cb)
rsrc_data->common_data->event_cb(ctx, evt_id,
(void *)&evt_info);
evt_info.num_res = 1;
evt_info.res_id[0] = vfe_out->res_id;
}
if (rsrc_data->common_data->event_cb)
rsrc_data->common_data->event_cb(ctx,
evt_id, (void *)&evt_info);
break;
default:
break;

مشاهده پرونده

@@ -2357,15 +2357,15 @@ static int cam_vfe_bus_ver3_handle_vfe_out_done_bottom_half(
void *handler_priv,
void *evt_payload_priv)
{
int rc = -EINVAL, num_out = 0, i = 0;
struct cam_isp_resource_node *vfe_out = handler_priv;
struct cam_vfe_bus_ver3_vfe_out_data *rsrc_data = vfe_out->res_priv;
struct cam_vfe_bus_irq_evt_payload *evt_payload = evt_payload_priv;
struct cam_isp_hw_event_info evt_info;
void *ctx = NULL;
uint32_t evt_id = 0;
uint64_t comp_mask = 0;
uint32_t out_list[CAM_VFE_BUS_VER3_VFE_OUT_MAX];
int rc = -EINVAL, num_out = 0, i = 0;
struct cam_isp_resource_node *vfe_out = handler_priv;
struct cam_vfe_bus_ver3_vfe_out_data *rsrc_data = vfe_out->res_priv;
struct cam_vfe_bus_irq_evt_payload *evt_payload = evt_payload_priv;
struct cam_isp_hw_compdone_event_info evt_info = {0};
void *ctx = NULL;
uint32_t evt_id = 0;
uint64_t comp_mask = 0;
uint32_t out_list[CAM_VFE_BUS_VER3_VFE_OUT_MAX];
rc = cam_vfe_bus_ver3_handle_comp_done_bottom_half(
rsrc_data->comp_grp, evt_payload_priv, &comp_mask);
@@ -2386,16 +2386,17 @@ static int cam_vfe_bus_ver3_handle_vfe_out_done_bottom_half(
rc = cam_vfe_bus_ver3_get_comp_vfe_out_res_id_list(
comp_mask, out_list, &num_out);
evt_info.num_res = num_out;
for (i = 0; i < num_out; i++) {
evt_info.res_id = out_list[i];
evt_info.reg_val =
evt_info.res_id[i] = out_list[i];
evt_info.last_consumed_addr[i] =
cam_vfe_bus_ver3_get_last_consumed_addr(
rsrc_data->bus_priv,
evt_info.res_id);
if (rsrc_data->common_data->event_cb)
rsrc_data->common_data->event_cb(ctx, evt_id,
(void *)&evt_info);
evt_info.res_id[i]);
}
if (rsrc_data->common_data->event_cb)
rsrc_data->common_data->event_cb(ctx, evt_id,
(void *)&evt_info);
break;
default:
break;