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

Commit 7d34c83d authored by Hareesh Gundu's avatar Hareesh Gundu
Browse files

msm: kgsl: Add a check before accessing SPTPRAC head switch



SPTPRAC head switch is not present all A6xx GPUs. Attempt to
turn on SPTPRAC head switch such as A640 GPU will result into
failure. Fix this by adding a conditional check before we
attempt to turn it on/off.

Change-Id: I9e3af0f31e164efe61bb4dd13b7ec3e89e609039
Signed-off-by: default avatarHareesh Gundu <hareeshg@codeaurora.org>
parent 6311fc48
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1201,7 +1201,7 @@ static int a6xx_rb_start(struct adreno_device *adreno_dev,
 */
static int a6xx_sptprac_enable(struct adreno_device *adreno_dev)
{
	if (!adreno_has_sptprac_gdsc(adreno_dev))
	if (adreno_is_a608(adreno_dev))
		return 0;

	return a6xx_gmu_sptprac_enable(adreno_dev);
@@ -1213,7 +1213,7 @@ static int a6xx_sptprac_enable(struct adreno_device *adreno_dev)
 */
static void a6xx_sptprac_disable(struct adreno_device *adreno_dev)
{
	if (!adreno_has_sptprac_gdsc(adreno_dev))
	if (adreno_is_a608(adreno_dev))
		return;

	a6xx_gmu_sptprac_disable(adreno_dev);
@@ -1384,7 +1384,7 @@ static int a6xx_soft_reset(struct adreno_device *adreno_dev)
	/* Clear GBIF client halt and CX arbiter halt */
	adreno_deassert_gbif_halt(adreno_dev);

	a6xx_gmu_sptprac_enable(adreno_dev);
	a6xx_sptprac_enable(adreno_dev);

	return 0;
}
+5 −3
Original line number Diff line number Diff line
@@ -671,8 +671,9 @@ int a6xx_gmu_sptprac_enable(struct adreno_device *adreno_dev)
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct gmu_device *gmu = KGSL_GMU_DEVICE(device);

	if (!gmu_core_gpmu_isenabled(device))
		return -EINVAL;
	if (!gmu_core_gpmu_isenabled(device) ||
			!adreno_has_sptprac_gdsc(adreno_dev))
		return 0;

	gmu_core_regwrite(device, A6XX_GMU_GX_SPTPRAC_POWER_CONTROL,
			SPTPRAC_POWERON_CTRL_MASK);
@@ -698,7 +699,8 @@ void a6xx_gmu_sptprac_disable(struct adreno_device *adreno_dev)
	struct kgsl_device *device = KGSL_DEVICE(adreno_dev);
	struct gmu_device *gmu = KGSL_GMU_DEVICE(device);

	if (!gmu_core_gpmu_isenabled(device))
	if (!gmu_core_gpmu_isenabled(device) ||
			!adreno_has_sptprac_gdsc(adreno_dev))
		return;

	/* Ensure that retention is on */