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

Commit e0f3d49f authored by Steve Cohen's avatar Steve Cohen
Browse files

drm/msm: avoid segmentation of dma_buf mappings



Ensure dma_buf mappings aren't broken in to multiple segments
by setting the devices segment size and boundary.  This will
improve performance and the sg_dma_len() API will now give
the correct buffer size.

Change-Id: Ic3a3c520ea488d367c8df0f1ce7aca5000e9f3e7
Signed-off-by: default avatarSteve Cohen <cohens@codeaurora.org>
parent f6ea99ce
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -488,6 +488,13 @@ static int _msm_smmu_create_mapping(struct msm_smmu_client *client,
		}
	}

	if (!client->dev->dma_parms)
		client->dev->dma_parms = devm_kzalloc(client->dev,
				sizeof(*client->dev->dma_parms), GFP_KERNEL);

	dma_set_max_seg_size(client->dev, DMA_BIT_MASK(32));
	dma_set_seg_boundary(client->dev, DMA_BIT_MASK(64));

	iommu_set_fault_handler(client->mmu_mapping->domain,
			msm_smmu_fault_handler, (void *)client);