Skip to content

Commit 3db4525

Browse files
committed
Merge tag 'camera-kernel.qclinux.1.0-260118' into 00
* tag 'camera-kernel.qclinux.1.0-260118': msm: camera: isp: fix csid camif and vfe headers for qcs615 msm: camera: isp: handle comp overwrite error on vfe bus msm: camera: isp: ignoring reg read of primary SOF ts addr for QCS615 msm: camera: isp: RDI-only ctx on non-EPOCH targets msm: camera: req_mgr: Correcting always false if case msm: camera: sensor: enable sysfs utility config flags for qcs615 msm: camera: cci: fixing i2c write time delay variable overflow msm: camera: jpeg: fix DMA reset sequence msm: camera: common: Enable Talos camera support Change-Id: If202d647028687d0dafa3d91e5a1bab187bc568b Signed-off-by: Chandan Kumar Jha <cjha@qti.qualcomm.com>
2 parents ebf3a6a + fbce521 commit 3db4525

31 files changed

+306
-102
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
KBUILD_OPTIONS += CAMERA_KERNEL_ROOT=$(shell pwd)
22
KBUILD_OPTIONS += KERNEL_ROOT=$(ROOT_DIR)/$(KERNEL_DIR)
33
KBUILD_OPTIONS += INSTALL_MOD_DIR=camera
4-
SUPPORTED_ARCH = qcm6490 qcs9100
4+
SUPPORTED_ARCH = qcm6490 qcs9100 qcs615
55

66
.PHONY: clean all
77

camera/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c

Lines changed: 35 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2330,6 +2330,8 @@ static 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

@@ -5843,6 +5850,8 @@ static int cam_ife_mgr_acquire_get_unified_structure_v0(
58435850
in_port->data[i].split_point = in->data_flex[i].split_point;
58445851
in_port->data[i].secure_mode = in->data_flex[i].secure_mode;
58455852
in_port->data[i].reserved = in->data_flex[i].reserved;
5853+
CAM_DBG(CAM_ISP, "res_type 0x%x comp_grp_id %d", in_port->data[i].res_type,
5854+
in_port->data[i].comp_grp_id);
58465855
}
58475856

58485857
return 0;
@@ -5966,6 +5975,8 @@ static int cam_ife_mgr_acquire_get_unified_structure_v3(
59665975
in_port->data[i].secure_mode = in->data_flex[i].secure_mode;
59675976
in_port->data[i].wm_mode = in->data_flex[i].wm_mode;
59685977
in_port->data[i].hw_context_id = in->data_flex[i].context_id;
5978+
CAM_DBG(CAM_ISP, "res_type 0x%x comp_grp_id %d", in_port->data[i].res_type,
5979+
in_port->data[i].comp_grp_id);
59695980
}
59705981

59715982
return 0;
@@ -6097,6 +6108,8 @@ static int cam_ife_mgr_acquire_get_unified_structure_v2(
60976108
in_port->data[i].comp_grp_id = in->data_flex[i].comp_grp_id;
60986109
in_port->data[i].split_point = in->data_flex[i].split_point;
60996110
in_port->data[i].secure_mode = in->data_flex[i].secure_mode;
6111+
CAM_DBG(CAM_ISP, "res_type 0x%x comp_grp_id %d", in_port->data[i].res_type,
6112+
in_port->data[i].comp_grp_id);
61006113
}
61016114

61026115
return 0;
@@ -15317,11 +15330,25 @@ static int cam_ife_mgr_int_cmd(void *hw_mgr_priv,
1531715330
isp_hw_cmd_args->u.sof_irq_enable);
1531815331
break;
1531915332
case CAM_ISP_HW_MGR_CMD_CTX_TYPE:
15333+
CAM_DBG(CAM_ISP, "Is rdi_epoch_config_not_supported : %d",
15334+
hw_mgr->rdi_epoch_config_not_supported);
1532015335
if (c_ctx->flags.is_fe_enabled && c_ctx->flags.is_offline)
1532115336
isp_hw_cmd_args->u.ctx_info.type = CAM_ISP_CTX_OFFLINE;
1532215337
else if (c_ctx->flags.is_fe_enabled && !c_ctx->flags.is_offline &&
1532315338
c_ctx->ctx_type != CAM_IFE_CTX_TYPE_SFE)
1532415339
isp_hw_cmd_args->u.ctx_info.type = CAM_ISP_CTX_FS2;
15340+
/*
15341+
* For older tagets, RDI does not support EPOCH configuration,
15342+
* so unified state machine is not applicable and use RDI-only
15343+
* ISP context state machine for RDI use cases.
15344+
*
15345+
* On newer targets, RDI supports EPOCH configuration and can use
15346+
* the unified ISP context state machine (PIX/RDI).
15347+
*/
15348+
else if ((c_ctx->flags.is_rdi_only_context ||
15349+
c_ctx->flags.is_lite_context) &&
15350+
(hw_mgr->rdi_epoch_config_not_supported))
15351+
isp_hw_cmd_args->u.ctx_info.type = CAM_ISP_CTX_RDI;
1532515352
else
1532615353
isp_hw_cmd_args->u.ctx_info.type = CAM_ISP_CTX_PIX;
1532715354
if (hw_mgr->csid_aup_rup_en)
@@ -17005,20 +17032,20 @@ static int cam_ife_hw_mgr_handle_hw_buf_done(
1700517032
CAM_DBG(CAM_ISP,
1700617033
"Buf done for %s: %d res_id: 0x%x last consumed addr: 0x%x ctx: %u",
1700717034
((event_info->hw_type == CAM_ISP_HW_TYPE_SFE) ? "SFE" : "IFE"),
17008-
event_info->hw_idx, event_info->res_id,
17035+
event_info->hw_idx, bufdone_evt_info->res_id,
1700917036
bufdone_evt_info->last_consumed_addr, c_ctx->ctx_index);
1701017037

1701117038
/* Check scratch for sHDR/FS use-cases */
1701217039
if (c_ctx->flags.is_sfe_fs || c_ctx->flags.is_sfe_shdr) {
1701317040
rc = cam_ife_hw_mgr_check_for_scratch_buf_done(ife_hw_mgr_ctx,
17014-
event_info->hw_type, event_info->res_id,
17041+
event_info->hw_type, bufdone_evt_info->res_id,
1701517042
bufdone_evt_info->last_consumed_addr);
1701617043
if (rc)
1701717044
return 0;
1701817045
}
1701917046

1702017047
buf_done_event_data.hw_type = event_info->hw_type;
17021-
buf_done_event_data.resource_handle = event_info->res_id;
17048+
buf_done_event_data.resource_handle = bufdone_evt_info->res_id;
1702217049
buf_done_event_data.last_consumed_addr = bufdone_evt_info->last_consumed_addr;
1702317050
buf_done_event_data.comp_group_id = bufdone_evt_info->comp_grp_id;
1702417051

@@ -17027,8 +17054,9 @@ static int cam_ife_hw_mgr_handle_hw_buf_done(
1702717054

1702817055
if (buf_done_event_data.resource_handle > 0 && ife_hwr_irq_wm_done_cb) {
1702917056
CAM_DBG(CAM_ISP,
17030-
"Notify ISP context for %u handles in ctx: %u",
17031-
buf_done_event_data.resource_handle, c_ctx->ctx_index);
17057+
"Notify ISP context for %u handles in ctx: %u comp_grp_id %d",
17058+
buf_done_event_data.resource_handle, c_ctx->ctx_index,
17059+
buf_done_event_data.comp_group_id);
1703217060
ife_hwr_irq_wm_done_cb(ife_hw_mgr_ctx->cb_priv,
1703317061
CAM_ISP_HW_EVENT_DONE, (void *)&buf_done_event_data);
1703417062
}
@@ -17292,6 +17320,8 @@ static int cam_ife_hw_mgr_sort_dev_with_caps(
1729217320
ife_hw_mgr->csid_hw_caps[i].global_reset_en;
1729317321
ife_hw_mgr->csid_aup_rup_en =
1729417322
ife_hw_mgr->csid_hw_caps[i].aup_rup_en;
17323+
ife_hw_mgr->rdi_epoch_config_not_supported =
17324+
ife_hw_mgr->csid_hw_caps[i].rdi_epoch_config_not_supported;
1729517325
ife_hw_mgr->csid_camif_irq_support =
1729617326
ife_hw_mgr->csid_hw_caps[i].camif_irq_support;
1729717327
}

camera/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,6 +675,7 @@ enum cam_isp_irq_inject_common_param_pos {
675675
* @min_clk_threshold: Min sfe clock
676676
* @offline_reconfig: offline ISP need to reconfigure or not
677677
* @offline_outport_sync: Offline ISP HW needs to check outport to sync with correct hw
678+
* @rdi_epoch_config_not_supported: is RDI epoch config supported
678679
*/
679680
struct cam_ife_hw_mgr {
680681
struct cam_isp_hw_mgr mgr_common;
@@ -722,6 +723,7 @@ struct cam_ife_hw_mgr {
722723
uint32_t bytes_per_clk;
723724
bool offline_reconfig;
724725
bool offline_outport_sync;
726+
bool rdi_epoch_config_not_supported;
725727
};
726728

727729
/**

camera/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid170.h

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* SPDX-License-Identifier: GPL-2.0-only */
22
/*
33
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
4+
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
45
*/
56
#ifndef _CAM_IFE_CSID_170_H_
67
#define _CAM_IFE_CSID_170_H_
@@ -64,7 +65,7 @@ static struct cam_ife_csid_ver1_path_reg_info
6465
.halt_immediate = 2,
6566
.halt_cmd_shift = 0,
6667
.early_eof_en_shift_val = 29,
67-
.timestamp_en_shift_val = 2,
68+
.timestamp_en_shift_val = 1,
6869
.format_measure_en_shift_val = 0,
6970
.fatal_err_mask = 0x4,
7071
.non_fatal_err_mask = 0xe000,
@@ -120,7 +121,7 @@ static struct cam_ife_csid_ver1_path_reg_info
120121
.plain_fmt_shift_val = 10,
121122
.crop_v_en_shift_val = 6,
122123
.crop_h_en_shift_val = 5,
123-
.timestamp_en_shift_val = 1,
124+
.timestamp_en_shift_val = 2,
124125
.format_measure_en_shift_val = 1,
125126
.fatal_err_mask = 0x4,
126127
.non_fatal_err_mask = 0xe000,
@@ -176,7 +177,7 @@ static struct cam_ife_csid_ver1_path_reg_info
176177
.plain_fmt_shift_val = 10,
177178
.crop_v_en_shift_val = 6,
178179
.crop_h_en_shift_val = 5,
179-
.timestamp_en_shift_val = 1,
180+
.timestamp_en_shift_val = 2,
180181
.format_measure_en_shift_val = 1,
181182
.fatal_err_mask = 0x4,
182183
.non_fatal_err_mask = 0xe000,
@@ -233,7 +234,7 @@ static struct cam_ife_csid_ver1_path_reg_info
233234
.plain_fmt_shift_val = 10,
234235
.crop_v_en_shift_val = 6,
235236
.crop_h_en_shift_val = 5,
236-
.timestamp_en_shift_val = 1,
237+
.timestamp_en_shift_val = 2,
237238
.format_measure_en_shift_val = 1,
238239
.fatal_err_mask = 0x4,
239240
.non_fatal_err_mask = 0xe000,
@@ -385,12 +386,14 @@ static struct cam_ife_csid_ver1_common_reg_info
385386
.rdi_irq_mask_all = 0x7FFF,
386387
.ppp_irq_mask_all = 0x0,
387388
.measure_en_hbi_vbi_cnt_mask = 0xC,
389+
.measure_pixel_line_en_mask = 0x3,
388390
.timestamp_strobe_val = 0x2,
389391
.timestamp_stb_sel_shift_val = 0,
390392
.format_measure_height_mask_val = 0xFFFF,
391393
.format_measure_height_shift_val = 0x10,
392394
.format_measure_width_mask_val = 0xFFFF,
393395
.format_measure_width_shift_val = 0x0,
396+
.rdi_epoch_config_not_supported = 1,
394397
};
395398

396399
static struct cam_ife_csid_ver1_reg_info cam_ife_csid_170_reg_info = {

camera/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver1.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -299,6 +299,7 @@ static int cam_ife_csid_ver1_get_hw_caps(void *hw_priv,
299299
hw_caps->version_incr = csid_reg->cmn_reg->version_incr;
300300
hw_caps->global_reset_en = csid_reg->cmn_reg->global_reset;
301301
hw_caps->aup_rup_en = csid_reg->cmn_reg->aup_rup_supported;
302+
hw_caps->rdi_epoch_config_not_supported = csid_reg->cmn_reg->rdi_epoch_config_not_supported;
302303
hw_caps->is_lite = soc_private->is_ife_csid_lite;
303304

304305
CAM_DBG(CAM_ISP,
@@ -3469,6 +3470,7 @@ static int cam_ife_csid_ver1_get_time_stamp(
34693470
struct cam_ife_csid_ver1_reg_info *csid_reg;
34703471
struct timespec64 ts;
34713472
uint32_t curr_0_sof_addr, curr_1_sof_addr;
3473+
uint32_t prev_0_sof_addr, prev_1_sof_addr;
34723474

34733475
timestamp_args = (struct cam_csid_get_time_stamp_args *)cmd_args;
34743476
res = timestamp_args->node_res;
@@ -3495,10 +3497,14 @@ static int cam_ife_csid_ver1_get_time_stamp(
34953497
case CAM_IFE_PIX_PATH_RES_IPP:
34963498
curr_0_sof_addr = csid_reg->ipp_reg->timestamp_curr0_sof_addr;
34973499
curr_1_sof_addr = csid_reg->ipp_reg->timestamp_curr1_sof_addr;
3500+
prev_0_sof_addr = csid_reg->ipp_reg->timestamp_prev0_sof_addr;
3501+
prev_1_sof_addr = csid_reg->ipp_reg->timestamp_prev1_sof_addr;
34983502
break;
34993503
case CAM_IFE_PIX_PATH_RES_PPP:
35003504
curr_0_sof_addr = csid_reg->ppp_reg->timestamp_curr0_sof_addr;
35013505
curr_1_sof_addr = csid_reg->ppp_reg->timestamp_curr1_sof_addr;
3506+
prev_0_sof_addr = csid_reg->ppp_reg->timestamp_prev0_sof_addr;
3507+
prev_1_sof_addr = csid_reg->ppp_reg->timestamp_prev1_sof_addr;
35023508
break;
35033509
case CAM_IFE_PIX_PATH_RES_RDI_0:
35043510
case CAM_IFE_PIX_PATH_RES_RDI_1:
@@ -3511,13 +3517,30 @@ static int cam_ife_csid_ver1_get_time_stamp(
35113517
curr_1_sof_addr =
35123518
csid_reg->rdi_reg
35133519
[res->res_id]->timestamp_curr1_sof_addr;
3520+
prev_0_sof_addr =
3521+
csid_reg->rdi_reg
3522+
[res->res_id]->timestamp_prev0_sof_addr;
3523+
prev_1_sof_addr =
3524+
csid_reg->rdi_reg
3525+
[res->res_id]->timestamp_prev1_sof_addr;
35143526
break;
35153527
default:
35163528
CAM_ERR(CAM_ISP, "CSID:%d invalid res %d",
35173529
csid_hw->hw_intf->hw_idx, res->res_id);
35183530
return -EINVAL;
35193531
}
35203532

3533+
time_hi = cam_io_r_mb(soc_info->reg_map[0].mem_base +
3534+
prev_1_sof_addr);
3535+
time_lo = cam_io_r_mb(soc_info->reg_map[0].mem_base +
3536+
prev_0_sof_addr);
3537+
timestamp_args->prev_time_stamp_val = (time_hi << 32) | time_lo;
3538+
3539+
timestamp_args->prev_time_stamp_val = mul_u64_u32_div(
3540+
timestamp_args->prev_time_stamp_val,
3541+
CAM_IFE_CSID_QTIMER_MUL_FACTOR,
3542+
CAM_IFE_CSID_QTIMER_DIV_FACTOR);
3543+
35213544
time_hi = cam_io_r_mb(soc_info->reg_map[0].mem_base +
35223545
curr_1_sof_addr);
35233546
time_lo = cam_io_r_mb(soc_info->reg_map[0].mem_base +
@@ -3789,6 +3812,10 @@ static int cam_ife_csid_ver1_process_cmd(void *hw_priv,
37893812
case CAM_ISP_HW_CMD_CSID_CHANGE_HALT_MODE:
37903813
rc = cam_ife_csid_halt(csid_hw, cmd_args);
37913814
break;
3815+
case CAM_ISP_HW_CMD_GET_SET_PRIM_SOF_TS_ADDR:
3816+
/* Not supported for V1 */
3817+
rc = 0;
3818+
break;
37923819
case CAM_ISP_HW_CMD_CSID_DISCARD_INIT_FRAMES:
37933820
/* Not supported for V1 */
37943821
rc = 0;

camera/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver1.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -119,6 +119,7 @@ struct cam_ife_csid_ver1_common_reg_info {
119119
uint32_t early_eof_supported;
120120
uint32_t global_reset;
121121
uint32_t aup_rup_supported;
122+
uint32_t rdi_epoch_config_not_supported;
122123

123124
/* Masks */
124125
uint32_t ipp_irq_mask_all;

camera/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2479,6 +2479,7 @@ static int cam_ife_csid_ver2_get_hw_caps(void *hw_priv,
24792479
hw_caps->version_incr = csid_reg->cmn_reg->version_incr;
24802480
hw_caps->global_reset_en = csid_reg->cmn_reg->global_reset;
24812481
hw_caps->aup_rup_en = csid_reg->cmn_reg->aup_rup_supported;
2482+
hw_caps->rdi_epoch_config_not_supported = csid_reg->cmn_reg->rdi_epoch_config_not_supported;
24822483
hw_caps->only_master_rup = csid_reg->cmn_reg->only_master_rup;
24832484
hw_caps->is_lite = soc_private->is_ife_csid_lite;
24842485
hw_caps->sfe_ipp_input_rdi_res = csid_reg->cmn_reg->sfe_ipp_input_rdi_res;

camera/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -665,6 +665,7 @@ struct cam_ife_csid_ver2_common_reg_info {
665665
uint32_t early_eof_supported;
666666
uint32_t global_reset;
667667
uint32_t aup_rup_supported;
668+
uint32_t rdi_epoch_config_not_supported;
668669
uint32_t only_master_rup;
669670
uint32_t sfe_ipp_input_rdi_res;
670671
uint32_t phy_sel_base_idx;

0 commit comments

Comments
 (0)