summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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 */