Loading Documentation/devicetree/bindings/media/video/msm-vidc.txt +5 −4 Original line number Diff line number Diff line Loading @@ -70,9 +70,10 @@ Optional properties: scalable = 0x1 (if the driver should vary the clock's frequency based on load) - qcom,sw-power-collapse = A bool indicating if video hardware core can be power collapsed in idle state. - qcom,early-fw-load = A bool indicating if video firmware should be loaded during probe. When no video session is active, the video hardware will be power collapsed. - qcom,never-unload-fw = A bool indicating if video firmware should be not be unloaded after all active sessions have closed. Once a new session starts up after this, the firmware will be ready to go. This should be set on platforms that desire low-latency video startup and don't mind "leakage" of some memory. - qcom,use-non-secure-pil = A bool indicating which type of pil to use to load the fw. - qcom,fw-bias = The address at which venus fw is loaded (manually). Loading Loading @@ -160,10 +161,10 @@ Example: qcom,qdss-presets = <0xFC307000 0x1000>, <0xFC322000 0x1000>; qcom,max-hw-load = <1224450>; /* 4k @ 30 + 1080p @ 30*/ qcom,never-unload-fw; clock-names = "foo_clk", "bar_clk", "baz_clk"; qcom,clock-configs = <0x3 0x1 0x0>; qcom,sw-power-collapse; qcom,early-fw-load; qcom,enable-idle-indicator; qcom,buffer-type-tz-usage-table = <0x1 0x1>, <0x1fe 0x2>; Loading arch/arm/boot/dts/qcom/msm8996.dtsi +2 −1 Original line number Diff line number Diff line Loading @@ -363,6 +363,8 @@ qcom,max-hw-load = <2563200>; /* Full 4k @ 60 + 1080p @ 60 */ qcom,firmware-name = "venus"; qcom,imem-size = <524288>; /* 512 kB */ qcom,never-unload-fw; qcom,sw-power-collapse; qcom,load-freq-tbl = /* Encoders */ <972000 490000000 0x55555555>, /* 4k UHD @ 30 */ Loading Loading @@ -399,7 +401,6 @@ <&clock_mmss clk_video_subcore0_clk>, <&clock_mmss clk_video_subcore1_clk>; qcom,clock-configs = <0x0 0x0 0x0 0x1 0x0 0x0 0x0 0x1 0x1>; qcom,sw-power-collapse; /* Buses */ bus_cnoc { Loading drivers/media/platform/msm/vidc/msm_v4l2_vidc.c +0 −59 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ #include "vidc_hfi_api.h" #define BASE_DEVICE_NUMBER 32 #define EARLY_FIRMWARE_LOAD_DELAY 1000 struct msm_vidc_drv *vidc_driver; Loading Loading @@ -427,61 +426,6 @@ static const struct of_device_id msm_vidc_dt_match[] = { {} }; struct fw_load_handler_data { struct msm_vidc_core *core; struct delayed_work work; }; static void fw_load_handler(struct work_struct *work) { struct msm_vidc_core *core = NULL; struct fw_load_handler_data *handler = NULL; int rc = 0; handler = container_of(work, struct fw_load_handler_data, work.work); if (!handler || !handler->core) { dprintk(VIDC_ERR, "%s - invalid work or core handle\n", __func__); goto exit; } core = handler->core; rc = msm_comm_load_fw(core); if (rc) { dprintk(VIDC_ERR, "%s - failed to load fw\n", __func__); goto exit; } rc = msm_comm_check_core_init(core); if (rc) { dprintk(VIDC_ERR, "%s - failed to init core\n", __func__); goto exit; } dprintk(VIDC_DBG, "%s - firmware loaded successfully\n", __func__); exit: kfree(handler); } static void load_firmware(struct msm_vidc_core *core) { struct fw_load_handler_data *handler = NULL; handler = kzalloc(sizeof(*handler), GFP_KERNEL); if (!handler) { dprintk(VIDC_ERR, "%s - failed to allocate sys error handler\n", __func__); return; } handler->core = core; INIT_DELAYED_WORK(&handler->work, fw_load_handler); schedule_delayed_work(&handler->work, msecs_to_jiffies(EARLY_FIRMWARE_LOAD_DELAY)); } static int msm_vidc_probe_vidc_device(struct platform_device *pdev) { int rc = 0; Loading Loading @@ -613,9 +557,6 @@ static int msm_vidc_probe_vidc_device(struct platform_device *pdev) goto err_fail_sub_device_probe; } if (core->resources.early_fw_load) load_firmware(core); return rc; err_fail_sub_device_probe: Loading drivers/media/platform/msm/vidc/msm_vidc_common.c +1 −10 Original line number Diff line number Diff line Loading @@ -2237,16 +2237,7 @@ static int msm_vidc_deinit_core(struct msm_vidc_inst *inst) mutex_lock(&core->lock); /* * If firmware is configured to be always loaded in memory, * then unload it only if the core has gone in to bad state. */ if (core->resources.early_fw_load && core->state != VIDC_CORE_INVALID) { goto core_already_uninited; } if (list_empty(&core->instances)) { if (!core->resources.never_unload_fw && list_empty(&core->instances)) { cancel_delayed_work(&core->fw_unload_work); /* Loading drivers/media/platform/msm/vidc/msm_vidc_res_parse.c +3 −4 Original line number Diff line number Diff line Loading @@ -684,10 +684,9 @@ int read_platform_resources_from_dt( dprintk(VIDC_DBG, "Power collapse supported = %s\n", res->sw_power_collapsible ? "yes" : "no"); res->early_fw_load = of_property_read_bool(pdev->dev.of_node, "qcom,early-fw-load"); dprintk(VIDC_DBG, "Early fw load = %s\n", res->early_fw_load ? "yes" : "no"); res->never_unload_fw = of_property_read_bool(pdev->dev.of_node, "qcom,never-unload-fw"); return rc; err_load_max_hw_load: msm_vidc_free_clock_table(res); Loading Loading
Documentation/devicetree/bindings/media/video/msm-vidc.txt +5 −4 Original line number Diff line number Diff line Loading @@ -70,9 +70,10 @@ Optional properties: scalable = 0x1 (if the driver should vary the clock's frequency based on load) - qcom,sw-power-collapse = A bool indicating if video hardware core can be power collapsed in idle state. - qcom,early-fw-load = A bool indicating if video firmware should be loaded during probe. When no video session is active, the video hardware will be power collapsed. - qcom,never-unload-fw = A bool indicating if video firmware should be not be unloaded after all active sessions have closed. Once a new session starts up after this, the firmware will be ready to go. This should be set on platforms that desire low-latency video startup and don't mind "leakage" of some memory. - qcom,use-non-secure-pil = A bool indicating which type of pil to use to load the fw. - qcom,fw-bias = The address at which venus fw is loaded (manually). Loading Loading @@ -160,10 +161,10 @@ Example: qcom,qdss-presets = <0xFC307000 0x1000>, <0xFC322000 0x1000>; qcom,max-hw-load = <1224450>; /* 4k @ 30 + 1080p @ 30*/ qcom,never-unload-fw; clock-names = "foo_clk", "bar_clk", "baz_clk"; qcom,clock-configs = <0x3 0x1 0x0>; qcom,sw-power-collapse; qcom,early-fw-load; qcom,enable-idle-indicator; qcom,buffer-type-tz-usage-table = <0x1 0x1>, <0x1fe 0x2>; Loading
arch/arm/boot/dts/qcom/msm8996.dtsi +2 −1 Original line number Diff line number Diff line Loading @@ -363,6 +363,8 @@ qcom,max-hw-load = <2563200>; /* Full 4k @ 60 + 1080p @ 60 */ qcom,firmware-name = "venus"; qcom,imem-size = <524288>; /* 512 kB */ qcom,never-unload-fw; qcom,sw-power-collapse; qcom,load-freq-tbl = /* Encoders */ <972000 490000000 0x55555555>, /* 4k UHD @ 30 */ Loading Loading @@ -399,7 +401,6 @@ <&clock_mmss clk_video_subcore0_clk>, <&clock_mmss clk_video_subcore1_clk>; qcom,clock-configs = <0x0 0x0 0x0 0x1 0x0 0x0 0x0 0x1 0x1>; qcom,sw-power-collapse; /* Buses */ bus_cnoc { Loading
drivers/media/platform/msm/vidc/msm_v4l2_vidc.c +0 −59 Original line number Diff line number Diff line Loading @@ -32,7 +32,6 @@ #include "vidc_hfi_api.h" #define BASE_DEVICE_NUMBER 32 #define EARLY_FIRMWARE_LOAD_DELAY 1000 struct msm_vidc_drv *vidc_driver; Loading Loading @@ -427,61 +426,6 @@ static const struct of_device_id msm_vidc_dt_match[] = { {} }; struct fw_load_handler_data { struct msm_vidc_core *core; struct delayed_work work; }; static void fw_load_handler(struct work_struct *work) { struct msm_vidc_core *core = NULL; struct fw_load_handler_data *handler = NULL; int rc = 0; handler = container_of(work, struct fw_load_handler_data, work.work); if (!handler || !handler->core) { dprintk(VIDC_ERR, "%s - invalid work or core handle\n", __func__); goto exit; } core = handler->core; rc = msm_comm_load_fw(core); if (rc) { dprintk(VIDC_ERR, "%s - failed to load fw\n", __func__); goto exit; } rc = msm_comm_check_core_init(core); if (rc) { dprintk(VIDC_ERR, "%s - failed to init core\n", __func__); goto exit; } dprintk(VIDC_DBG, "%s - firmware loaded successfully\n", __func__); exit: kfree(handler); } static void load_firmware(struct msm_vidc_core *core) { struct fw_load_handler_data *handler = NULL; handler = kzalloc(sizeof(*handler), GFP_KERNEL); if (!handler) { dprintk(VIDC_ERR, "%s - failed to allocate sys error handler\n", __func__); return; } handler->core = core; INIT_DELAYED_WORK(&handler->work, fw_load_handler); schedule_delayed_work(&handler->work, msecs_to_jiffies(EARLY_FIRMWARE_LOAD_DELAY)); } static int msm_vidc_probe_vidc_device(struct platform_device *pdev) { int rc = 0; Loading Loading @@ -613,9 +557,6 @@ static int msm_vidc_probe_vidc_device(struct platform_device *pdev) goto err_fail_sub_device_probe; } if (core->resources.early_fw_load) load_firmware(core); return rc; err_fail_sub_device_probe: Loading
drivers/media/platform/msm/vidc/msm_vidc_common.c +1 −10 Original line number Diff line number Diff line Loading @@ -2237,16 +2237,7 @@ static int msm_vidc_deinit_core(struct msm_vidc_inst *inst) mutex_lock(&core->lock); /* * If firmware is configured to be always loaded in memory, * then unload it only if the core has gone in to bad state. */ if (core->resources.early_fw_load && core->state != VIDC_CORE_INVALID) { goto core_already_uninited; } if (list_empty(&core->instances)) { if (!core->resources.never_unload_fw && list_empty(&core->instances)) { cancel_delayed_work(&core->fw_unload_work); /* Loading
drivers/media/platform/msm/vidc/msm_vidc_res_parse.c +3 −4 Original line number Diff line number Diff line Loading @@ -684,10 +684,9 @@ int read_platform_resources_from_dt( dprintk(VIDC_DBG, "Power collapse supported = %s\n", res->sw_power_collapsible ? "yes" : "no"); res->early_fw_load = of_property_read_bool(pdev->dev.of_node, "qcom,early-fw-load"); dprintk(VIDC_DBG, "Early fw load = %s\n", res->early_fw_load ? "yes" : "no"); res->never_unload_fw = of_property_read_bool(pdev->dev.of_node, "qcom,never-unload-fw"); return rc; err_load_max_hw_load: msm_vidc_free_clock_table(res); Loading