From 2dc1ecbc90e77ca88f21f8fe7e78e62a1789dc8e Mon Sep 17 00:00:00 2001 From: Anand Ravi Date: Fri, 25 Feb 2022 09:58:16 -0800 Subject: [PATCH] msm: camera: isp: Add new WM port for VFE880 Add output port for STATS_ALSC for VFE880 and update all mappings associated with the port. CRs-Fixed: 3168484 Change-Id: I0a674e7d2d6fe5fa5a51ff31e22f066fa222e5b7 Signed-off-by: Anand Ravi --- drivers/cam_isp/cam_isp_context.c | 1 + .../cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe.c | 1 + .../isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.c | 10 +++++++++- .../isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.h | 2 ++ include/uapi/camera/media/cam_isp_ife.h | 2 ++ 5 files changed, 15 insertions(+), 1 deletion(-) diff --git a/drivers/cam_isp/cam_isp_context.c b/drivers/cam_isp/cam_isp_context.c index ebde7a79a1..c529b245ac 100644 --- a/drivers/cam_isp/cam_isp_context.c +++ b/drivers/cam_isp/cam_isp_context.c @@ -1037,6 +1037,7 @@ static char *__cam_isp_ife_sfe_resource_handle_id_to_type( case CAM_ISP_IFE_OUT_RES_STATS_CAF: return "IFE_STATS_CAF"; case CAM_ISP_IFE_OUT_RES_STATS_BAYER_RS: return "IFE_STATS_BAYER_RS"; case CAM_ISP_IFE_OUT_RES_PDAF_PARSED_DATA: return "IFE_PDAF_PARSED_DATA"; + case CAM_ISP_IFE_OUT_RES_STATS_ALSC: return "IFE_STATS_ALSC"; /* SFE output ports */ case CAM_ISP_SFE_OUT_RES_RDI_0: return "SFE_RDI_0"; case CAM_ISP_SFE_OUT_RES_RDI_1: return "SFE_RDI_1"; diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe.c index 86f6c98f6f..38548d13b8 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe17x/cam_vfe.c @@ -1,6 +1,7 @@ // SPDX-License-Identifier: GPL-2.0-only /* * Copyright (c) 2017-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #include diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.c b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.c index 69bf36cf13..a583093803 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.c +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.c @@ -323,6 +323,7 @@ static bool cam_vfe_bus_ver3_can_be_secure(uint32_t out_type) case CAM_VFE_BUS_VER3_VFE_OUT_STATS_IHIST: case CAM_VFE_BUS_VER3_VFE_OUT_STATS_CAF: case CAM_VFE_BUS_VER3_VFE_OUT_STATS_BAYER_RS: + case CAM_VFE_BUS_VER3_VFE_OUT_STATS_ALSC: default: return false; } @@ -438,6 +439,9 @@ static enum cam_vfe_bus_ver3_vfe_out_type case CAM_ISP_IFE_OUT_RES_PDAF_PARSED_DATA: vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_PDAF_PARSED; break; + case CAM_ISP_IFE_OUT_RES_STATS_ALSC: + vfe_out_type = CAM_VFE_BUS_VER3_VFE_OUT_STATS_ALSC; + break; default: CAM_WARN(CAM_ISP, "Invalid isp res id: %d , assigning max", res_type); @@ -560,6 +564,9 @@ static int cam_vfe_bus_ver3_get_comp_vfe_out_res_id_list( if (comp_mask & (BIT_ULL(CAM_VFE_BUS_VER3_VFE_OUT_PDAF_PARSED))) out_list[count++] = CAM_ISP_IFE_OUT_RES_PDAF_PARSED_DATA; + if (comp_mask & (BIT_ULL(CAM_VFE_BUS_VER3_VFE_OUT_STATS_ALSC))) + out_list[count++] = CAM_ISP_IFE_OUT_RES_STATS_ALSC; + *num_out = count; return 0; } @@ -1220,7 +1227,8 @@ static int cam_vfe_bus_ver3_acquire_wm( rsrc_data->width = rsrc_data->width / 2; rsrc_data->en_cfg = 0x1; - } else if (vfe_out_res_id == CAM_VFE_BUS_VER3_VFE_OUT_AWB_BFW) { + } else if ((vfe_out_res_id == CAM_VFE_BUS_VER3_VFE_OUT_AWB_BFW) || + (vfe_out_res_id == CAM_VFE_BUS_VER3_VFE_OUT_STATS_ALSC)) { switch (rsrc_data->format) { case CAM_FORMAT_PLAIN64: rsrc_data->width = 0; diff --git a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.h b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.h index 8b323105f9..d6da6628b7 100644 --- a/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.h +++ b/drivers/cam_isp/isp_hw_mgr/isp_hw/vfe_hw/vfe_bus/cam_vfe_bus_ver3.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* * Copyright (c) 2019-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ @@ -88,6 +89,7 @@ enum cam_vfe_bus_ver3_vfe_out_type { CAM_VFE_BUS_VER3_VFE_OUT_STATS_CAF, CAM_VFE_BUS_VER3_VFE_OUT_STATS_BAYER_RS, CAM_VFE_BUS_VER3_VFE_OUT_PDAF_PARSED, + CAM_VFE_BUS_VER3_VFE_OUT_STATS_ALSC, CAM_VFE_BUS_VER3_VFE_OUT_MAX, }; diff --git a/include/uapi/camera/media/cam_isp_ife.h b/include/uapi/camera/media/cam_isp_ife.h index 95d635fcf5..5bb8ff33b4 100644 --- a/include/uapi/camera/media/cam_isp_ife.h +++ b/include/uapi/camera/media/cam_isp_ife.h @@ -1,6 +1,7 @@ /* SPDX-License-Identifier: GPL-2.0-only WITH Linux-syscall-note */ /* * Copyright (c) 2016-2021, The Linux Foundation. All rights reserved. + * Copyright (c) 2022 Qualcomm Innovation Center, Inc. All rights reserved. */ #ifndef __UAPI_CAM_ISP_IFE_H__ @@ -45,6 +46,7 @@ #define CAM_ISP_IFE_OUT_RES_STATS_CAF (CAM_ISP_IFE_OUT_RES_BASE + 33) #define CAM_ISP_IFE_OUT_RES_STATS_BAYER_RS (CAM_ISP_IFE_OUT_RES_BASE + 34) #define CAM_ISP_IFE_OUT_RES_PDAF_PARSED_DATA (CAM_ISP_IFE_OUT_RES_BASE + 35) +#define CAM_ISP_IFE_OUT_RES_STATS_ALSC (CAM_ISP_IFE_OUT_RES_BASE + 36) /* IFE input port resource type (global unique) */ #define CAM_ISP_IFE_IN_RES_BASE 0x4000