From 50fd3a70d1352210022e66db15ccf9c4accabfac Mon Sep 17 00:00:00 2001 From: Ravikishore Pampana Date: Thu, 31 Oct 2019 11:36:50 +0530 Subject: [PATCH] msm: camera: tfe: Configure TPG hbi and vbi User space will send HBI and VBI values for tpg. Configure the TPG HBI and VBI values based on the user space given values. If user space does not send then configure the default values. Assign the isp context variable in the hw update data during the tfe hw config. Update proper comp group id for slave tfe. CRs-Fixed: 2594541 Change-Id: I2771d3c663c0fcb58306952f161c11a473846f8d Signed-off-by: Ravikishore Pampana --- drivers/cam_isp/isp_hw_mgr/cam_tfe_hw_mgr.c | 1 + .../isp_hw_mgr/isp_hw/tfe_hw/cam_tfe_bus.c | 1 + .../isp_hw/top_tpg/cam_top_tpg_core.c | 24 ++++++++++++++----- 3 files changed, 20 insertions(+), 6 deletions(-) diff --git a/drivers/cam_isp/isp_hw_mgr/cam_tfe_hw_mgr.c b/drivers/cam_isp/isp_hw_mgr/cam_tfe_hw_mgr.c index bac81f24363c..a83f2c5dd61d 100644 --- a/drivers/cam_isp/isp_hw_mgr/cam_tfe_hw_mgr.c +++ b/drivers/cam_isp/isp_hw_mgr/cam_tfe_hw_mgr.c @@ -2348,6 +2348,7 @@ static int cam_tfe_mgr_config_hw(void *hw_mgr_priv, return -EINVAL; hw_update_data = (struct cam_isp_prepare_hw_update_data *) cfg->priv; + hw_update_data->isp_mgr_ctx = ctx; for (i = 0; i < CAM_TFE_HW_NUM_MAX; i++) { if (hw_update_data->bw_config_valid[i] == true) { diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_hw/cam_tfe_bus.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_hw/cam_tfe_bus.c index fc4e465d03cf..0df57a450ed0 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_hw/cam_tfe_bus.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/tfe_hw/cam_tfe_bus.c @@ -933,6 +933,7 @@ static int cam_tfe_bus_start_comp_grp( val = cam_io_r(common_data->mem_base + common_data->common_reg->comp_cfg_0); val |= (0x1 << rsrc_data->comp_grp_id); + val |= (0x1 << (rsrc_data->comp_grp_id + 16)); cam_io_w(val, common_data->mem_base + common_data->common_reg->comp_cfg_0); diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/top_tpg/cam_top_tpg_core.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/top_tpg/cam_top_tpg_core.c index 4ea425df1ea8..6a544faf548f 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/top_tpg/cam_top_tpg_core.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/top_tpg/cam_top_tpg_core.c @@ -444,17 +444,29 @@ static int cam_top_tpg_start(void *hw_priv, void *start_args, tpg_reg->tpg_num_dts_shift_val) | tpg_data->vc_num; cam_io_w_mb(val, soc_info->reg_map[0].mem_base + tpg_reg->tpg_vc_cfg0); - /* HBlank count 500 and V blank count is 600 */ - cam_io_w_mb(0x2581F4, + /* + * if hblank is notset configureHBlank count 500 and + * V blank count is 600 + */ + + if (tpg_data->h_blank_count) + cam_io_w_mb(tpg_data->h_blank_count, + soc_info->reg_map[0].mem_base + tpg_reg->tpg_vc_cfg1); + else + cam_io_w_mb(0x2581F4, soc_info->reg_map[0].mem_base + tpg_reg->tpg_vc_cfg1); val = (1 << tpg_reg->tpg_split_en_shift); cam_io_w_mb(tpg_data->pix_pattern, soc_info->reg_map[0].mem_base + tpg_reg->tpg_common_gen_cfg); - cam_io_w_mb(0xAFFF, - soc_info->reg_map[0].mem_base + tpg_reg->tpg_vbi_cfg); - CAM_DBG(CAM_ISP, "TPG:%d set TPG VBI to 0xAFFF", - tpg_hw->hw_intf->hw_idx); + + /* if VBI is notset configureVBI to 0xAFF */ + if (tpg_data->v_blank_count) + cam_io_w_mb(tpg_data->v_blank_count, + soc_info->reg_map[0].mem_base + tpg_reg->tpg_vbi_cfg); + else + cam_io_w_mb(0xAFFF, + soc_info->reg_map[0].mem_base + tpg_reg->tpg_vbi_cfg); /* Set the TOP tpg mux sel*/ cam_io_w_mb((1 << tpg_hw->hw_intf->hw_idx),