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

Commit f6aa52d2 authored by Deva Ramasubramanian's avatar Deva Ramasubramanian
Browse files

msm: vidc: Remove the "early firmware load" feature



It's never been used and we don't plan on using it in the future.

Change-Id: I82fbacd5ca8fb0f22da6278711016ade32b9c6d9
Signed-off-by: default avatarDeva Ramasubramanian <dramasub@codeaurora.org>
parent dec3acb0
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -70,9 +70,6 @@ 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,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).
@@ -163,7 +160,6 @@ Example:
		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>;
+0 −59
Original line number Diff line number Diff line
@@ -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;

@@ -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;
@@ -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:
+0 −9
Original line number Diff line number Diff line
@@ -2237,15 +2237,6 @@ 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)) {
		cancel_delayed_work(&core->fw_unload_work);

+0 −4
Original line number Diff line number Diff line
@@ -684,10 +684,6 @@ 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");
	return rc;
err_load_max_hw_load:
	msm_vidc_free_clock_table(res);
+0 −1
Original line number Diff line number Diff line
@@ -135,7 +135,6 @@ struct msm_vidc_platform_resources {
	bool sw_power_collapsible;
	bool sys_idle_indicator;
	struct list_head context_banks;
	bool early_fw_load;
	bool thermal_mitigable;
	const char *fw_name;
	const char *hfi_version;