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

Commit 95b6adec authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Make HW timeout and power collapse delay configurable"

parents dfd797b1 db8495ea
Loading
Loading
Loading
Loading
+33 −0
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@

struct msm_vidc_drv *vidc_driver;

uint32_t msm_vidc_pwr_collapse_delay = 2000;

struct buffer_info {
	struct list_head list;
	int type;
@@ -781,6 +783,31 @@ static ssize_t msm_vidc_link_name_show(struct device *dev,

static DEVICE_ATTR(link_name, 0444, msm_vidc_link_name_show, NULL);

static ssize_t store_pwr_collapse_delay(struct device *dev,
		struct device_attribute *attr,
		const char *buf, size_t count)
{
	unsigned long val = 0;
	int rc = 0;
	rc = kstrtoul(buf, 0, &val);
	if (rc)
		return rc;
	else if (val == 0)
		return -EINVAL;
	msm_vidc_pwr_collapse_delay = val;
	return count;
}

static ssize_t show_pwr_collapse_delay(struct device *dev,
		struct device_attribute *attr,
		char *buf)
{
	return snprintf(buf, PAGE_SIZE, "%u\n", msm_vidc_pwr_collapse_delay);
}

static DEVICE_ATTR(pwr_collapse_delay, 0644, show_pwr_collapse_delay,
		store_pwr_collapse_delay);

static int msm_vidc_probe(struct platform_device *pdev)
{
	int rc = 0;
@@ -800,6 +827,12 @@ static int msm_vidc_probe(struct platform_device *pdev)
		dprintk(VIDC_ERR, "Failed to init core\n");
		goto err_v4l2_register;
	}
	rc = device_create_file(&pdev->dev, &dev_attr_pwr_collapse_delay);
	if (rc) {
		dprintk(VIDC_ERR,
				"Failed to create pwr_collapse_delay sysfs node");
		goto err_v4l2_register;
	}
	if (core->hfi_type == VIDC_HFI_Q6) {
		dprintk(VIDC_ERR, "Q6 hfi device probe called\n");
		nr += MSM_VIDC_MAX_DEVICES;
+5 −7
Original line number Diff line number Diff line
@@ -22,8 +22,6 @@
#include "msm_smem.h"
#include "msm_vidc_debug.h"

#define HW_RESPONSE_TIMEOUT 1000

#define IS_ALREADY_IN_STATE(__p, __d) ({\
	int __rc = (__p >= __d);\
	__rc; \
@@ -362,7 +360,7 @@ static int wait_for_sess_signal_receipt(struct msm_vidc_inst *inst,
	int rc = 0;
	rc = wait_for_completion_timeout(
		&inst->completions[SESSION_MSG_INDEX(cmd)],
		msecs_to_jiffies(HW_RESPONSE_TIMEOUT));
		msecs_to_jiffies(msm_vidc_hw_rsp_timeout));
	if (!rc) {
		dprintk(VIDC_ERR, "Wait interrupted or timeout: %d\n", rc);
		msm_comm_recover_from_session_error(inst);
@@ -1128,7 +1126,7 @@ static int msm_comm_unset_ocmem(struct msm_vidc_core *core)
	}
	rc = wait_for_completion_timeout(
		&core->completions[SYS_MSG_INDEX(RELEASE_RESOURCE_DONE)],
		msecs_to_jiffies(HW_RESPONSE_TIMEOUT));
		msecs_to_jiffies(msm_vidc_hw_rsp_timeout));
	if (!rc) {
		dprintk(VIDC_ERR, "Wait interrupted or timeout: %d\n", rc);
		rc = -EIO;
@@ -1150,7 +1148,7 @@ static int msm_comm_init_core_done(struct msm_vidc_inst *inst)
	dprintk(VIDC_DBG, "Waiting for SYS_INIT_DONE\n");
	rc = wait_for_completion_timeout(
		&core->completions[SYS_MSG_INDEX(SYS_INIT_DONE)],
		msecs_to_jiffies(HW_RESPONSE_TIMEOUT));
		msecs_to_jiffies(msm_vidc_hw_rsp_timeout));
	if (!rc) {
		dprintk(VIDC_ERR, "Wait interrupted or timeout: %d\n", rc);
		rc = -EIO;
@@ -2116,7 +2114,7 @@ int msm_comm_try_get_bufreqs(struct msm_vidc_inst *inst)
	}
	rc = wait_for_completion_timeout(
		&inst->completions[SESSION_MSG_INDEX(SESSION_PROPERTY_INFO)],
		msecs_to_jiffies(HW_RESPONSE_TIMEOUT));
		msecs_to_jiffies(msm_vidc_hw_rsp_timeout));
	if (!rc) {
		dprintk(VIDC_ERR,
			"Wait interrupted or timeout: %d\n", rc);
@@ -2703,7 +2701,7 @@ int msm_comm_recover_from_session_error(struct msm_vidc_inst *inst)
	}
	rc = wait_for_completion_timeout(
		&inst->completions[SESSION_MSG_INDEX(SESSION_ABORT_DONE)],
		msecs_to_jiffies(HW_RESPONSE_TIMEOUT));
		msecs_to_jiffies(msm_vidc_hw_rsp_timeout));
	if (!rc) {
		dprintk(VIDC_ERR, "%s: Wait interrupted or timeout: %d\n",
			__func__, rc);
+6 −0
Original line number Diff line number Diff line
@@ -21,6 +21,7 @@ int msm_fw_debug = 0x18;
int msm_fw_debug_mode = 0x1;
int msm_fw_low_power_mode = 0x1;
int msm_vp8_low_tier = 0x1;
int msm_vidc_hw_rsp_timeout = 1000;

struct debug_buffer {
	char ptr[MAX_DBG_BUF_SIZE];
@@ -177,6 +178,11 @@ struct dentry *msm_vidc_debugfs_init_core(struct msm_vidc_core *core,
		dprintk(VIDC_ERR, "debugfs_create_file: fail\n");
		goto failed_create_dir;
	}
	if (!debugfs_create_u32("hw_rsp_timeout", S_IRUGO | S_IWUSR,
			parent, &msm_vidc_hw_rsp_timeout)) {
		dprintk(VIDC_ERR, "debugfs_create_file: fail\n");
		goto failed_create_dir;
	}
failed_create_dir:
	return dir;
}
+1 −0
Original line number Diff line number Diff line
@@ -53,6 +53,7 @@ extern int msm_fw_debug;
extern int msm_fw_debug_mode;
extern int msm_fw_low_power_mode;
extern int msm_vp8_low_tier;
extern int msm_vidc_hw_rsp_timeout;

#define dprintk(__level, __fmt, arg...)	\
	do { \
+2 −0
Original line number Diff line number Diff line
@@ -87,5 +87,7 @@ static inline int is_iommu_present(struct msm_vidc_platform_resources *res)
	return 0;
}

extern uint32_t msm_vidc_pwr_collapse_delay;

#endif
Loading