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

Commit 9f28807f authored by Harshdeep Dhatt's avatar Harshdeep Dhatt
Browse files

msm: kgsl: Move kgsl_idle_check to target specific probe



We will be re-purposing the idle check structures to run different
idle check functions for gmu and rgmu based targets. So move the
relevant bits to target specific probe.

Change-Id: I27b936eb46568f3e5511257d67dd93c23407fd18
Signed-off-by: default avatarHarshdeep Dhatt <hdhatt@codeaurora.org>
parent e7c78f11
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -1868,8 +1868,6 @@ static int adreno_open(struct adreno_device *adreno_dev)
	if (ret)
		goto err;

	timer_setup(&device->idle_timer, kgsl_timer, 0);

	complete_all(&device->hwaccess_gate);
	kgsl_pwrctrl_change_state(device, KGSL_STATE_ACTIVE);
	adreno_active_count_put(adreno_dev);
+7 −0
Original line number Diff line number Diff line
@@ -572,6 +572,7 @@ static int a3xx_probe(struct platform_device *pdev,
		u32 chipid, const struct adreno_gpu_core *gpucore)
{
	struct adreno_device *adreno_dev;
	struct kgsl_device *device;

	adreno_dev = (struct adreno_device *)
		of_device_get_match_data(&pdev->dev);
@@ -586,6 +587,12 @@ static int a3xx_probe(struct platform_device *pdev,
	/* Set the GPU busy counter for frequency scaling */
	adreno_dev->perfctr_pwr_lo = A3XX_RBBM_PERFCTR_PWR_1_LO;

	device = KGSL_DEVICE(adreno_dev);

	timer_setup(&device->idle_timer, kgsl_timer, 0);

	INIT_WORK(&device->idle_check_ws, kgsl_idle_check);

	return adreno_device_probe(pdev, adreno_dev);
}

+7 −0
Original line number Diff line number Diff line
@@ -92,6 +92,7 @@ static int a5xx_probe(struct platform_device *pdev,
	u32 chipid, const struct adreno_gpu_core *gpucore)
{
	struct adreno_device *adreno_dev;
	struct kgsl_device *device;

	adreno_dev = (struct adreno_device *)
		of_device_get_match_data(&pdev->dev);
@@ -122,6 +123,12 @@ static int a5xx_probe(struct platform_device *pdev,
	if (adreno_is_a530(adreno_dev))
		a530_efuse_leakage(adreno_dev);

	device = KGSL_DEVICE(adreno_dev);

	timer_setup(&device->idle_timer, kgsl_timer, 0);

	INIT_WORK(&device->idle_check_ws, kgsl_idle_check);

	return adreno_device_probe(pdev, adreno_dev);
}

+7 −0
Original line number Diff line number Diff line
@@ -2338,6 +2338,7 @@ static int a6xx_probe(struct platform_device *pdev,
{
	struct adreno_device *adreno_dev;
	struct adreno_gpudev *gpudev = gpucore->gpudev;
	struct kgsl_device *device;

	adreno_dev = (struct adreno_device *)
		of_device_get_match_data(&pdev->dev);
@@ -2385,6 +2386,12 @@ static int a6xx_probe(struct platform_device *pdev,
		adreno_dev->perfctr_ifpc_lo =
			A6XX_GMU_CX_GMU_POWER_COUNTER_XOCLK_4_L;

	device = KGSL_DEVICE(adreno_dev);

	timer_setup(&device->idle_timer, kgsl_timer, 0);

	INIT_WORK(&device->idle_check_ws, kgsl_idle_check);

	return adreno_device_probe(pdev, adreno_dev);
}

+1 −9
Original line number Diff line number Diff line
@@ -1483,8 +1483,6 @@ static int kgsl_pwrctrl_clk_set_rate(struct clk *grp_clk, unsigned int freq,
	return ret;
}

static void kgsl_idle_check(struct work_struct *work);

int kgsl_pwrctrl_init(struct kgsl_device *device)
{
	int i, result, freq;
@@ -1514,7 +1512,6 @@ int kgsl_pwrctrl_init(struct kgsl_device *device)
		return -EINVAL;
	}

	INIT_WORK(&device->idle_check_ws, kgsl_idle_check);
	init_waitqueue_head(&device->active_cnt_wq);

	/* Initialize the user and thermal clock constraints */
@@ -1573,12 +1570,7 @@ void kgsl_pwrctrl_close(struct kgsl_device *device)
	pm_runtime_disable(&device->pdev->dev);
}

/*
 * This function is called for work that is queued by the interrupt
 * handler or the idle timer. It attempts to transition to a clocks
 * off state if the active_cnt is 0 and the hardware is idle.
 */
static void kgsl_idle_check(struct work_struct *work)
void kgsl_idle_check(struct work_struct *work)
{
	struct kgsl_device *device = container_of(work, struct kgsl_device,
							idle_check_ws);
Loading