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

Commit 9d4949eb authored by Deepak Kumar's avatar Deepak Kumar
Browse files

msm: kgsl: Set iommu upstream hint flag only if LLCC is enabled



Currently, driver is setting IOMMU_USE_UPSTREAM_HINT flag based on
whether DOMAIN_ATTR_USE_LLC_NWA is set or not, which is incorrect
as this should be set only if corresponding iommu domain attribtute
DOMAIN_ATTR_USE_UPSTREAM_HINT is set. This is needed to make sure
we don't set IOMMU_USE_UPSTREAM_HINT if CONFIG_QCOM_LLCC is not
enabled as DOMAIN_ATTR_USE_UPSTREAM_HINT will only be set if LLCC
is enabled.

Change-Id: Ic33edcf2976dcd2c0a04aef567269f666223ec45
Signed-off-by: default avatarDeepak Kumar <dkumar@codeaurora.org>
parent 0e94b3ea
Loading
Loading
Loading
Loading
+8 −4
Original line number Diff line number Diff line
@@ -1823,15 +1823,19 @@ static unsigned int _get_protection_flags(struct kgsl_pagetable *pt,
{
	unsigned int flags = IOMMU_READ | IOMMU_WRITE |
		IOMMU_NOEXEC;
	int ret, llc_nwa = 0;
	int ret, llc_nwa = 0, upstream_hint = 0;
	struct kgsl_iommu_pt *iommu_pt = pt->priv;

	ret = iommu_domain_get_attr(iommu_pt->domain,
				DOMAIN_ATTR_USE_LLC_NWA, &llc_nwa);
				DOMAIN_ATTR_USE_UPSTREAM_HINT, &upstream_hint);

	if (ret || (llc_nwa == 0))
	if (!ret && upstream_hint)
		flags |= IOMMU_USE_UPSTREAM_HINT;
	else

	ret = iommu_domain_get_attr(iommu_pt->domain,
				DOMAIN_ATTR_USE_LLC_NWA, &llc_nwa);

	if (!ret && llc_nwa)
		flags |= IOMMU_USE_LLC_NWA;

	if (memdesc->flags & KGSL_MEMFLAGS_GPUREADONLY)