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

Commit 4591e303 authored by Deva Ramasubramanian's avatar Deva Ramasubramanian
Browse files

msm: vidc: Never unload the firmware on certain platforms



On some platforms, we'd like to never unload the firmware so that we can
acheive lower latency on video start up.  This commit achieves that by
setting unload interval to an unreasonable time in the future if the
appropriate flag is set in the device tree.

Change-Id: I8960350a4bc0bdf244de575172399fc6ecc59ad9
Signed-off-by: default avatarDeva Ramasubramanian <dramasub@codeaurora.org>
parent f6aa52d2
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -70,6 +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,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).
@@ -157,6 +161,7 @@ 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;
+1 −1
Original line number Diff line number Diff line
@@ -2237,7 +2237,7 @@ static int msm_vidc_deinit_core(struct msm_vidc_inst *inst)

	mutex_lock(&core->lock);

	if (list_empty(&core->instances)) {
	if (!core->resources.never_unload_fw && list_empty(&core->instances)) {
		cancel_delayed_work(&core->fw_unload_work);

		/*
+3 −0
Original line number Diff line number Diff line
@@ -684,6 +684,9 @@ int read_platform_resources_from_dt(
	dprintk(VIDC_DBG, "Power collapse supported = %s\n",
		res->sw_power_collapsible ? "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);
+1 −0
Original line number Diff line number Diff line
@@ -138,6 +138,7 @@ struct msm_vidc_platform_resources {
	bool thermal_mitigable;
	const char *fw_name;
	const char *hfi_version;
	bool never_unload_fw;
};

static inline bool is_iommu_present(struct msm_vidc_platform_resources *res)