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

Commit 1850e54b authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: kgsl: Make the dma_set_coherent_mask call universal"

parents 535bf08d 33b3587e
Loading
Loading
Loading
Loading
+11 −0
Original line number Diff line number Diff line
@@ -57,6 +57,12 @@
#define pgprot_writethroughcache(_prot)	(_prot)
#endif

#ifdef CONFIG_ARM_LPAE
#define KGSL_DMA_BIT_MASK	DMA_BIT_MASK(64)
#else
#define KGSL_DMA_BIT_MASK	DMA_BIT_MASK(32)
#endif

static char *ksgl_mmu_type;
module_param_named(mmutype, ksgl_mmu_type, charp, 0);
MODULE_PARM_DESC(ksgl_mmu_type,
@@ -4213,6 +4219,11 @@ int kgsl_device_platform_probe(struct kgsl_device *device)
		goto error_dest_work_q;
	}

	/* Check to see if our device can perform DMA correctly */
	status = dma_set_coherent_mask(&pdev->dev, KGSL_DMA_BIT_MASK);
	if (status)
		goto error_close_mmu;

	status = kgsl_allocate_contiguous(device, &device->memstore,
		KGSL_MEMSTORE_SIZE);

+3 −7
Original line number Diff line number Diff line
@@ -380,15 +380,11 @@ int kgsl_mmu_init(struct kgsl_device *device)
	kgsl_sharedmem_set(device, &mmu->setstate_memory, 0, 0,
				mmu->setstate_memory.size);

	if (KGSL_MMU_TYPE_NONE == kgsl_mmu_type) {
		status = dma_set_coherent_mask(device->dev->parent,
					DMA_BIT_MASK(sizeof(dma_addr_t)*8));
		goto done;
	} else if (KGSL_MMU_TYPE_IOMMU == kgsl_mmu_type)
	if (KGSL_MMU_TYPE_IOMMU == kgsl_mmu_type) {
		mmu->mmu_ops = &iommu_ops;

		status =  mmu->mmu_ops->mmu_init(mmu);
done:
	}

	if (status)
		kgsl_sharedmem_free(&mmu->setstate_memory);
	return status;