From 1b89b74b0a55b68ac4c06061a228101e9150b419 Mon Sep 17 00:00:00 2001 From: Karthik Anantha Ram Date: Wed, 2 Jun 2021 12:51:11 -0700 Subject: [PATCH] msm: camera: isp: Add support for vertical binning in CSID Add support to obtain hint from userland to enable binning in either direction. The change updates the existing binning field in UAPI to provide provision for both vertical & horizontal binning options. CRs-Fixed: 2841729 Change-Id: I37958d648ed4387d9e2bff8bcff8ffd39801baa3 Signed-off-by: Karthik Anantha Ram --- drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c | 3 ++- .../isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c | 1 + .../cam_isp/isp_hw_mgr/isp_hw/include/cam_ife_csid_hw_intf.h | 1 + include/uapi/camera/media/cam_isp.h | 5 +++-- 4 files changed, 7 insertions(+), 3 deletions(-) diff --git a/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c b/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c index 439a2ea815..6393433429 100644 --- a/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c +++ b/drivers/cam_isp/isp_hw_mgr/cam_ife_hw_mgr.c @@ -4586,7 +4586,8 @@ static int cam_ife_mgr_acquire_get_unified_structure_v2( in_port->fe_unpacker_fmt = in->format; in_port->hbi_cnt = in->hbi_cnt; in_port->cust_node = in->cust_node; - in_port->horizontal_bin = in->horizontal_bin; + in_port->horizontal_bin = (in->bidirectional_bin & 0xFFFF); + in_port->vertical_bin = (in->bidirectional_bin >> 16); in_port->qcfa_bin = in->qcfa_bin; in_port->num_out_res = in->num_out_res; in_port->sfe_in_path_type = (in->sfe_in_path_type & 0xFFFF); diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c index 8e55f0f865..1059618f9a 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/ife_csid_hw/cam_ife_csid_hw_ver2.c @@ -1932,6 +1932,7 @@ static int cam_ife_csid_hw_ver2_config_path_data( path_cfg->crop_enable = reserve->crop_enable; path_cfg->drop_enable = reserve->drop_enable; path_cfg->horizontal_bin = reserve->in_port->horizontal_bin; + path_cfg->vertical_bin = reserve->in_port->vertical_bin; path_cfg->qcfa_bin = reserve->in_port->qcfa_bin; path_cfg->num_bytes_out = reserve->in_port->num_bytes_out; path_cfg->pix_pattern = reserve->in_port->test_pattern; diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/include/cam_ife_csid_hw_intf.h b/drivers/cam_isp/isp_hw_mgr/isp_hw/include/cam_ife_csid_hw_intf.h index ae37ee19e3..fe6082bb79 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/include/cam_ife_csid_hw_intf.h +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/include/cam_ife_csid_hw_intf.h @@ -120,6 +120,7 @@ struct cam_isp_in_port_generic_info { uint32_t cust_node; uint32_t num_out_res; uint32_t horizontal_bin; + uint32_t vertical_bin; uint32_t qcfa_bin; uint32_t num_bytes_out; uint32_t ipp_count; diff --git a/include/uapi/camera/media/cam_isp.h b/include/uapi/camera/media/cam_isp.h index 5716aea8bf..1d12d3e67a 100644 --- a/include/uapi/camera/media/cam_isp.h +++ b/include/uapi/camera/media/cam_isp.h @@ -363,7 +363,8 @@ struct cam_isp_in_port_info { * @hbi_cnt: HBI count for the camif input * @cust_node: if any custom HW block is present before IFE * @num_out_res: number of the output resource associated - * @horizontal_bin: Horizontal Binning info + * @bidirectional_bin: [0 : 15] - Set 1 for Horizontal binning + * [16 : 31] - Set 1 for Vertical binning * @qcfa_bin: Quadra Binning info * @sfe_in_path_type: SFE input path type * 0:15 - refer to cam_isp_sfe.h for SFE paths @@ -405,7 +406,7 @@ struct cam_isp_in_port_info_v2 { __u32 cust_node; __u32 num_out_res; __u32 offline_mode; - __u32 horizontal_bin; + __u32 bidirectional_bin; __u32 qcfa_bin; __u32 sfe_in_path_type; __u32 feature_flag;