Loading drivers/media/platform/msm/vidc/msm_v4l2_vidc.c +33 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading @@ -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; Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +5 −7 Original line number Diff line number Diff line Loading @@ -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; \ Loading Loading @@ -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); Loading Loading @@ -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; Loading @@ -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; Loading Loading @@ -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); Loading Loading @@ -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); Loading drivers/media/platform/msm/vidc/msm_vidc_debug.c +6 −0 Original line number Diff line number Diff line Loading @@ -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]; Loading Loading @@ -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; } Loading drivers/media/platform/msm/vidc/msm_vidc_debug.h +1 −0 Original line number Diff line number Diff line Loading @@ -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 { \ Loading drivers/media/platform/msm/vidc/msm_vidc_resources.h +2 −0 Original line number Diff line number Diff line Loading @@ -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
drivers/media/platform/msm/vidc/msm_v4l2_vidc.c +33 −0 Original line number Diff line number Diff line Loading @@ -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; Loading Loading @@ -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; Loading @@ -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; Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +5 −7 Original line number Diff line number Diff line Loading @@ -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; \ Loading Loading @@ -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); Loading Loading @@ -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; Loading @@ -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; Loading Loading @@ -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); Loading Loading @@ -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); Loading
drivers/media/platform/msm/vidc/msm_vidc_debug.c +6 −0 Original line number Diff line number Diff line Loading @@ -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]; Loading Loading @@ -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; } Loading
drivers/media/platform/msm/vidc/msm_vidc_debug.h +1 −0 Original line number Diff line number Diff line Loading @@ -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 { \ Loading
drivers/media/platform/msm/vidc/msm_vidc_resources.h +2 −0 Original line number Diff line number Diff line Loading @@ -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