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

Commit fa2608e8 authored by Hareesh Gundu's avatar Hareesh Gundu Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Fix 32 bit kernel compilation errors



setup_64bit_pagetable() referring to is_compat_task(),
which is undefined for 32 bit kernel configuration.
is_compat_task() is defined for 32 bit arm but we were
relying on an implicit include on arm64. <linux/compat.h>
having the definition for 32 bit kernel, include this file
to fix compilation error. Here is_compat_task() doesn't
do what we need for 32 bit kernel.

Also Don't enable KGSL_MMU_64BIT feature for 32 bit
kernel configuration. As all of the iommu apis use
long for iova's and configure the SMMU hardware for
32 bit page tables.

Change-Id: I71393bdc149b78f4c1ed32fe78b6f80290e7e579
Signed-off-by: default avatarHareesh Gundu <hareeshg@codeaurora.org>
parent 1abae077
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -1111,8 +1111,12 @@ static int adreno_probe(struct platform_device *pdev)
		return status;
	}

	/* Bro, do you even 64 bit? */
	if (ADRENO_FEATURE(adreno_dev, ADRENO_64BIT))
	/*
	* The SMMU APIs use unsigned long for virtual addresses which means
	* 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))
		device->mmu.features |= KGSL_MMU_64BIT;

	status = kgsl_device_platform_probe(device);
+2 −1
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include <soc/qcom/scm.h>
#include <soc/qcom/secure_buffer.h>
#include <stddef.h>
#include <linux/compat.h>

#include "kgsl.h"
#include "kgsl_device.h"
@@ -523,7 +524,7 @@ static void setup_64bit_pagetable(struct kgsl_mmu *mmu,

	if (pagetable->name != KGSL_MMU_GLOBAL_PT &&
		pagetable->name != KGSL_MMU_SECURE_PT) {
		if (is_compat_task()) {
		if ((BITS_PER_LONG == 32) || is_compat_task()) {
			pt->svm_start = KGSL_IOMMU_SVM_BASE32;
			pt->svm_end = KGSL_IOMMU_SVM_END32;
		} else {