Skip to content

Commit ce32386

Browse files
Camera Software IntegrationGerrit - the friendly Code Review server
authored andcommitted
Merge "msm: camera: isp: handle comp overwrite error on vfe bus" into camera-kernel.qclinux.1.0
2 parents 601924a + dfc805e commit ce32386

3 files changed

Lines changed: 54 additions & 12 deletions

File tree

camera/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,6 +2330,8 @@ int cam_ife_hw_mgr_acquire_res_ife_out_rdi(
23302330
comp_grp = &c_ctx->vfe_bus_comp_grp[index];
23312331
comp_grp->res_id[comp_grp->num_res] = vfe_out_res_id;
23322332
comp_grp->num_res++;
2333+
CAM_DBG(CAM_ISP, "index %d comp_grp->num_res %d",
2334+
index, comp_grp->num_res);
23332335
}
23342336
break;
23352337
}
@@ -2527,6 +2529,11 @@ static int cam_ife_hw_mgr_acquire_res_ife_out_pixel(
25272529
comp_grp->res_id[comp_grp->num_res] =
25282530
ife_out_res->hw_res[j]->res_id;
25292531
comp_grp->num_res++;
2532+
CAM_DBG(CAM_ISP,
2533+
"index %d update_only %d num_res %d ctx:%u",
2534+
index, update_only, comp_grp->num_res,
2535+
c_ctx->ctx_index);
2536+
25302537
}
25312538
}
25322539

@@ -5844,6 +5851,8 @@ static int cam_ife_mgr_acquire_get_unified_structure_v0(
58445851
in_port->data[i].split_point = in->data_flex[i].split_point;
58455852
in_port->data[i].secure_mode = in->data_flex[i].secure_mode;
58465853
in_port->data[i].reserved = in->data_flex[i].reserved;
5854+
CAM_DBG(CAM_ISP, "res_type 0x%x comp_grp_id %d", in_port->data[i].res_type,
5855+
in_port->data[i].comp_grp_id);
58475856
}
58485857

58495858
return 0;
@@ -5967,6 +5976,8 @@ static int cam_ife_mgr_acquire_get_unified_structure_v3(
59675976
in_port->data[i].secure_mode = in->data_flex[i].secure_mode;
59685977
in_port->data[i].wm_mode = in->data_flex[i].wm_mode;
59695978
in_port->data[i].hw_context_id = in->data_flex[i].context_id;
5979+
CAM_DBG(CAM_ISP, "res_type 0x%x comp_grp_id %d", in_port->data[i].res_type,
5980+
in_port->data[i].comp_grp_id);
59705981
}
59715982

59725983
return 0;
@@ -6098,6 +6109,8 @@ static int cam_ife_mgr_acquire_get_unified_structure_v2(
60986109
in_port->data[i].comp_grp_id = in->data_flex[i].comp_grp_id;
60996110
in_port->data[i].split_point = in->data_flex[i].split_point;
61006111
in_port->data[i].secure_mode = in->data_flex[i].secure_mode;
6112+
CAM_DBG(CAM_ISP, "res_type 0x%x comp_grp_id %d", in_port->data[i].res_type,
6113+
in_port->data[i].comp_grp_id);
61016114
}
61026115

61036116
return 0;
@@ -17042,8 +17055,9 @@ static int cam_ife_hw_mgr_handle_hw_buf_done(
1704217055

1704317056
if (buf_done_event_data.resource_handle > 0 && ife_hwr_irq_wm_done_cb) {
1704417057
CAM_DBG(CAM_ISP,
17045-
"Notify ISP context for %u handles in ctx: %u",
17046-
buf_done_event_data.resource_handle, c_ctx->ctx_index);
17058+
"Notify ISP context for %u handles in ctx: %u comp_grp_id %d",
17059+
buf_done_event_data.resource_handle, c_ctx->ctx_index,
17060+
buf_done_event_data.comp_group_id);
1704717061
ife_hwr_irq_wm_done_cb(ife_hw_mgr_ctx->cb_priv,
1704817062
CAM_ISP_HW_EVENT_DONE, (void *)&buf_done_event_data);
1704917063
}

camera/drivers/cam_isp/isp_hw_mgr/isp_hw/include/cam_vfe_hw_intf.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/* SPDX-License-Identifier: GPL-2.0-only */
22
/*
33
* Copyright (c) 2017-2021, The Linux Foundation. All rights reserved.
4-
* Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
4+
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
55
*/
66

77
#ifndef _CAM_VFE_HW_INTF_H_
@@ -369,6 +369,8 @@ struct cam_vfe_bus_irq_evt_payload {
369369
uint32_t ccif_violation_status;
370370
uint32_t overflow_status;
371371
uint32_t image_size_violation_status;
372+
uint32_t comp_error_status;
373+
uint32_t comp_overwrite_error_status;
372374
uint32_t evt_id;
373375
uint32_t irq_reg_val[CAM_IFE_BUS_IRQ_REGISTERS_MAX];
374376
struct cam_isp_timestamp ts;

camera/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver2.c

Lines changed: 35 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// SPDX-License-Identifier: GPL-2.0-only
22
/*
33
* Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
4-
* Copyright (c) 2022-2024, Qualcomm Innovation Center, Inc. All rights reserved.
4+
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
55
*/
66

77
#include <linux/ratelimit.h>
@@ -1284,9 +1284,6 @@ static int cam_vfe_bus_start_wm(
12841284
return -EINVAL;
12851285
}
12861286
}
1287-
/* enabling Wm configuratons are taken care in update_wm().
1288-
* i.e enable wm only if io buffers are allocated
1289-
*/
12901287

12911288
CAM_DBG(CAM_ISP, "WM res %d width = %d, height = %d", rsrc_data->index,
12921289
rsrc_data->width, rsrc_data->height);
@@ -1298,6 +1295,10 @@ static int cam_vfe_bus_start_wm(
12981295
rsrc_data->index, (uint32_t) rsrc_data->hw_regs->cfg,
12991296
rsrc_data->en_cfg);
13001297

1298+
/* enable wm at start */
1299+
cam_io_w_mb(rsrc_data->en_cfg,
1300+
common_data->mem_base + rsrc_data->hw_regs->cfg);
1301+
13011302
wm_res->res_state = CAM_ISP_RESOURCE_STATE_STREAMING;
13021303

13031304
return rc;
@@ -1464,20 +1465,31 @@ static int cam_vfe_bus_err_bottom_half(void *handler_priv,
14641465
if (val & 0x0800000)
14651466
CAM_INFO(CAM_ISP, "DISP YC 16:1 violation");
14661467

1467-
cam_vfe_bus_put_evt_payload(common_data, &evt_payload);
1468+
err_evt_info.err_type = CAM_VFE_IRQ_STATUS_VIOLATION;
1469+
1470+
if (evt_payload->comp_error_status) {
1471+
err_evt_info.err_type = CAM_VFE_IRQ_STATUS_ERR_COMP;
1472+
val = evt_payload->comp_error_status;
1473+
CAM_ERR(CAM_ISP, "comp_error_status = 0x%x", val);
1474+
}
1475+
if (evt_payload->comp_overwrite_error_status) {
1476+
err_evt_info.err_type = CAM_VFE_IRQ_STATUS_COMP_OWRT;
1477+
val = evt_payload->comp_overwrite_error_status;
1478+
CAM_ERR(CAM_ISP, "comp_overwrite_error_status = 0x%x", val);
1479+
}
14681480

14691481
evt_info.hw_type = CAM_ISP_HW_TYPE_VFE;
14701482
evt_info.hw_idx = common_data->core_index;
14711483
evt_info.res_type = CAM_ISP_RESOURCE_VFE_OUT;
14721484
evt_info.res_id = CAM_VFE_BUS_VER2_VFE_OUT_MAX;
14731485

1474-
err_evt_info.err_type = CAM_VFE_IRQ_STATUS_VIOLATION;
14751486
evt_info.event_data = (void *)&err_evt_info;
14761487

14771488
if (common_data->event_cb)
14781489
common_data->event_cb(NULL, CAM_ISP_HW_EVENT_ERROR,
14791490
(void *)&evt_info);
14801491

1492+
cam_vfe_bus_put_evt_payload(common_data, &evt_payload);
14811493
return 0;
14821494
}
14831495

@@ -1687,9 +1699,11 @@ static int cam_vfe_bus_acquire_comp_grp(
16871699
}
16881700
}
16891701

1690-
CAM_DBG(CAM_ISP, "Comp Grp type %u", rsrc_data->comp_grp_type);
1691-
16921702
rsrc_data->acquire_dev_cnt++;
1703+
1704+
CAM_DBG(CAM_ISP, "Comp Grp id %d, bus_comp_grp_id %d, type %u, acquire_dev_cnt %d",
1705+
out_port_info->comp_grp_id, bus_comp_grp_id,
1706+
rsrc_data->comp_grp_type, rsrc_data->acquire_dev_cnt);
16931707
*comp_grp = comp_grp_local;
16941708

16951709
return rc;
@@ -1758,7 +1772,7 @@ static int cam_vfe_bus_release_comp_grp(
17581772
CAM_VFE_BUS_VER2_COMP_GRP_0 &&
17591773
in_rsrc_data->comp_grp_type <=
17601774
CAM_VFE_BUS_VER2_COMP_GRP_5)
1761-
list_add_tail(&comp_grp->list,
1775+
list_add(&comp_grp->list,
17621776
&ver2_bus_priv->free_comp_grp);
17631777
}
17641778

@@ -1992,6 +2006,7 @@ static int cam_vfe_bus_init_comp_grp(uint32_t index,
19922006
comp_grp->res_state = CAM_ISP_RESOURCE_STATE_AVAILABLE;
19932007
INIT_LIST_HEAD(&comp_grp->list);
19942008

2009+
rsrc_data->acquire_dev_cnt = 0;
19952010
rsrc_data->comp_grp_type = index;
19962011
rsrc_data->common_data = &ver2_bus_priv->common_data;
19972012
rsrc_data->hw_regs = &ver2_hw_info->comp_grp_reg[index];
@@ -2072,6 +2087,7 @@ static int cam_vfe_bus_acquire_vfe_out(void *bus_priv, void *acquire_args,
20722087
struct cam_vfe_hw_vfe_out_acquire_args *out_acquire_args;
20732088
struct cam_isp_resource_node *rsrc_node = NULL;
20742089
struct cam_vfe_bus_ver2_vfe_out_data *rsrc_data = NULL;
2090+
struct cam_vfe_bus_ver2_comp_grp_data *comp_rsrc_data;
20752091
uint32_t secure_caps = 0, mode;
20762092

20772093
if (!bus_priv || !acquire_args) {
@@ -2162,6 +2178,10 @@ static int cam_vfe_bus_acquire_vfe_out(void *bus_priv, void *acquire_args,
21622178
vfe_out_res_id, rc);
21632179
return rc;
21642180
}
2181+
comp_rsrc_data = rsrc_data->comp_grp->res_priv;
2182+
out_acquire_args->comp_grp_id = comp_rsrc_data->comp_grp_type;
2183+
CAM_DBG(CAM_ISP, "out_acquire_args->comp_grp_id %d",
2184+
out_acquire_args->comp_grp_id);
21652185
}
21662186

21672187
/* Reserve WM */
@@ -2604,6 +2624,12 @@ static int cam_vfe_bus_error_irq_top_half(uint32_t evt_id,
26042624
evt_payload->debug_status_0 = cam_io_r_mb(
26052625
bus_priv->common_data.mem_base +
26062626
bus_priv->common_data.common_reg->debug_status_0);
2627+
evt_payload->comp_error_status = cam_io_r_mb(
2628+
bus_priv->common_data.mem_base +
2629+
bus_priv->common_data.common_reg->comp_error_status);
2630+
evt_payload->comp_overwrite_error_status = cam_io_r_mb(
2631+
bus_priv->common_data.mem_base +
2632+
bus_priv->common_data.common_reg->comp_ovrwr_status);
26072633

26082634
th_payload->evt_payload_priv = evt_payload;
26092635

0 commit comments

Comments
 (0)