Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit fd3fd4ee authored by Manikanta Sivapala's avatar Manikanta Sivapala
Browse files

msm: vidc: Make thermal mitigation feature as target dependent



Make thermal mitigation feature as target dependent by enabling
the feature via dtsi file and add debugfs support to disable
it when needed. If any one of them is not enabled then thermal
mitigation feature is not executed.

Change-Id: Iff24e0a7ba6d4e31a3741ff0509038aac34b023a
Signed-off-by: default avatarManikanta Sivapala <msivap@codeaurora.org>
parent bd217783
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -109,6 +109,8 @@ Optional properties:
  idle message when it is in idle state.
- qcom,enable-minimum-voting = A bool to limit the bandwidth vote to the
  lowest vector over an active session.
- qcom,enable-thermal-mitigation = A bool to enable thermal mitigation when
  thermal run away occurs.

Example:

@@ -138,6 +140,7 @@ Example:
		qcom,sw-power-collapse;
		qcom,early-fw-load;
		qcom,enable-idle-indicator;
		qcom,enable-thermal-mitigation;
		qcom,msm-bus-clients {
			qcom,msm-bus-client@0 {
				qcom,msm-bus,name = "venc-ddr";
+10 −0
Original line number Diff line number Diff line
@@ -2120,6 +2120,16 @@ static bool is_thermal_permissible(struct msm_vidc_core *core)
	unsigned long freq = 0;
	bool is_turbo = false;

	if (!core->resources.thermal_mitigable)
		return true;

	if (msm_vidc_thermal_mitigation_disabled) {
		dprintk(VIDC_DBG,
			"Thermal mitigation not enabled. debugfs %d\n",
			msm_vidc_thermal_mitigation_disabled);
		return true;
	}

	tl = msm_comm_vidc_thermal_level(vidc_driver->thermal_level);
	freq = msm_comm_get_clock_rate(core);

+7 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@ int msm_vidc_vpe_csc_601_to_709 = 0x0;
int msm_vidc_dcvs_mode = 0x1;
int msm_vidc_sys_idle_indicator = 0x0;
u32 msm_vidc_firmware_unload_delay = 15000;
int msm_vidc_thermal_mitigation_disabled = 0x0;

struct debug_buffer {
	char ptr[MAX_DBG_BUF_SIZE];
@@ -197,6 +198,12 @@ struct dentry *msm_vidc_debugfs_init_drv(void)
			"debugfs_create_file: firmware_unload_delay fail\n");
		goto failed_create_dir;
	}
	if (!debugfs_create_u32("disable_thermal_mitigation", S_IRUGO | S_IWUSR,
			dir, &msm_vidc_thermal_mitigation_disabled)) {
		dprintk(VIDC_ERR,
			"debugfs_create_file: disable_thermal_mitigation fail\n");
		goto failed_create_dir;
	}
	return dir;

failed_create_dir:
+1 −0
Original line number Diff line number Diff line
@@ -63,6 +63,7 @@ extern int msm_vidc_vpe_csc_601_to_709;
extern int msm_vidc_dcvs_mode;
extern int msm_vidc_sys_idle_indicator;
extern u32 msm_vidc_firmware_unload_delay;
extern int msm_vidc_thermal_mitigation_disabled;

#define VIDC_MSG_PRIO2STRING(__level) ({ \
	char *__str; \
+4 −0
Original line number Diff line number Diff line
@@ -622,6 +622,10 @@ int read_platform_resources_from_dt(
	res->minimum_vote = of_property_read_bool(pdev->dev.of_node,
			"qcom,enable-minimum-voting");

	res->thermal_mitigable =
			of_property_read_bool(pdev->dev.of_node,
			"qcom,enable-thermal-mitigation");

	rc = msm_vidc_load_freq_table(res);
	if (rc) {
		dprintk(VIDC_ERR, "Failed to load freq table: %d\n", rc);
Loading