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

Commit d3a37b62 authored by Maheshwar Ajja's avatar Maheshwar Ajja Committed by Deva Ramasubramanian
Browse files

msm: vidc: Remove unnecessary scale clocks



Clock scaling is being called for every command
queuing to venus firmware unnecessarily. Remove
it from command queue functionality and add in
power enable function to set correct clock rate
when venus resumed from power collapse.

Change-Id: I29eea6b2b27696176bf5f0c9f7700a8c3441533c
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent 75d530af
Loading
Loading
Loading
Loading
+10 −6
Original line number Diff line number Diff line
@@ -83,6 +83,8 @@ static int __disable_regulators(struct venus_hfi_device *device);
static int __enable_regulators(struct venus_hfi_device *device);
static inline int __prepare_enable_clks(struct venus_hfi_device *device);
static inline void __disable_unprepare_clks(struct venus_hfi_device *device);
static int __scale_clocks(struct venus_hfi_device *device, int load,
		int codecs_enabled, unsigned long instant_bitrate);
static void __flush_debug_queue(struct venus_hfi_device *device, u8 *packet);
static int __initialize_packetization(struct venus_hfi_device *device);
static struct hal_session *__get_session(struct venus_hfi_device *device,
@@ -1573,12 +1575,6 @@ static int __iface_cmdq_write_relaxed(struct venus_hfi_device *device,
			goto err_q_write;
		}

		if (__scale_clocks(device, device->clk_load,
			 device->codecs_enabled, device->clk_bitrate)) {
			dprintk(VIDC_ERR, "Clock scaling failed\n");
			goto err_q_write;
		}

		if (device->res->sw_power_collapsible) {
			dprintk(VIDC_DBG,
				"Cancel and queue delayed work again\n");
@@ -4182,6 +4178,14 @@ static int __venus_power_on(struct venus_hfi_device *device)
		goto fail_enable_clks;
	}

	rc = __scale_clocks(device, device->clk_load, device->codecs_enabled,
			device->clk_bitrate);
	if (rc) {
		dprintk(VIDC_WARN,
				"Failed to scale clocks, performance might be affected\n");
		rc = 0;
	}

	/* Hand off control of regulators to h/w _after_ enabling clocks */
	if (__enable_hw_power_collapse(device))
		dprintk(VIDC_ERR, "Failed to enabled inter-frame PC\n");