summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRajesh Kemisetti <rajeshk@codeaurora.org>2015-11-29 18:01:52 +0530
committerDavid Keitel <dkeitel@codeaurora.org>2016-03-23 21:12:33 -0700
commitdd68fb8d5b1f17086b0715daba3da5647d869a08 (patch)
tree0ab57d799d253d128f28f329fd29a8b93f458149
parentf8beb5f99e43cdc6c72df7001fe652892b3898dc (diff)
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: Rajesh Kemisetti <rajeshk@codeaurora.org>
-rw-r--r--drivers/gpu/msm/adreno.c6
-rw-r--r--drivers/gpu/msm/adreno.h17
2 files changed, 20 insertions, 3 deletions
diff --git a/drivers/gpu/msm/adreno.c b/drivers/gpu/msm/adreno.c
index b74e3b54f331..3420e91c0275 100644
--- a/drivers/gpu/msm/adreno.c
+++ b/drivers/gpu/msm/adreno.c
@@ -1078,7 +1078,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);
@@ -1446,7 +1446,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) {
@@ -2139,7 +2139,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 */
diff --git a/drivers/gpu/msm/adreno.h b/drivers/gpu/msm/adreno.h
index a45da5162c12..93f4022e9cd8 100644
--- a/drivers/gpu/msm/adreno.h
+++ b/drivers/gpu/msm/adreno.h
@@ -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 */