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

Commit 8382bece authored by Maheshwar Ajja's avatar Maheshwar Ajja
Browse files

msm: vidc: Add debug timeout support



Add debug timeout support to get additional debugging
information when video driver or firmware error occurs.

CRs-Fixed: 2096561
Change-Id: Id21d774c0fefd1754cdc219c70e0abc5af5d566e
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent 05e7d36b
Loading
Loading
Loading
Loading
+8 −3
Original line number Diff line number Diff line
@@ -2788,6 +2788,8 @@ static int msm_comm_init_core(struct msm_vidc_inst *inst)
	}
	core->state = VIDC_CORE_INIT;
	core->smmu_fault_handled = false;
	core->trigger_ssr = false;

core_already_inited:
	change_inst_state(inst, MSM_VIDC_CORE_INIT);
	mutex_unlock(&core->lock);
@@ -5024,11 +5026,14 @@ int msm_vidc_trigger_ssr(struct msm_vidc_core *core,
		 * to know if fatal error is due to SSR or not. Handle
		 * user SSR as non-fatal.
		 */
		mutex_lock(&core->lock);
		core->resources.debug_timeout = false;
		mutex_unlock(&core->lock);
		core->trigger_ssr = true;
		rc = call_hfi_op(hdev, core_trigger_ssr,
				hdev->hfi_device_data, type);
		if (rc) {
			dprintk(VIDC_ERR, "%s: trigger_ssr failed\n",
				__func__);
			core->trigger_ssr = false;
		}
	}

	return rc;
+0 −3
Original line number Diff line number Diff line
@@ -29,7 +29,6 @@ bool msm_vidc_fw_coverage = !true;
bool msm_vidc_sys_idle_indicator = !true;
bool msm_vidc_thermal_mitigation_disabled = !true;
bool msm_vidc_clock_scaling = true;
bool msm_vidc_debug_timeout = !true;
bool msm_vidc_syscache_disable = !true;

#define MAX_DBG_BUF_SIZE 4096
@@ -208,8 +207,6 @@ struct dentry *msm_vidc_debugfs_init_drv(void)
			&msm_vidc_thermal_mitigation_disabled) &&
	__debugfs_create(bool, "clock_scaling",
			&msm_vidc_clock_scaling) &&
	__debugfs_create(bool, "debug_timeout",
			&msm_vidc_debug_timeout) &&
	__debugfs_create(bool, "disable_video_syscache",
			&msm_vidc_syscache_disable);

+12 −2
Original line number Diff line number Diff line
@@ -61,7 +61,6 @@ extern bool msm_vidc_fw_coverage;
extern bool msm_vidc_sys_idle_indicator;
extern bool msm_vidc_thermal_mitigation_disabled;
extern bool msm_vidc_clock_scaling;
extern bool msm_vidc_debug_timeout;
extern bool msm_vidc_syscache_disable;

#define VIDC_MSG_PRIO2STRING(__level) ({ \
@@ -184,7 +183,18 @@ static inline void msm_vidc_handle_hw_error(struct msm_vidc_core *core)
{
	bool enable_fatal;

	enable_fatal = msm_vidc_debug_timeout;
	enable_fatal = core->resources.debug_timeout;

	/*
	 * In current implementation user-initiated SSR triggers
	 * a fatal error from hardware. However, there is no way
	 * to know if fatal error is due to SSR or not. Handle
	 * user SSR as non-fatal.
	 */
	if (core->trigger_ssr) {
		core->trigger_ssr = false;
		enable_fatal = false;
	}

	/* Video driver can decide FATAL handling of HW errors
	 * based on multiple factors. This condition check will
+1 −0
Original line number Diff line number Diff line
@@ -317,6 +317,7 @@ struct msm_vidc_core {
	struct msm_vidc_capability *capabilities;
	struct delayed_work fw_unload_work;
	bool smmu_fault_handled;
	bool trigger_ssr;
	unsigned long min_freq;
	unsigned long curr_freq;
	struct vidc_bus_vote_data *vote_data;
+4 −0
Original line number Diff line number Diff line
@@ -99,6 +99,10 @@ static struct msm_vidc_common_data sdm845_common_data[] = {
		.key = "qcom,hw-resp-timeout",
		.value = 250,
	},
	{
		.key = "qcom,debug-timeout",
		.value = 0,
	},
};


Loading