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

Commit 4e8af293 authored by Carter Cooper's avatar Carter Cooper Committed by Gerrit - the friendly Code Review server
Browse files

msm: kgsl: Set up DMA map ops and DMA mask for KGSL



The DMA API expects the dma_map_ops and dma_mask for the
KGSL device to be initialized. Otherwise, it falls back
to using bounce buffers.

Change-Id: I1d4b668a5f179f6c49ce8d60a76062c57e1afae2
Signed-off-by: default avatarUrvashi Agrawal <urvaagra@codeaurora.org>
Signed-off-by: default avatarKyle Piefer <kpiefer@codeaurora.org>
Signed-off-by: default avatarCarter Cooper <ccooper@codeaurora.org>
parent 8aa0accf
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -2549,6 +2549,8 @@ static int kgsl_setup_dma_buf(struct kgsl_device *device,
		return -ENOMEM;

	attach = dma_buf_attach(dmabuf, device->dev);
	attach->dma_map_attrs |= DMA_ATTR_SKIP_CPU_SYNC;

	if (IS_ERR_OR_NULL(attach)) {
		ret = attach ? PTR_ERR(attach) : -EINVAL;
		goto out;
@@ -2557,8 +2559,6 @@ static int kgsl_setup_dma_buf(struct kgsl_device *device,
	meta->dmabuf = dmabuf;
	meta->attach = attach;

	attach->priv = entry;

	entry->priv_data = meta;
	entry->memdesc.pagetable = pagetable;
	entry->memdesc.size = 0;
@@ -4587,6 +4587,7 @@ static void _unregister_device(struct kgsl_device *device)

static int _register_device(struct kgsl_device *device)
{
	static u64 dma_mask = DMA_BIT_MASK(64);
	int minor, ret;
	dev_t dev;

@@ -4622,6 +4623,9 @@ static int _register_device(struct kgsl_device *device)
		return ret;
	}

	device->dev->dma_mask = &dma_mask;
	arch_setup_dma_ops(device->dev, 0, 0, NULL, false);

	dev_set_drvdata(&device->pdev->dev, device);
	return 0;
}