Skip to content

Commit 19a54d2

Browse files
msm: camera: isp: fix csid camif and vfe headers for qcs615
fix csid, csid lite camif and vfe headers. read previous frame timestamp for csid ver1 camif and rdi. fix buf_done event data passing. CRs-Fixed: 4403515 Change-Id: I09c3f0a11c4c6dbf039fa0e9687c5438cb690d10 Signed-off-by: Ignatius Michael Jihan <mignatiu@qti.qualcomm.com>
1 parent fde2494 commit 19a54d2

7 files changed

Lines changed: 134 additions & 61 deletions

File tree

camera/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17006,20 +17006,20 @@ static int cam_ife_hw_mgr_handle_hw_buf_done(
1700617006
CAM_DBG(CAM_ISP,
1700717007
"Buf done for %s: %d res_id: 0x%x last consumed addr: 0x%x ctx: %u",
1700817008
((event_info->hw_type == CAM_ISP_HW_TYPE_SFE) ? "SFE" : "IFE"),
17009-
event_info->hw_idx, event_info->res_id,
17009+
event_info->hw_idx, bufdone_evt_info->res_id,
1701017010
bufdone_evt_info->last_consumed_addr, c_ctx->ctx_index);
1701117011

1701217012
/* Check scratch for sHDR/FS use-cases */
1701317013
if (c_ctx->flags.is_sfe_fs || c_ctx->flags.is_sfe_shdr) {
1701417014
rc = cam_ife_hw_mgr_check_for_scratch_buf_done(ife_hw_mgr_ctx,
17015-
event_info->hw_type, event_info->res_id,
17015+
event_info->hw_type, bufdone_evt_info->res_id,
1701617016
bufdone_evt_info->last_consumed_addr);
1701717017
if (rc)
1701817018
return 0;
1701917019
}
1702017020

1702117021
buf_done_event_data.hw_type = event_info->hw_type;
17022-
buf_done_event_data.resource_handle = event_info->res_id;
17022+
buf_done_event_data.resource_handle = bufdone_evt_info->res_id;
1702317023
buf_done_event_data.last_consumed_addr = bufdone_evt_info->last_consumed_addr;
1702417024
buf_done_event_data.comp_group_id = bufdone_evt_info->comp_grp_id;
1702517025

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

Lines changed: 6 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,6 +386,7 @@ 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,

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

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3469,6 +3469,7 @@ static int cam_ife_csid_ver1_get_time_stamp(
34693469
struct cam_ife_csid_ver1_reg_info *csid_reg;
34703470
struct timespec64 ts;
34713471
uint32_t curr_0_sof_addr, curr_1_sof_addr;
3472+
uint32_t prev_0_sof_addr, prev_1_sof_addr;
34723473

34733474
timestamp_args = (struct cam_csid_get_time_stamp_args *)cmd_args;
34743475
res = timestamp_args->node_res;
@@ -3495,10 +3496,14 @@ static int cam_ife_csid_ver1_get_time_stamp(
34953496
case CAM_IFE_PIX_PATH_RES_IPP:
34963497
curr_0_sof_addr = csid_reg->ipp_reg->timestamp_curr0_sof_addr;
34973498
curr_1_sof_addr = csid_reg->ipp_reg->timestamp_curr1_sof_addr;
3499+
prev_0_sof_addr = csid_reg->ipp_reg->timestamp_prev0_sof_addr;
3500+
prev_1_sof_addr = csid_reg->ipp_reg->timestamp_prev1_sof_addr;
34983501
break;
34993502
case CAM_IFE_PIX_PATH_RES_PPP:
35003503
curr_0_sof_addr = csid_reg->ppp_reg->timestamp_curr0_sof_addr;
35013504
curr_1_sof_addr = csid_reg->ppp_reg->timestamp_curr1_sof_addr;
3505+
prev_0_sof_addr = csid_reg->ppp_reg->timestamp_prev0_sof_addr;
3506+
prev_1_sof_addr = csid_reg->ppp_reg->timestamp_prev1_sof_addr;
35023507
break;
35033508
case CAM_IFE_PIX_PATH_RES_RDI_0:
35043509
case CAM_IFE_PIX_PATH_RES_RDI_1:
@@ -3511,13 +3516,30 @@ static int cam_ife_csid_ver1_get_time_stamp(
35113516
curr_1_sof_addr =
35123517
csid_reg->rdi_reg
35133518
[res->res_id]->timestamp_curr1_sof_addr;
3519+
prev_0_sof_addr =
3520+
csid_reg->rdi_reg
3521+
[res->res_id]->timestamp_prev0_sof_addr;
3522+
prev_1_sof_addr =
3523+
csid_reg->rdi_reg
3524+
[res->res_id]->timestamp_prev1_sof_addr;
35143525
break;
35153526
default:
35163527
CAM_ERR(CAM_ISP, "CSID:%d invalid res %d",
35173528
csid_hw->hw_intf->hw_idx, res->res_id);
35183529
return -EINVAL;
35193530
}
35203531

3532+
time_hi = cam_io_r_mb(soc_info->reg_map[0].mem_base +
3533+
prev_1_sof_addr);
3534+
time_lo = cam_io_r_mb(soc_info->reg_map[0].mem_base +
3535+
prev_0_sof_addr);
3536+
timestamp_args->prev_time_stamp_val = (time_hi << 32) | time_lo;
3537+
3538+
timestamp_args->prev_time_stamp_val = mul_u64_u32_div(
3539+
timestamp_args->prev_time_stamp_val,
3540+
CAM_IFE_CSID_QTIMER_MUL_FACTOR,
3541+
CAM_IFE_CSID_QTIMER_DIV_FACTOR);
3542+
35213543
time_hi = cam_io_r_mb(soc_info->reg_map[0].mem_base +
35223544
curr_1_sof_addr);
35233545
time_lo = cam_io_r_mb(soc_info->reg_map[0].mem_base +

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

Lines changed: 46 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,21 @@
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
*/
5-
66
#ifndef _CAM_IFE_CSID_LITE17X_H_
77
#define _CAM_IFE_CSID_LITE17X_H_
88

9-
#include "cam_ife_csid_dev.h"
9+
#include <linux/module.h>
1010
#include "cam_ife_csid_common.h"
1111
#include "cam_ife_csid_hw_ver1.h"
12+
#include "cam_ife_csid_dev.h"
13+
#include "camera_main.h"
1214

1315
#define CAM_CSID_LITE_DRV_NAME "csid_lite"
1416

15-
static struct cam_ife_csid_ver1_path_reg_info
16-
cam_ife_csid_lite_17x_rdi_0_reg_info = {
17-
17+
static struct cam_ife_csid_ver1_path_reg_info
18+
cam_ife_csid_lite_17x_rdi_0_reg_info = {
1819
.irq_status_addr = 0x30,
1920
.irq_mask_addr = 0x34,
2021
.irq_clear_addr = 0x38,
@@ -51,8 +52,11 @@ static struct cam_ife_csid_ver1_path_reg_info
5152
.timestamp_curr1_eof_addr = 0x2a4,
5253
.timestamp_prev0_eof_addr = 0x2a8,
5354
.timestamp_prev1_eof_addr = 0x2ac,
55+
/* configurations */
5456
.byte_cntr_ping_addr = 0x2e0,
5557
.byte_cntr_pong_addr = 0x2e4,
58+
.crop_v_en_shift_val = 6,
59+
.crop_h_en_shift_val = 5,
5660
.halt_mode_internal = 0,
5761
.halt_mode_global = 1,
5862
.halt_mode_shift = 2,
@@ -62,17 +66,14 @@ static struct cam_ife_csid_ver1_path_reg_info
6266
.halt_cmd_shift = 0,
6367
.packing_fmt_shift_val = 30,
6468
.plain_fmt_shift_val = 10,
65-
.crop_v_en_shift_val = 6,
66-
.crop_h_en_shift_val = 5,
6769
.timestamp_en_shift_val = 2,
6870
.format_measure_en_shift_val = 1,
69-
.fatal_err_mask = 0x4,
71+
.fatal_err_mask = 0x6004,
7072
.non_fatal_err_mask = 0xe000,
7173
};
7274

73-
static struct cam_ife_csid_ver1_path_reg_info
74-
cam_ife_csid_lite_17x_rdi_1_reg_info = {
75-
75+
static struct cam_ife_csid_ver1_path_reg_info
76+
cam_ife_csid_lite_17x_rdi_1_reg_info = {
7677
.irq_status_addr = 0x40,
7778
.irq_mask_addr = 0x44,
7879
.irq_clear_addr = 0x48,
@@ -124,11 +125,12 @@ static struct cam_ife_csid_ver1_path_reg_info
124125
.crop_h_en_shift_val = 5,
125126
.timestamp_en_shift_val = 2,
126127
.format_measure_en_shift_val = 1,
128+
.fatal_err_mask = 0x4,
129+
.non_fatal_err_mask = 0xe000,
127130
};
128131

129-
static struct cam_ife_csid_ver1_path_reg_info
130-
cam_ife_csid_lite_17x_rdi_2_reg_info = {
131-
132+
static struct cam_ife_csid_ver1_path_reg_info
133+
cam_ife_csid_lite_17x_rdi_2_reg_info = {
132134
.irq_status_addr = 0x50,
133135
.irq_mask_addr = 0x54,
134136
.irq_clear_addr = 0x58,
@@ -181,11 +183,12 @@ static struct cam_ife_csid_ver1_path_reg_info
181183
.crop_h_en_shift_val = 5,
182184
.timestamp_en_shift_val = 2,
183185
.format_measure_en_shift_val = 1,
186+
.fatal_err_mask = 0x4,
187+
.non_fatal_err_mask = 0xe000,
184188
};
185189

186-
static struct cam_ife_csid_ver1_path_reg_info
187-
cam_ife_csid_lite_17x_rdi_3_reg_info = {
188-
190+
static struct cam_ife_csid_ver1_path_reg_info
191+
cam_ife_csid_lite_17x_rdi_3_reg_info = {
189192
.irq_status_addr = 0x60,
190193
.irq_mask_addr = 0x64,
191194
.irq_clear_addr = 0x68,
@@ -238,16 +241,16 @@ static struct cam_ife_csid_ver1_path_reg_info
238241
.crop_h_en_shift_val = 5,
239242
.timestamp_en_shift_val = 2,
240243
.format_measure_en_shift_val = 1,
244+
.fatal_err_mask = 0x4,
245+
.non_fatal_err_mask = 0xe000,
241246
};
242247

243-
static struct cam_ife_csid_csi2_rx_reg_info
244-
cam_ife_csid_lite_17x_csi2_reg_info = {
245-
248+
static struct cam_ife_csid_csi2_rx_reg_info
249+
cam_ife_csid_lite_17x_csi2_reg_info = {
246250
.irq_status_addr = 0x20,
247251
.irq_mask_addr = 0x24,
248252
.irq_clear_addr = 0x28,
249253
.irq_set_addr = 0x2c,
250-
251254
/*CSI2 rx control */
252255
.cfg0_addr = 0x100,
253256
.cfg1_addr = 0x104,
@@ -285,14 +288,23 @@ static struct cam_ife_csid_csi2_rx_reg_info
285288
.capture_cphy_pkt_dt_shift = 20,
286289
.capture_cphy_pkt_vc_shift = 26,
287290
.phy_num_mask = 0x3,
291+
.vc_mask = 0x7C00000,
292+
.dt_mask = 0x3f0000,
293+
.wc_mask = 0xffff,
294+
.calc_crc_mask = 0xffff,
295+
.expected_crc_mask = 0xffff,
296+
.ecc_correction_shift_en = 0,
297+
.lane_num_shift = 0,
298+
.lane_cfg_shift = 4,
299+
.phy_type_shift = 24,
300+
.phy_num_shift = 20,
288301
.fatal_err_mask = 0x78000,
289302
.part_fatal_err_mask = 0x1801800,
290303
.non_fatal_err_mask = 0x380000,
291304
};
292305

293-
294306
static struct cam_ife_csid_ver1_tpg_reg_info
295-
cam_ife_csid_lite_17x_tpg_reg_info = {
307+
cam_ife_csid_lite_17x_tpg_reg_info = {
296308
/*CSID TPG control */
297309
.ctrl_addr = 0x600,
298310
.vc_cfg0_addr = 0x604,
@@ -311,21 +323,20 @@ static struct cam_ife_csid_ver1_tpg_reg_info
311323
.cgen_n_xy_addr = 0x660,
312324
.cgen_n_y1_addr = 0x664,
313325
.cgen_n_y2_addr = 0x668,
314-
315326
/* configurations */
316327
.dtn_cfg_offset = 0xc,
317328
.cgen_cfg_offset = 0x20,
318329
.cpas_ife_reg_offset = 0x28,
319330
.hbi = 0x740,
320331
.vbi = 0x3FF,
321-
.ctrl_cfg = 0x408007,
322332
.lfsr_seed = 0x12345678,
333+
.ctrl_cfg = 0x408007,
334+
.line_interleave_mode = 0x1,
323335
.color_bar = 1,
324336
.num_frames = 0,
325-
.line_interleave_mode = 0x1,
337+
.num_active_dt = 0,
326338
.payload_mode = 0x8,
327339
.num_active_lanes_mask = 0x30,
328-
.num_active_dt = 0,
329340
.fmt_shift = 16,
330341
.num_frame_shift = 16,
331342
.width_shift = 16,
@@ -337,10 +348,8 @@ static struct cam_ife_csid_ver1_tpg_reg_info
337348
.hbi_shift = 0,
338349
};
339350

340-
341-
static struct cam_ife_csid_ver1_common_reg_info
342-
cam_csid_lite_17x_cmn_reg_info = {
343-
351+
static struct cam_ife_csid_ver1_common_reg_info
352+
cam_csid_lite_17x_cmn_reg_info = {
344353
.hw_version_addr = 0x0,
345354
.cfg0_addr = 0x4,
346355
.ctrl_addr = 0x8,
@@ -360,8 +369,7 @@ static struct cam_ife_csid_ver1_common_reg_info
360369
.version_incr = 0,
361370
.num_rdis = 4,
362371
.num_pix = 0,
363-
.timestamp_strobe_val = 0x2,
364-
.timestamp_stb_sel_shift_val = 0,
372+
.num_ppp = 0,
365373
.rst_sw_reg_stb = 1,
366374
.rst_hw_reg_stb = 0x1e,
367375
.rst_sw_hw_reg_stb = 0x1f,
@@ -380,7 +388,11 @@ static struct cam_ife_csid_ver1_common_reg_info
380388
.crop_line_end_mask = 0xffff,
381389
.ipp_irq_mask_all = 0x7FFF,
382390
.rdi_irq_mask_all = 0x7FFF,
383-
.ppp_irq_mask_all = 0xFFFF,
391+
.ppp_irq_mask_all = 0x0,
392+
.measure_en_hbi_vbi_cnt_mask = 0xC,
393+
.measure_pixel_line_en_mask = 0x3,
394+
.timestamp_strobe_val = 0x2,
395+
.timestamp_stb_sel_shift_val = 0,
384396
.format_measure_height_mask_val = 0xFFFF,
385397
.format_measure_height_shift_val = 0x10,
386398
.format_measure_width_mask_val = 0xFFFF,

0 commit comments

Comments
 (0)