diff --git a/qcom/opensource/camera-kernel/Makefile b/qcom/opensource/camera-kernel/Makefile index a4410d68b3..bf6980b393 100644 --- a/qcom/opensource/camera-kernel/Makefile +++ b/qcom/opensource/camera-kernel/Makefile @@ -4,10 +4,16 @@ KBUILD_OPTIONS += CAMERA_KERNEL_ROOT=$(KERNEL_SRC)/$(M) KBUILD_OPTIONS += KERNEL_ROOT=$(KERNEL_SRC) KBUILD_OPTIONS += MODNAME=camera KBUILD_OPTIONS += BOARD_PLATFORM=pineapple +KBUILD_OPTIONS += CONFIG_QCOM_SMCINVOKE=m +KBUILD_OPTIONS += TARGET_SYNX_ENABLE=m +KBUILD_OPTIONS += CONFIG_MSM_MMRM=y +KBUILD_OPTIONS += CONFIG_MSM_MMRM_VM=n +KBUILD_OPTIONS += CONFIG_QTI_SMMU_PROXY=m KBUILD_EXTRA_SYMBOLS := \ $(OUT_DIR)/../sm8650-modules/qcom/opensource/mmrm-driver/Module.symvers \ - $(OUT_DIR)/../sm8650-modules/qcom/opensource/securemsm-kernel/Module.symvers + $(OUT_DIR)/../sm8650-modules/qcom/opensource/securemsm-kernel/Module.symvers \ + $(OUT_DIR)/../sm8650-modules/qcom/opensource/synx-kernel/Module.symvers all: modules diff --git a/qcom/opensource/mmrm-driver/driver/src/mmrm_clk_rsrc_mgr_sw.c b/qcom/opensource/mmrm-driver/driver/src/mmrm_clk_rsrc_mgr_sw.c index 40326fa628..6ead997dbc 100644 --- a/qcom/opensource/mmrm-driver/driver/src/mmrm_clk_rsrc_mgr_sw.c +++ b/qcom/opensource/mmrm-driver/driver/src/mmrm_clk_rsrc_mgr_sw.c @@ -621,6 +621,7 @@ static int mmrm_sw_throttle_low_priority_client( { int rc = 0, i; u64 start_ts = 0, end_ts = 0; + bool found_client_throttle = false; struct mmrm_sw_clk_client_tbl_entry *tbl_entry_throttle_client; struct mmrm_client_notifier_data notifier_data; struct completion timeout; @@ -635,32 +636,37 @@ static int mmrm_sw_throttle_low_priority_client( for (i = 0; i < sinfo->throttle_clients_data_length ; i++) { tbl_entry_throttle_client = &sinfo->clk_client_tbl[sinfo->throttle_clients_info[i].tbl_entry_id]; + if (!IS_ERR_OR_NULL(tbl_entry_throttle_client)) { + now_cur_ma = tbl_entry_throttle_client->current_ma + [tbl_entry_throttle_client->vdd_level] + [peak_data->aggreg_level]; + min_cur_ma = tbl_entry_throttle_client->current_ma[clk_min_level] + [peak_data->aggreg_level]; - if (IS_ERR_OR_NULL(tbl_entry_throttle_client)) - continue; + d_mpr_h("%s:csid(0x%x) name(%s)\n", + __func__, tbl_entry_throttle_client->clk_src_id, + tbl_entry_throttle_client->name); + d_mpr_h("%s:now_cur_ma(%llu) min_cur_ma(%llu) delta_cur(%d)\n", + __func__, now_cur_ma, min_cur_ma, *delta_cur); - now_cur_ma = tbl_entry_throttle_client->current_ma - [tbl_entry_throttle_client->vdd_level] - [peak_data->aggreg_level]; - min_cur_ma = tbl_entry_throttle_client->current_ma[clk_min_level] - [peak_data->aggreg_level]; - - d_mpr_h("%s:csid(0x%x) name(%s)\n", - __func__, tbl_entry_throttle_client->clk_src_id, - tbl_entry_throttle_client->name); - d_mpr_h("%s:now_cur_ma(%llu) min_cur_ma(%llu) delta_cur(%d)\n", - __func__, now_cur_ma, min_cur_ma, *delta_cur); - - if ((now_cur_ma <= min_cur_ma) || (now_cur_ma - min_cur_ma <= *delta_cur)) - continue; - - d_mpr_h("%s: Throttle client csid(0x%x) name(%s)\n", - __func__, tbl_entry_throttle_client->clk_src_id, - tbl_entry_throttle_client->name); - d_mpr_h("%s:now_cur_ma %llu-min_cur_ma %llu>delta_cur %d\n", - __func__, now_cur_ma, min_cur_ma, *delta_cur); + if ((now_cur_ma > min_cur_ma) + && (now_cur_ma - min_cur_ma > *delta_cur)) { + found_client_throttle = true; + d_mpr_h("%s: Throttle client csid(0x%x) name(%s)\n", + __func__, tbl_entry_throttle_client->clk_src_id, + tbl_entry_throttle_client->name); + d_mpr_h("%s:now_cur_ma %llu-min_cur_ma %llu>delta_cur %d\n", + __func__, now_cur_ma, min_cur_ma, *delta_cur); + /* found client to throttle, break from here. */ + break; + } + } + } + /*Client to throttle is found, Throttle this client now to minimum clock rate*/ + if (found_client_throttle) { /* Setup notifier */ + notifier_data.cb_type = MMRM_CLIENT_RESOURCE_VALUE_CHANGE; notifier_data.cb_data.val_chng.old_val = tbl_entry_throttle_client->freq[tbl_entry_throttle_client->vdd_level]; @@ -679,7 +685,8 @@ static int mmrm_sw_throttle_low_priority_client( if (rc) { d_mpr_e("%s: Client failed to send SUCCESS in callback(%d)\n", __func__, tbl_entry_throttle_client->clk_src_id); - continue; + rc = -EINVAL; + goto err_clk_set_fail; } if ((end_ts - start_ts) > NOTIFY_TIMEOUT) @@ -692,7 +699,8 @@ static int mmrm_sw_throttle_low_priority_client( if (rc) { d_mpr_e("%s: Failed to throttle the clk csid(%d)\n", __func__, tbl_entry_throttle_client->clk_src_id); - continue; + rc = -EINVAL; + goto err_clk_set_fail; } } @@ -722,10 +730,8 @@ static int mmrm_sw_throttle_low_priority_client( /* Clearing the reserve flag */ tbl_entry_throttle_client->reserve = false; - - break; } - +err_clk_set_fail: return rc; } diff --git a/qcom/opensource/mmrm-driver/driver/src/mmrm_internal.c b/qcom/opensource/mmrm-driver/driver/src/mmrm_internal.c index acf059a7d0..86c279787f 100644 --- a/qcom/opensource/mmrm-driver/driver/src/mmrm_internal.c +++ b/qcom/opensource/mmrm-driver/driver/src/mmrm_internal.c @@ -19,7 +19,7 @@ static struct mmrm_common_data common_pt_data[] = { /*throttle client list is as per fdd & resource availability*/ -static struct mmrm_throttle_clients_data common_pt_throttle_clients_data_pineapple[] = { +static struct mmrm_throttle_clients_data common_pt_throttle_clients_data[] = { { .domain = MMRM_CLIENT_DOMAIN_DISPLAY, .id = 0x3e, @@ -42,59 +42,25 @@ static struct mmrm_throttle_clients_data common_pt_throttle_clients_data_pineapp }, }; -static struct mmrm_throttle_clients_data common_pt_throttle_clients_data_cliffs[] = { - { - .domain = MMRM_CLIENT_DOMAIN_DISPLAY, - .id = 0x3e, - }, - { - .domain = MMRM_CLIENT_DOMAIN_VIDEO, - .id = 0x03, - }, - { - .domain = MMRM_CLIENT_DOMAIN_CAMERA, - .id = 0x62, - }, - { - .domain = MMRM_CLIENT_DOMAIN_CVP, - .id = 0x0a, - }, - { - .domain = MMRM_CLIENT_DOMAIN_CAMERA, - .id = 0x17, - }, -}; - -static struct mmrm_platform_data commom_pt_platform_data_pineapple = { +static struct mmrm_platform_data commom_pt_platform_data = { .common_data = common_pt_data, .common_data_length = ARRAY_SIZE(common_pt_data), - .throttle_clk_clients_data = common_pt_throttle_clients_data_pineapple, - .throttle_clk_clients_data_length = ARRAY_SIZE(common_pt_throttle_clients_data_pineapple), -}; - -static struct mmrm_platform_data commom_pt_platform_data_cliffs = { - .common_data = common_pt_data, - .common_data_length = ARRAY_SIZE(common_pt_data), - .throttle_clk_clients_data = common_pt_throttle_clients_data_cliffs, - .throttle_clk_clients_data_length = ARRAY_SIZE(common_pt_throttle_clients_data_cliffs), + .throttle_clk_clients_data = common_pt_throttle_clients_data, + .throttle_clk_clients_data_length = ARRAY_SIZE(common_pt_throttle_clients_data), }; static const struct of_device_id mmrm_dt_match[] = { { .compatible = "qcom,waipio-mmrm", - .data = &commom_pt_platform_data_pineapple, + .data = &commom_pt_platform_data, }, { .compatible = "qcom,kalama-mmrm", - .data = &commom_pt_platform_data_pineapple, + .data = &commom_pt_platform_data, }, { .compatible = "qcom,pineapple-mmrm", - .data = &commom_pt_platform_data_pineapple, - }, - { - .compatible = "qcom,cliffs-mmrm", - .data = &commom_pt_platform_data_cliffs, + .data = &commom_pt_platform_data, }, {}, }; diff --git a/qcom/opensource/video-driver/video/Kbuild b/qcom/opensource/video-driver/video/Kbuild index ba866d0480..45cfd830d1 100644 --- a/qcom/opensource/video-driver/video/Kbuild +++ b/qcom/opensource/video-driver/video/Kbuild @@ -10,7 +10,7 @@ endif ifeq ($(CONFIG_MSM_VIDC_PINEAPPLE), y) LINUXINCLUDE += -I$(VIDEO_DRIVER_ABS_PATH)/platform/pineapple/inc \ - -I$(VIDEO_DRIVER_ABS_PATH)/platform/cliffs/inc + -I$(VIDEO_DRIVER_ABS_PATH)/platform/cliffs/inc \ -I$(VIDEO_DRIVER_ABS_PATH)/variant/iris33/inc endif