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

Commit 1f5dfcc2 authored by Tarun Karra's avatar Tarun Karra
Browse files

msm: kgsl: Check for SMMU v2 version only once



Check for SMMU v2 version only once and cache the result,
making this check every time is expensive operation and can
affect performance.

CRs-fixed: 641951
Change-Id: Ica57561d3910e3144bd31543852a9d005273a1d0
Signed-off-by: default avatarTarun Karra <tkarra@codeaurora.org>
parent 27a70795
Loading
Loading
Loading
Loading
+5 −7
Original line number Diff line number Diff line
@@ -281,17 +281,15 @@ static inline int _kgsl_msm_checks_iommu_v2(void)
#endif

#if !defined(CONFIG_MSM_IOMMU_V0) && defined(CONFIG_OF)
static int soc_supports_v2 = -1;
static inline int kgsl_msm_supports_iommu_v2(void)
{
	static int soc_supports_v2 = -1;

	if (soc_supports_v2 != -1)
		return soc_supports_v2;
	if (_kgsl_msm_checks_iommu_v2()) {
		soc_supports_v2 = 1;
		return 1;
	}
	return 0;

	soc_supports_v2 = _kgsl_msm_checks_iommu_v2();

	return soc_supports_v2;
}
#else
static inline int kgsl_msm_supports_iommu_v2(void)