Loading Documentation/devicetree/bindings/media/video/msm-vidc.txt +2 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,8 @@ value is typically max(latencies of every cluster at all power levels) + 1 - qcom,max-secure-instances = An int containing max number of concurrent secure instances supported, accounting for venus and system wide limitations like memory, performance etc. - qcom,debug-timeout = A bool indicating that FW errors such as SYS_ERROR, SESSION_ERROR and timeouts will be treated as Fatal. [Second level nodes] Context Banks Loading arch/arm/boot/dts/qcom/msmcobalt-vidc.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ qcom,firmware-name = "venus"; qcom,never-unload-fw; qcom,sw-power-collapse; qcom,debug-timeout; qcom,reg-presets = <0x80124 0x0002000>, <0x80550 0x0000001>, Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +32 −4 Original line number Diff line number Diff line Loading @@ -86,6 +86,7 @@ struct getprop_buf { static void msm_comm_generate_session_error(struct msm_vidc_inst *inst); static void msm_comm_generate_sys_error(struct msm_vidc_inst *inst); static void handle_session_error(enum hal_command_response cmd, void *data); static void msm_vidc_print_running_insts(struct msm_vidc_core *core); bool msm_comm_turbo_session(struct msm_vidc_inst *inst) { Loading Loading @@ -879,11 +880,13 @@ static int wait_for_sess_signal_receipt(struct msm_vidc_inst *inst, enum hal_command_response cmd) { int rc = 0; struct hfi_device *hdev; if (!IS_HAL_SESSION_CMD(cmd)) { dprintk(VIDC_ERR, "Invalid inst cmd response: %d\n", cmd); return -EINVAL; } hdev = (struct hfi_device *)(inst->core->device); rc = wait_for_completion_timeout( &inst->completions[SESSION_MSG_INDEX(cmd)], msecs_to_jiffies(msm_vidc_hw_rsp_timeout)); Loading @@ -891,7 +894,11 @@ static int wait_for_sess_signal_receipt(struct msm_vidc_inst *inst, dprintk(VIDC_ERR, "Wait interrupted or timed out: %d\n", SESSION_MSG_INDEX(cmd)); msm_comm_kill_session(inst); BUG_ON(msm_vidc_debug_timeout); call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data); dprintk(VIDC_ERR, "sess resp timeout can potentially crash the system\n"); BUG_ON(inst->core->resources.debug_timeout); rc = -EIO; } else { rc = 0; Loading Loading @@ -1623,6 +1630,13 @@ static void handle_sys_error(enum hal_command_response cmd, void *data) core->state = VIDC_CORE_UNINIT; } mutex_unlock(&core->lock); msm_vidc_print_running_insts(core); call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data); dprintk(VIDC_ERR, "SYS_ERROR can potentially crash the system\n"); BUG_ON(core->resources.debug_timeout); } void msm_comm_session_clean(struct msm_vidc_inst *inst) Loading Loading @@ -2393,7 +2407,11 @@ static int msm_comm_session_abort(struct msm_vidc_inst *inst) dprintk(VIDC_ERR, "%s: Wait interrupted or timed out [%p]: %d\n", __func__, inst, abort_completion); BUG_ON(msm_vidc_debug_timeout); call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data); dprintk(VIDC_ERR, "ABORT timeout can potentially crash the system\n"); BUG_ON(inst->core->resources.debug_timeout); rc = -EBUSY; } else { rc = 0; Loading Loading @@ -2463,6 +2481,7 @@ void msm_comm_handle_thermal_event() int msm_comm_check_core_init(struct msm_vidc_core *core) { int rc = 0; struct hfi_device *hdev; mutex_lock(&core->lock); if (core->state >= VIDC_CORE_INIT_DONE) { Loading @@ -2471,13 +2490,18 @@ int msm_comm_check_core_init(struct msm_vidc_core *core) goto exit; } dprintk(VIDC_DBG, "Waiting for SYS_INIT_DONE\n"); hdev = (struct hfi_device *)core->device; rc = wait_for_completion_timeout( &core->completions[SYS_MSG_INDEX(HAL_SYS_INIT_DONE)], msecs_to_jiffies(msm_vidc_hw_rsp_timeout)); if (!rc) { dprintk(VIDC_ERR, "%s: Wait interrupted or timed out: %d\n", __func__, SYS_MSG_INDEX(HAL_SYS_INIT_DONE)); BUG_ON(msm_vidc_debug_timeout); call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data); dprintk(VIDC_ERR, "SYS_INIT timeout can potentially crash the system\n"); BUG_ON(core->resources.debug_timeout); rc = -EIO; goto exit; } else { Loading Loading @@ -3944,7 +3968,11 @@ int msm_comm_try_get_prop(struct msm_vidc_inst *inst, enum hal_property ptype, SESSION_MSG_INDEX(HAL_SESSION_PROPERTY_INFO)); inst->state = MSM_VIDC_CORE_INVALID; msm_comm_kill_session(inst); BUG_ON(msm_vidc_debug_timeout); call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data); dprintk(VIDC_ERR, "SESS_PROP timeout can potentially crash the system\n"); BUG_ON(inst->core->resources.debug_timeout); rc = -ETIMEDOUT; goto exit; } else { Loading drivers/media/platform/msm/vidc/msm_vidc_res_parse.c +5 −0 Original line number Diff line number Diff line Loading @@ -1103,6 +1103,11 @@ int read_platform_resources_from_dt( res->never_unload_fw = of_property_read_bool(pdev->dev.of_node, "qcom,never-unload-fw"); res->debug_timeout = of_property_read_bool(pdev->dev.of_node, "qcom,debug-timeout"); res->debug_timeout |= msm_vidc_debug_timeout; of_property_read_u32(pdev->dev.of_node, "qcom,pm-qos-latency-us", &res->pm_qos_latency_us); Loading drivers/media/platform/msm/vidc/msm_vidc_resources.h +1 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ struct msm_vidc_platform_resources { const char *fw_name; const char *hfi_version; bool never_unload_fw; bool debug_timeout; uint32_t pm_qos_latency_us; uint32_t max_inst_count; uint32_t max_secure_inst_count; Loading Loading
Documentation/devicetree/bindings/media/video/msm-vidc.txt +2 −0 Original line number Diff line number Diff line Loading @@ -130,6 +130,8 @@ value is typically max(latencies of every cluster at all power levels) + 1 - qcom,max-secure-instances = An int containing max number of concurrent secure instances supported, accounting for venus and system wide limitations like memory, performance etc. - qcom,debug-timeout = A bool indicating that FW errors such as SYS_ERROR, SESSION_ERROR and timeouts will be treated as Fatal. [Second level nodes] Context Banks Loading
arch/arm/boot/dts/qcom/msmcobalt-vidc.dtsi +1 −0 Original line number Diff line number Diff line Loading @@ -25,6 +25,7 @@ qcom,firmware-name = "venus"; qcom,never-unload-fw; qcom,sw-power-collapse; qcom,debug-timeout; qcom,reg-presets = <0x80124 0x0002000>, <0x80550 0x0000001>, Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +32 −4 Original line number Diff line number Diff line Loading @@ -86,6 +86,7 @@ struct getprop_buf { static void msm_comm_generate_session_error(struct msm_vidc_inst *inst); static void msm_comm_generate_sys_error(struct msm_vidc_inst *inst); static void handle_session_error(enum hal_command_response cmd, void *data); static void msm_vidc_print_running_insts(struct msm_vidc_core *core); bool msm_comm_turbo_session(struct msm_vidc_inst *inst) { Loading Loading @@ -879,11 +880,13 @@ static int wait_for_sess_signal_receipt(struct msm_vidc_inst *inst, enum hal_command_response cmd) { int rc = 0; struct hfi_device *hdev; if (!IS_HAL_SESSION_CMD(cmd)) { dprintk(VIDC_ERR, "Invalid inst cmd response: %d\n", cmd); return -EINVAL; } hdev = (struct hfi_device *)(inst->core->device); rc = wait_for_completion_timeout( &inst->completions[SESSION_MSG_INDEX(cmd)], msecs_to_jiffies(msm_vidc_hw_rsp_timeout)); Loading @@ -891,7 +894,11 @@ static int wait_for_sess_signal_receipt(struct msm_vidc_inst *inst, dprintk(VIDC_ERR, "Wait interrupted or timed out: %d\n", SESSION_MSG_INDEX(cmd)); msm_comm_kill_session(inst); BUG_ON(msm_vidc_debug_timeout); call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data); dprintk(VIDC_ERR, "sess resp timeout can potentially crash the system\n"); BUG_ON(inst->core->resources.debug_timeout); rc = -EIO; } else { rc = 0; Loading Loading @@ -1623,6 +1630,13 @@ static void handle_sys_error(enum hal_command_response cmd, void *data) core->state = VIDC_CORE_UNINIT; } mutex_unlock(&core->lock); msm_vidc_print_running_insts(core); call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data); dprintk(VIDC_ERR, "SYS_ERROR can potentially crash the system\n"); BUG_ON(core->resources.debug_timeout); } void msm_comm_session_clean(struct msm_vidc_inst *inst) Loading Loading @@ -2393,7 +2407,11 @@ static int msm_comm_session_abort(struct msm_vidc_inst *inst) dprintk(VIDC_ERR, "%s: Wait interrupted or timed out [%p]: %d\n", __func__, inst, abort_completion); BUG_ON(msm_vidc_debug_timeout); call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data); dprintk(VIDC_ERR, "ABORT timeout can potentially crash the system\n"); BUG_ON(inst->core->resources.debug_timeout); rc = -EBUSY; } else { rc = 0; Loading Loading @@ -2463,6 +2481,7 @@ void msm_comm_handle_thermal_event() int msm_comm_check_core_init(struct msm_vidc_core *core) { int rc = 0; struct hfi_device *hdev; mutex_lock(&core->lock); if (core->state >= VIDC_CORE_INIT_DONE) { Loading @@ -2471,13 +2490,18 @@ int msm_comm_check_core_init(struct msm_vidc_core *core) goto exit; } dprintk(VIDC_DBG, "Waiting for SYS_INIT_DONE\n"); hdev = (struct hfi_device *)core->device; rc = wait_for_completion_timeout( &core->completions[SYS_MSG_INDEX(HAL_SYS_INIT_DONE)], msecs_to_jiffies(msm_vidc_hw_rsp_timeout)); if (!rc) { dprintk(VIDC_ERR, "%s: Wait interrupted or timed out: %d\n", __func__, SYS_MSG_INDEX(HAL_SYS_INIT_DONE)); BUG_ON(msm_vidc_debug_timeout); call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data); dprintk(VIDC_ERR, "SYS_INIT timeout can potentially crash the system\n"); BUG_ON(core->resources.debug_timeout); rc = -EIO; goto exit; } else { Loading Loading @@ -3944,7 +3968,11 @@ int msm_comm_try_get_prop(struct msm_vidc_inst *inst, enum hal_property ptype, SESSION_MSG_INDEX(HAL_SESSION_PROPERTY_INFO)); inst->state = MSM_VIDC_CORE_INVALID; msm_comm_kill_session(inst); BUG_ON(msm_vidc_debug_timeout); call_hfi_op(hdev, flush_debug_queue, hdev->hfi_device_data); dprintk(VIDC_ERR, "SESS_PROP timeout can potentially crash the system\n"); BUG_ON(inst->core->resources.debug_timeout); rc = -ETIMEDOUT; goto exit; } else { Loading
drivers/media/platform/msm/vidc/msm_vidc_res_parse.c +5 −0 Original line number Diff line number Diff line Loading @@ -1103,6 +1103,11 @@ int read_platform_resources_from_dt( res->never_unload_fw = of_property_read_bool(pdev->dev.of_node, "qcom,never-unload-fw"); res->debug_timeout = of_property_read_bool(pdev->dev.of_node, "qcom,debug-timeout"); res->debug_timeout |= msm_vidc_debug_timeout; of_property_read_u32(pdev->dev.of_node, "qcom,pm-qos-latency-us", &res->pm_qos_latency_us); Loading
drivers/media/platform/msm/vidc/msm_vidc_resources.h +1 −0 Original line number Diff line number Diff line Loading @@ -185,6 +185,7 @@ struct msm_vidc_platform_resources { const char *fw_name; const char *hfi_version; bool never_unload_fw; bool debug_timeout; uint32_t pm_qos_latency_us; uint32_t max_inst_count; uint32_t max_secure_inst_count; Loading