11// SPDX-License-Identifier: GPL-2.0-only
22/*
33 * Copyright (c) 2018-2021, The Linux Foundation. All rights reserved.
4- * Copyright (c) 2022-2024, Qualcomm Innovation Center , Inc. All rights reserved .
4+ * Copyright (c) Qualcomm Technologies , Inc. and/or its subsidiaries .
55 */
66
77#include <linux/ratelimit.h>
@@ -1284,9 +1284,6 @@ static int cam_vfe_bus_start_wm(
12841284 return - EINVAL ;
12851285 }
12861286 }
1287- /* enabling Wm configuratons are taken care in update_wm().
1288- * i.e enable wm only if io buffers are allocated
1289- */
12901287
12911288 CAM_DBG (CAM_ISP , "WM res %d width = %d, height = %d" , rsrc_data -> index ,
12921289 rsrc_data -> width , rsrc_data -> height );
@@ -1298,6 +1295,10 @@ static int cam_vfe_bus_start_wm(
12981295 rsrc_data -> index , (uint32_t ) rsrc_data -> hw_regs -> cfg ,
12991296 rsrc_data -> en_cfg );
13001297
1298+ /* enable wm at start */
1299+ cam_io_w_mb (rsrc_data -> en_cfg ,
1300+ common_data -> mem_base + rsrc_data -> hw_regs -> cfg );
1301+
13011302 wm_res -> res_state = CAM_ISP_RESOURCE_STATE_STREAMING ;
13021303
13031304 return rc ;
@@ -1464,20 +1465,31 @@ static int cam_vfe_bus_err_bottom_half(void *handler_priv,
14641465 if (val & 0x0800000 )
14651466 CAM_INFO (CAM_ISP , "DISP YC 16:1 violation" );
14661467
1467- cam_vfe_bus_put_evt_payload (common_data , & evt_payload );
1468+ err_evt_info .err_type = CAM_VFE_IRQ_STATUS_VIOLATION ;
1469+
1470+ if (evt_payload -> comp_error_status ) {
1471+ err_evt_info .err_type = CAM_VFE_IRQ_STATUS_ERR_COMP ;
1472+ val = evt_payload -> comp_error_status ;
1473+ CAM_ERR (CAM_ISP , "comp_error_status = 0x%x" , val );
1474+ }
1475+ if (evt_payload -> comp_overwrite_error_status ) {
1476+ err_evt_info .err_type = CAM_VFE_IRQ_STATUS_COMP_OWRT ;
1477+ val = evt_payload -> comp_overwrite_error_status ;
1478+ CAM_ERR (CAM_ISP , "comp_overwrite_error_status = 0x%x" , val );
1479+ }
14681480
14691481 evt_info .hw_type = CAM_ISP_HW_TYPE_VFE ;
14701482 evt_info .hw_idx = common_data -> core_index ;
14711483 evt_info .res_type = CAM_ISP_RESOURCE_VFE_OUT ;
14721484 evt_info .res_id = CAM_VFE_BUS_VER2_VFE_OUT_MAX ;
14731485
1474- err_evt_info .err_type = CAM_VFE_IRQ_STATUS_VIOLATION ;
14751486 evt_info .event_data = (void * )& err_evt_info ;
14761487
14771488 if (common_data -> event_cb )
14781489 common_data -> event_cb (NULL , CAM_ISP_HW_EVENT_ERROR ,
14791490 (void * )& evt_info );
14801491
1492+ cam_vfe_bus_put_evt_payload (common_data , & evt_payload );
14811493 return 0 ;
14821494}
14831495
@@ -1687,9 +1699,11 @@ static int cam_vfe_bus_acquire_comp_grp(
16871699 }
16881700 }
16891701
1690- CAM_DBG (CAM_ISP , "Comp Grp type %u" , rsrc_data -> comp_grp_type );
1691-
16921702 rsrc_data -> acquire_dev_cnt ++ ;
1703+
1704+ CAM_DBG (CAM_ISP , "Comp Grp id %d, bus_comp_grp_id %d, type %u, acquire_dev_cnt %d" ,
1705+ out_port_info -> comp_grp_id , bus_comp_grp_id ,
1706+ rsrc_data -> comp_grp_type , rsrc_data -> acquire_dev_cnt );
16931707 * comp_grp = comp_grp_local ;
16941708
16951709 return rc ;
@@ -1758,7 +1772,7 @@ static int cam_vfe_bus_release_comp_grp(
17581772 CAM_VFE_BUS_VER2_COMP_GRP_0 &&
17591773 in_rsrc_data -> comp_grp_type <=
17601774 CAM_VFE_BUS_VER2_COMP_GRP_5 )
1761- list_add_tail (& comp_grp -> list ,
1775+ list_add (& comp_grp -> list ,
17621776 & ver2_bus_priv -> free_comp_grp );
17631777 }
17641778
@@ -1992,6 +2006,7 @@ static int cam_vfe_bus_init_comp_grp(uint32_t index,
19922006 comp_grp -> res_state = CAM_ISP_RESOURCE_STATE_AVAILABLE ;
19932007 INIT_LIST_HEAD (& comp_grp -> list );
19942008
2009+ rsrc_data -> acquire_dev_cnt = 0 ;
19952010 rsrc_data -> comp_grp_type = index ;
19962011 rsrc_data -> common_data = & ver2_bus_priv -> common_data ;
19972012 rsrc_data -> hw_regs = & ver2_hw_info -> comp_grp_reg [index ];
@@ -2072,6 +2087,7 @@ static int cam_vfe_bus_acquire_vfe_out(void *bus_priv, void *acquire_args,
20722087 struct cam_vfe_hw_vfe_out_acquire_args * out_acquire_args ;
20732088 struct cam_isp_resource_node * rsrc_node = NULL ;
20742089 struct cam_vfe_bus_ver2_vfe_out_data * rsrc_data = NULL ;
2090+ struct cam_vfe_bus_ver2_comp_grp_data * comp_rsrc_data ;
20752091 uint32_t secure_caps = 0 , mode ;
20762092
20772093 if (!bus_priv || !acquire_args ) {
@@ -2162,6 +2178,10 @@ static int cam_vfe_bus_acquire_vfe_out(void *bus_priv, void *acquire_args,
21622178 vfe_out_res_id , rc );
21632179 return rc ;
21642180 }
2181+ comp_rsrc_data = rsrc_data -> comp_grp -> res_priv ;
2182+ out_acquire_args -> comp_grp_id = comp_rsrc_data -> comp_grp_type ;
2183+ CAM_DBG (CAM_ISP , "out_acquire_args->comp_grp_id %d" ,
2184+ out_acquire_args -> comp_grp_id );
21652185 }
21662186
21672187 /* Reserve WM */
@@ -2604,6 +2624,12 @@ static int cam_vfe_bus_error_irq_top_half(uint32_t evt_id,
26042624 evt_payload -> debug_status_0 = cam_io_r_mb (
26052625 bus_priv -> common_data .mem_base +
26062626 bus_priv -> common_data .common_reg -> debug_status_0 );
2627+ evt_payload -> comp_error_status = cam_io_r_mb (
2628+ bus_priv -> common_data .mem_base +
2629+ bus_priv -> common_data .common_reg -> comp_error_status );
2630+ evt_payload -> comp_overwrite_error_status = cam_io_r_mb (
2631+ bus_priv -> common_data .mem_base +
2632+ bus_priv -> common_data .common_reg -> comp_ovrwr_status );
26072633
26082634 th_payload -> evt_payload_priv = evt_payload ;
26092635
0 commit comments