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

Commit 06a0a626 authored by Jordan Crouse's avatar Jordan Crouse
Browse files

msm: kgsl: Initialize coresight at boot time



Initialize coresight at boot time so that it is available to be
configured before the first open of /dev/kgsl-3d0 to get GPU
scan dumps during initial power up.

Change-Id: Ic0dedbadbda251f12855895cc0aa53852f79a8b8
Signed-off-by: default avatarJordan Crouse <jcrouse@codeaurora.org>
parent 09459f2e
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1116,6 +1116,9 @@ static int adreno_probe(struct platform_device *pdev)

	kgsl_pwrscale_init(&pdev->dev, CONFIG_MSM_ADRENO_DEFAULT_GOVERNOR);

	/* Initialize coresight for the target */
	adreno_coresight_init(adreno_dev);

	adreno_input_handler.private = device;

#ifdef CONFIG_INPUT
@@ -1274,9 +1277,6 @@ static int adreno_init(struct kgsl_device *device)
	if (ret)
		return ret;

	/* Initialize coresight for the target */
	adreno_coresight_init(adreno_dev);

	adreno_perfcounter_init(adreno_dev);
	adreno_fault_detect_init(adreno_dev);

+8 −6
Original line number Diff line number Diff line
@@ -61,7 +61,7 @@ ssize_t adreno_coresight_show_register(struct device *dev,
	}
	mutex_unlock(&device->mutex);

	return snprintf(buf, PAGE_SIZE, "0x%X", val);
	return snprintf(buf, PAGE_SIZE, "0x%X\n", val);
}

ssize_t adreno_coresight_store_register(struct device *dev,
@@ -243,12 +243,14 @@ static int adreno_coresight_enable(struct coresight_device *csdev)
			coresight->registers[i].value =
				coresight->registers[i].initial;

		if (kgsl_state_is_awake(device)) {
			ret = kgsl_active_count_get(device);
			if (!ret) {
				ret = _adreno_coresight_set(adreno_dev);
				kgsl_active_count_put(device);
			}
		}
	}

	mutex_unlock(&device->mutex);

@@ -305,7 +307,7 @@ int adreno_coresight_init(struct adreno_device *adreno_dev)
	if (gpudev->coresight == NULL)
		return -ENODEV;

	if (adreno_dev->csdev != NULL)
	if (!IS_ERR_OR_NULL(adreno_dev->csdev))
		return 0;

	memset(&desc, 0, sizeof(desc));