|
@@ -1,6 +1,6 @@
|
|
|
// SPDX-License-Identifier: GPL-2.0-only
|
|
|
/*
|
|
|
- * Copyright (c) 2018-2019, The Linux Foundation. All rights reserved.
|
|
|
+ * Copyright (c) 2018-2020, The Linux Foundation. All rights reserved.
|
|
|
*/
|
|
|
|
|
|
#include <linux/slab.h>
|
|
@@ -36,6 +36,8 @@ struct cam_vfe_mux_fe_data {
|
|
|
uint32_t first_line;
|
|
|
uint32_t last_pixel;
|
|
|
uint32_t last_line;
|
|
|
+ uint32_t hbi_value;
|
|
|
+ uint32_t vbi_value;
|
|
|
bool enable_sof_irq_debug;
|
|
|
uint32_t irq_debug_cnt;
|
|
|
uint32_t fe_cfg_data;
|
|
@@ -179,6 +181,8 @@ int cam_vfe_fe_ver1_acquire_resource(
|
|
|
fe_data->last_pixel = acquire_data->vfe_in.in_port->left_stop;
|
|
|
fe_data->first_line = acquire_data->vfe_in.in_port->line_start;
|
|
|
fe_data->last_line = acquire_data->vfe_in.in_port->line_stop;
|
|
|
+ fe_data->hbi_value = 0;
|
|
|
+ fe_data->vbi_value = 0;
|
|
|
|
|
|
CAM_DBG(CAM_ISP, "hw id:%d pix_pattern:%d dsp_mode=%d",
|
|
|
fe_res->hw_intf->hw_idx,
|
|
@@ -302,16 +306,19 @@ static int cam_vfe_fe_resource_start(
|
|
|
CAM_VFE_TOP_VER2_MODULE_STATS]->cgc_ovd);
|
|
|
|
|
|
/* epoch config */
|
|
|
- epoch0_irq_mask = ((rsrc_data->last_line - rsrc_data->first_line) / 2) +
|
|
|
- rsrc_data->first_line;
|
|
|
+ epoch0_irq_mask = (((rsrc_data->last_line + rsrc_data->vbi_value) -
|
|
|
+ rsrc_data->first_line) / 2) + rsrc_data->first_line;
|
|
|
+ if (epoch0_irq_mask > rsrc_data->last_line)
|
|
|
+ epoch0_irq_mask = rsrc_data->last_line;
|
|
|
|
|
|
epoch1_irq_mask = rsrc_data->reg_data->epoch_line_cfg & 0xFFFF;
|
|
|
computed_epoch_line_cfg = (epoch0_irq_mask << 16) | epoch1_irq_mask;
|
|
|
cam_io_w_mb(computed_epoch_line_cfg,
|
|
|
rsrc_data->mem_base + rsrc_data->fe_reg->epoch_irq);
|
|
|
- CAM_DBG(CAM_ISP, "first_line:0x%x last_line:0x%x epoch_line_cfg: 0x%x",
|
|
|
+ CAM_DBG(CAM_ISP,
|
|
|
+ "first_line:0x%x last_line:0x%x vbi:0x%x epoch_line_cfg: 0x%x",
|
|
|
rsrc_data->first_line, rsrc_data->last_line,
|
|
|
- computed_epoch_line_cfg);
|
|
|
+ rsrc_data->vbi_value, computed_epoch_line_cfg);
|
|
|
|
|
|
fe_res->res_state = CAM_ISP_RESOURCE_STATE_STREAMING;
|
|
|
|
|
@@ -446,6 +453,23 @@ static int cam_vfe_fe_sof_irq_debug(
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
+static int cam_vfe_fe_blanking_update(
|
|
|
+ struct cam_isp_resource_node *rsrc_node, void *cmd_args)
|
|
|
+{
|
|
|
+ struct cam_vfe_mux_fe_data *fe_priv =
|
|
|
+ (struct cam_vfe_mux_fe_data *)rsrc_node->res_priv;
|
|
|
+
|
|
|
+ struct cam_isp_blanking_config *blanking_config =
|
|
|
+ (struct cam_isp_blanking_config *)cmd_args;
|
|
|
+
|
|
|
+ fe_priv->hbi_value = blanking_config->hbi;
|
|
|
+ fe_priv->vbi_value = blanking_config->vbi;
|
|
|
+ CAM_DBG(CAM_ISP, "hbi:%d vbi:%d",
|
|
|
+ fe_priv->hbi_value, fe_priv->vbi_value);
|
|
|
+
|
|
|
+ return 0;
|
|
|
+}
|
|
|
+
|
|
|
static int cam_vfe_fe_process_cmd(struct cam_isp_resource_node *rsrc_node,
|
|
|
uint32_t cmd_type, void *cmd_args, uint32_t arg_size)
|
|
|
{
|
|
@@ -467,6 +491,9 @@ static int cam_vfe_fe_process_cmd(struct cam_isp_resource_node *rsrc_node,
|
|
|
case CAM_ISP_HW_CMD_FE_UPDATE_IN_RD:
|
|
|
rc = cam_vfe_fe_update(rsrc_node, cmd_args, arg_size);
|
|
|
break;
|
|
|
+ case CAM_ISP_HW_CMD_BLANKING_UPDATE:
|
|
|
+ rc = cam_vfe_fe_blanking_update(rsrc_node, cmd_args);
|
|
|
+ break;
|
|
|
default:
|
|
|
CAM_ERR(CAM_ISP,
|
|
|
"unsupported process command:%d", cmd_type);
|