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

Commit 0dc6c371 authored by Rajesh Kemisetti's avatar Rajesh Kemisetti
Browse files

msm: kgsl: Don't enable GPU 64bit when kernel is in 32bit configuration



Setting the GPU to 64bit when rest of world is in 32bit can
make the GPU misbehave. Hence, check the kernel configuration
before actually moving the GPU to 64bit mode.

Change-Id: Ie4cf6c2d4fdfa978287c86812bdce4bf8c56ef5f
Signed-off-by: default avatarRajesh Kemisetti <rajeshk@codeaurora.org>
parent ac6766f8
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -1079,7 +1079,7 @@ static int adreno_probe(struct platform_device *pdev)
	* that we cannot use 64 bit virtual addresses on a 32 bit kernel even
	* though the hardware and the rest of the KGSL driver supports it.
	*/
	if ((BITS_PER_LONG == 64) && ADRENO_FEATURE(adreno_dev, ADRENO_64BIT))
	if (adreno_support_64bit(adreno_dev))
		device->mmu.features |= KGSL_MMU_64BIT;

	status = kgsl_device_platform_probe(device);
@@ -1447,7 +1447,7 @@ static int _adreno_start(struct adreno_device *adreno_dev)

	/* Enable 64 bit gpu addr if feature is set */
	if (gpudev->enable_64bit &&
			ADRENO_FEATURE(adreno_dev, ADRENO_64BIT))
			adreno_support_64bit(adreno_dev))
		gpudev->enable_64bit(adreno_dev);

	if (adreno_dev->perfctr_pwr_lo == 0) {
@@ -2140,7 +2140,7 @@ static int adreno_soft_reset(struct kgsl_device *device)

	/* Enable 64 bit gpu addr if feature is set */
	if (gpudev->enable_64bit &&
			ADRENO_FEATURE(adreno_dev, ADRENO_64BIT))
			adreno_support_64bit(adreno_dev))
		gpudev->enable_64bit(adreno_dev);

	/* Restore physical performance counter values after soft reset */
+17 −0
Original line number Diff line number Diff line
@@ -1396,4 +1396,21 @@ static inline bool adreno_long_ib_detect(struct adreno_device *adreno_dev)
		!test_bit(ADRENO_DEVICE_ISDB_ENABLED, &adreno_dev->priv);
}

/*
 * adreno_support_64bit() - Check the feature flag only if it is in
 * 64bit kernel otherwise return false
 * adreno_dev: The adreno device
 */
#if BITS_PER_LONG == 64
static inline bool adreno_support_64bit(struct adreno_device *adreno_dev)
{
	return ADRENO_FEATURE(adreno_dev, ADRENO_64BIT);
}
#else
static inline bool adreno_support_64bit(struct adreno_device *adreno_dev)
{
	return false;
}
#endif /*BITS_PER_LONG*/

#endif /*__ADRENO_H */