Fix camera

Change-Id: Icebc2f332c36bae4480a62851a7e934fa367c73e
This commit is contained in:
David Wronek 2025-01-12 20:24:54 +01:00 committed by j7b3y
parent 0dcceff803
commit d7d7c480b8
4 changed files with 48 additions and 70 deletions

View File

@ -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

View File

@ -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,10 +636,7 @@ 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))
continue;
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];
@ -651,16 +649,24 @@ static int mmrm_sw_throttle_low_priority_client(
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;
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;
}

View File

@ -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,
},
{},
};

View File

@ -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