Skip to content

Commit fbce521

Browse files
Camera Software IntegrationGerrit - the friendly Code Review server
authored andcommitted
Merge "msm: camera: isp: fix csid camif and vfe headers for qcs615" into camera-kernel.qclinux.1.0
2 parents ce32386 + 19a54d2 commit fbce521

7 files changed

Lines changed: 132 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
@@ -17033,20 +17033,20 @@ static int cam_ife_hw_mgr_handle_hw_buf_done(
1703317033
CAM_DBG(CAM_ISP,
1703417034
"Buf done for %s: %d res_id: 0x%x last consumed addr: 0x%x ctx: %u",
1703517035
((event_info->hw_type == CAM_ISP_HW_TYPE_SFE) ? "SFE" : "IFE"),
17036-
event_info->hw_idx, event_info->res_id,
17036+
event_info->hw_idx, bufdone_evt_info->res_id,
1703717037
bufdone_evt_info->last_consumed_addr, c_ctx->ctx_index);
1703817038

1703917039
/* Check scratch for sHDR/FS use-cases */
1704017040
if (c_ctx->flags.is_sfe_fs || c_ctx->flags.is_sfe_shdr) {
1704117041
rc = cam_ife_hw_mgr_check_for_scratch_buf_done(ife_hw_mgr_ctx,
17042-
event_info->hw_type, event_info->res_id,
17042+
event_info->hw_type, bufdone_evt_info->res_id,
1704317043
bufdone_evt_info->last_consumed_addr);
1704417044
if (rc)
1704517045
return 0;
1704617046
}
1704717047

1704817048
buf_done_event_data.hw_type = event_info->hw_type;
17049-
buf_done_event_data.resource_handle = event_info->res_id;
17049+
buf_done_event_data.resource_handle = bufdone_evt_info->res_id;
1705017050
buf_done_event_data.last_consumed_addr = bufdone_evt_info->last_consumed_addr;
1705117051
buf_done_event_data.comp_group_id = bufdone_evt_info->comp_grp_id;
1705217052

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

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static struct cam_ife_csid_ver1_path_reg_info
6565
.halt_immediate = 2,
6666
.halt_cmd_shift = 0,
6767
.early_eof_en_shift_val = 29,
68-
.timestamp_en_shift_val = 2,
68+
.timestamp_en_shift_val = 1,
6969
.format_measure_en_shift_val = 0,
7070
.fatal_err_mask = 0x4,
7171
.non_fatal_err_mask = 0xe000,
@@ -121,7 +121,7 @@ static struct cam_ife_csid_ver1_path_reg_info
121121
.plain_fmt_shift_val = 10,
122122
.crop_v_en_shift_val = 6,
123123
.crop_h_en_shift_val = 5,
124-
.timestamp_en_shift_val = 1,
124+
.timestamp_en_shift_val = 2,
125125
.format_measure_en_shift_val = 1,
126126
.fatal_err_mask = 0x4,
127127
.non_fatal_err_mask = 0xe000,
@@ -177,7 +177,7 @@ static struct cam_ife_csid_ver1_path_reg_info
177177
.plain_fmt_shift_val = 10,
178178
.crop_v_en_shift_val = 6,
179179
.crop_h_en_shift_val = 5,
180-
.timestamp_en_shift_val = 1,
180+
.timestamp_en_shift_val = 2,
181181
.format_measure_en_shift_val = 1,
182182
.fatal_err_mask = 0x4,
183183
.non_fatal_err_mask = 0xe000,
@@ -234,7 +234,7 @@ static struct cam_ife_csid_ver1_path_reg_info
234234
.plain_fmt_shift_val = 10,
235235
.crop_v_en_shift_val = 6,
236236
.crop_h_en_shift_val = 5,
237-
.timestamp_en_shift_val = 1,
237+
.timestamp_en_shift_val = 2,
238238
.format_measure_en_shift_val = 1,
239239
.fatal_err_mask = 0x4,
240240
.non_fatal_err_mask = 0xe000,
@@ -386,6 +386,7 @@ static struct cam_ife_csid_ver1_common_reg_info
386386
.rdi_irq_mask_all = 0x7FFF,
387387
.ppp_irq_mask_all = 0x0,
388388
.measure_en_hbi_vbi_cnt_mask = 0xC,
389+
.measure_pixel_line_en_mask = 0x3,
389390
.timestamp_strobe_val = 0x2,
390391
.timestamp_stb_sel_shift_val = 0,
391392
.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
@@ -3470,6 +3470,7 @@ static int cam_ife_csid_ver1_get_time_stamp(
34703470
struct cam_ife_csid_ver1_reg_info *csid_reg;
34713471
struct timespec64 ts;
34723472
uint32_t curr_0_sof_addr, curr_1_sof_addr;
3473+
uint32_t prev_0_sof_addr, prev_1_sof_addr;
34733474

34743475
timestamp_args = (struct cam_csid_get_time_stamp_args *)cmd_args;
34753476
res = timestamp_args->node_res;
@@ -3496,10 +3497,14 @@ static int cam_ife_csid_ver1_get_time_stamp(
34963497
case CAM_IFE_PIX_PATH_RES_IPP:
34973498
curr_0_sof_addr = csid_reg->ipp_reg->timestamp_curr0_sof_addr;
34983499
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;
34993502
break;
35003503
case CAM_IFE_PIX_PATH_RES_PPP:
35013504
curr_0_sof_addr = csid_reg->ppp_reg->timestamp_curr0_sof_addr;
35023505
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;
35033508
break;
35043509
case CAM_IFE_PIX_PATH_RES_RDI_0:
35053510
case CAM_IFE_PIX_PATH_RES_RDI_1:
@@ -3512,13 +3517,30 @@ static int cam_ife_csid_ver1_get_time_stamp(
35123517
curr_1_sof_addr =
35133518
csid_reg->rdi_reg
35143519
[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;
35153526
break;
35163527
default:
35173528
CAM_ERR(CAM_ISP, "CSID:%d invalid res %d",
35183529
csid_hw->hw_intf->hw_idx, res->res_id);
35193530
return -EINVAL;
35203531
}
35213532

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+
35223544
time_hi = cam_io_r_mb(soc_info->reg_map[0].mem_base +
35233545
curr_1_sof_addr);
35243546
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: 45 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,19 @@
33
* Copyright (c) 2017-2020, The Linux Foundation. All rights reserved.
44
* Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
55
*/
6-
76
#ifndef _CAM_IFE_CSID_LITE17X_H_
87
#define _CAM_IFE_CSID_LITE17X_H_
98

10-
#include "cam_ife_csid_dev.h"
9+
#include <linux/module.h>
1110
#include "cam_ife_csid_common.h"
1211
#include "cam_ife_csid_hw_ver1.h"
12+
#include "cam_ife_csid_dev.h"
13+
#include "camera_main.h"
1314

1415
#define CAM_CSID_LITE_DRV_NAME "csid_lite"
1516

16-
static struct cam_ife_csid_ver1_path_reg_info
17-
cam_ife_csid_lite_17x_rdi_0_reg_info = {
18-
17+
static struct cam_ife_csid_ver1_path_reg_info
18+
cam_ife_csid_lite_17x_rdi_0_reg_info = {
1919
.irq_status_addr = 0x30,
2020
.irq_mask_addr = 0x34,
2121
.irq_clear_addr = 0x38,
@@ -52,8 +52,11 @@ static struct cam_ife_csid_ver1_path_reg_info
5252
.timestamp_curr1_eof_addr = 0x2a4,
5353
.timestamp_prev0_eof_addr = 0x2a8,
5454
.timestamp_prev1_eof_addr = 0x2ac,
55+
/* configurations */
5556
.byte_cntr_ping_addr = 0x2e0,
5657
.byte_cntr_pong_addr = 0x2e4,
58+
.crop_v_en_shift_val = 6,
59+
.crop_h_en_shift_val = 5,
5760
.halt_mode_internal = 0,
5861
.halt_mode_global = 1,
5962
.halt_mode_shift = 2,
@@ -63,17 +66,14 @@ static struct cam_ife_csid_ver1_path_reg_info
6366
.halt_cmd_shift = 0,
6467
.packing_fmt_shift_val = 30,
6568
.plain_fmt_shift_val = 10,
66-
.crop_v_en_shift_val = 6,
67-
.crop_h_en_shift_val = 5,
6869
.timestamp_en_shift_val = 2,
6970
.format_measure_en_shift_val = 1,
70-
.fatal_err_mask = 0x4,
71+
.fatal_err_mask = 0x6004,
7172
.non_fatal_err_mask = 0xe000,
7273
};
7374

74-
static struct cam_ife_csid_ver1_path_reg_info
75-
cam_ife_csid_lite_17x_rdi_1_reg_info = {
76-
75+
static struct cam_ife_csid_ver1_path_reg_info
76+
cam_ife_csid_lite_17x_rdi_1_reg_info = {
7777
.irq_status_addr = 0x40,
7878
.irq_mask_addr = 0x44,
7979
.irq_clear_addr = 0x48,
@@ -125,11 +125,12 @@ static struct cam_ife_csid_ver1_path_reg_info
125125
.crop_h_en_shift_val = 5,
126126
.timestamp_en_shift_val = 2,
127127
.format_measure_en_shift_val = 1,
128+
.fatal_err_mask = 0x4,
129+
.non_fatal_err_mask = 0xe000,
128130
};
129131

130-
static struct cam_ife_csid_ver1_path_reg_info
131-
cam_ife_csid_lite_17x_rdi_2_reg_info = {
132-
132+
static struct cam_ife_csid_ver1_path_reg_info
133+
cam_ife_csid_lite_17x_rdi_2_reg_info = {
133134
.irq_status_addr = 0x50,
134135
.irq_mask_addr = 0x54,
135136
.irq_clear_addr = 0x58,
@@ -182,11 +183,12 @@ static struct cam_ife_csid_ver1_path_reg_info
182183
.crop_h_en_shift_val = 5,
183184
.timestamp_en_shift_val = 2,
184185
.format_measure_en_shift_val = 1,
186+
.fatal_err_mask = 0x4,
187+
.non_fatal_err_mask = 0xe000,
185188
};
186189

187-
static struct cam_ife_csid_ver1_path_reg_info
188-
cam_ife_csid_lite_17x_rdi_3_reg_info = {
189-
190+
static struct cam_ife_csid_ver1_path_reg_info
191+
cam_ife_csid_lite_17x_rdi_3_reg_info = {
190192
.irq_status_addr = 0x60,
191193
.irq_mask_addr = 0x64,
192194
.irq_clear_addr = 0x68,
@@ -239,16 +241,16 @@ static struct cam_ife_csid_ver1_path_reg_info
239241
.crop_h_en_shift_val = 5,
240242
.timestamp_en_shift_val = 2,
241243
.format_measure_en_shift_val = 1,
244+
.fatal_err_mask = 0x4,
245+
.non_fatal_err_mask = 0xe000,
242246
};
243247

244-
static struct cam_ife_csid_csi2_rx_reg_info
245-
cam_ife_csid_lite_17x_csi2_reg_info = {
246-
248+
static struct cam_ife_csid_csi2_rx_reg_info
249+
cam_ife_csid_lite_17x_csi2_reg_info = {
247250
.irq_status_addr = 0x20,
248251
.irq_mask_addr = 0x24,
249252
.irq_clear_addr = 0x28,
250253
.irq_set_addr = 0x2c,
251-
252254
/*CSI2 rx control */
253255
.cfg0_addr = 0x100,
254256
.cfg1_addr = 0x104,
@@ -286,14 +288,23 @@ static struct cam_ife_csid_csi2_rx_reg_info
286288
.capture_cphy_pkt_dt_shift = 20,
287289
.capture_cphy_pkt_vc_shift = 26,
288290
.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,
289301
.fatal_err_mask = 0x78000,
290302
.part_fatal_err_mask = 0x1801800,
291303
.non_fatal_err_mask = 0x380000,
292304
};
293305

294-
295306
static struct cam_ife_csid_ver1_tpg_reg_info
296-
cam_ife_csid_lite_17x_tpg_reg_info = {
307+
cam_ife_csid_lite_17x_tpg_reg_info = {
297308
/*CSID TPG control */
298309
.ctrl_addr = 0x600,
299310
.vc_cfg0_addr = 0x604,
@@ -312,21 +323,20 @@ static struct cam_ife_csid_ver1_tpg_reg_info
312323
.cgen_n_xy_addr = 0x660,
313324
.cgen_n_y1_addr = 0x664,
314325
.cgen_n_y2_addr = 0x668,
315-
316326
/* configurations */
317327
.dtn_cfg_offset = 0xc,
318328
.cgen_cfg_offset = 0x20,
319329
.cpas_ife_reg_offset = 0x28,
320330
.hbi = 0x740,
321331
.vbi = 0x3FF,
322-
.ctrl_cfg = 0x408007,
323332
.lfsr_seed = 0x12345678,
333+
.ctrl_cfg = 0x408007,
334+
.line_interleave_mode = 0x1,
324335
.color_bar = 1,
325336
.num_frames = 0,
326-
.line_interleave_mode = 0x1,
337+
.num_active_dt = 0,
327338
.payload_mode = 0x8,
328339
.num_active_lanes_mask = 0x30,
329-
.num_active_dt = 0,
330340
.fmt_shift = 16,
331341
.num_frame_shift = 16,
332342
.width_shift = 16,
@@ -338,10 +348,8 @@ static struct cam_ife_csid_ver1_tpg_reg_info
338348
.hbi_shift = 0,
339349
};
340350

341-
342-
static struct cam_ife_csid_ver1_common_reg_info
343-
cam_csid_lite_17x_cmn_reg_info = {
344-
351+
static struct cam_ife_csid_ver1_common_reg_info
352+
cam_csid_lite_17x_cmn_reg_info = {
345353
.hw_version_addr = 0x0,
346354
.cfg0_addr = 0x4,
347355
.ctrl_addr = 0x8,
@@ -361,8 +369,7 @@ static struct cam_ife_csid_ver1_common_reg_info
361369
.version_incr = 0,
362370
.num_rdis = 4,
363371
.num_pix = 0,
364-
.timestamp_strobe_val = 0x2,
365-
.timestamp_stb_sel_shift_val = 0,
372+
.num_ppp = 0,
366373
.rst_sw_reg_stb = 1,
367374
.rst_hw_reg_stb = 0x1e,
368375
.rst_sw_hw_reg_stb = 0x1f,
@@ -381,7 +388,11 @@ static struct cam_ife_csid_ver1_common_reg_info
381388
.crop_line_end_mask = 0xffff,
382389
.ipp_irq_mask_all = 0x7FFF,
383390
.rdi_irq_mask_all = 0x7FFF,
384-
.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,
385396
.format_measure_height_mask_val = 0xFFFF,
386397
.format_measure_height_shift_val = 0x10,
387398
.format_measure_width_mask_val = 0xFFFF,

0 commit comments

Comments
 (0)