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

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

Merge "msm: mdss: use delayed unmap for smmu mappings"

parents 21d0f545 a8fb3aac
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -192,7 +192,7 @@ struct mdss_smmu_ops {
			struct sg_table *table, int domain,
			dma_addr_t *iova, unsigned long *size, int dir);
	void (*smmu_unmap_dma_buf)(struct sg_table *table, int domain,
			int dir);
			int dir, struct dma_buf *dma_buf);
	int (*smmu_dma_alloc_coherent)(struct device *dev, size_t size,
			dma_addr_t *phys, dma_addr_t *iova, void *cpu_addr,
			gfp_t gfp, int domain);
+1 −1
Original line number Diff line number Diff line
@@ -1669,7 +1669,7 @@ void mdss_fb_free_fb_ion_memory(struct msm_fb_data_type *mfd)
	if (mfd->mdp.fb_mem_get_iommu_domain) {
		mdss_smmu_unmap_dma_buf(mfd->fb_table,
				mfd->mdp.fb_mem_get_iommu_domain(),
				DMA_BIDIRECTIONAL);
				DMA_BIDIRECTIONAL, mfd->fbmem_buf);
		dma_buf_unmap_attachment(mfd->fb_attachment, mfd->fb_table,
				DMA_BIDIRECTIONAL);
		dma_buf_detach(mfd->fbmem_buf, mfd->fb_attachment);
+3 −2
Original line number Diff line number Diff line
@@ -104,7 +104,7 @@ static int mdss_mdp_splash_alloc_memory(struct msm_fb_data_type *mfd,
	return rc;
kmap_err:
	mdss_smmu_unmap_dma_buf(sinfo->table, MDSS_IOMMU_DOMAIN_UNSECURE,
			DMA_BIDIRECTIONAL);
			DMA_BIDIRECTIONAL, sinfo->dma_buf);
err_unmap:
	dma_buf_unmap_attachment(sinfo->attachment, sinfo->table,
			DMA_BIDIRECTIONAL);
@@ -135,7 +135,8 @@ static void mdss_mdp_splash_free_memory(struct msm_fb_data_type *mfd)
	dma_buf_end_cpu_access(sinfo->dma_buf, 0, sinfo->size, DMA_FROM_DEVICE);
	dma_buf_kunmap(sinfo->dma_buf, 0, sinfo->splash_buffer);

	mdss_smmu_unmap_dma_buf(sinfo->table, MDSS_IOMMU_DOMAIN_UNSECURE, 0);
	mdss_smmu_unmap_dma_buf(sinfo->table, MDSS_IOMMU_DOMAIN_UNSECURE, 0,
				sinfo->dma_buf);
	dma_buf_unmap_attachment(sinfo->attachment, sinfo->table,
			DMA_BIDIRECTIONAL);
	dma_buf_detach(sinfo->dma_buf, sinfo->attachment);
+2 −1
Original line number Diff line number Diff line
@@ -832,7 +832,8 @@ static int mdss_mdp_put_img(struct mdss_mdp_img_data *data, bool rotator,
				domain = mdss_smmu_get_domain_type(data->flags,
					rotator);
				mdss_smmu_unmap_dma_buf(data->srcp_table,
						domain, dir);
							domain, dir,
							data->srcp_dma_buf);
				data->mapped = false;
			}
			dma_buf_unmap_attachment(data->srcp_attachment,
+6 −3
Original line number Diff line number Diff line
@@ -24,6 +24,7 @@
#include <linux/dma-mapping.h>
#include <linux/dma-buf.h>
#include <linux/of_platform.h>
#include <linux/msm_dma_iommu_mapping.h>

#include <asm/dma-iommu.h>
#include "soc/qcom/secure_buffer.h"
@@ -260,7 +261,8 @@ static int mdss_smmu_map_dma_buf_v2(struct dma_buf *dma_buf,
		return -EINVAL;
	}
	ATRACE_BEGIN("map_buffer");
	rc = dma_map_sg(mdss_smmu->dev, table->sgl, table->nents, dir);
	rc = msm_dma_map_sg_lazy(mdss_smmu->dev, table->sgl, table->nents, dir,
		dma_buf);
	if (!rc) {
		pr_err("dma map sg failed\n");
		return -ENOMEM;
@@ -272,7 +274,7 @@ static int mdss_smmu_map_dma_buf_v2(struct dma_buf *dma_buf,
}

static void mdss_smmu_unmap_dma_buf_v2(struct sg_table *table, int domain,
		int dir)
		int dir, struct dma_buf *dma_buf)
{
	struct mdss_smmu_client *mdss_smmu = mdss_smmu_get_cb(domain);
	if (!mdss_smmu) {
@@ -281,7 +283,8 @@ static void mdss_smmu_unmap_dma_buf_v2(struct sg_table *table, int domain,
	}

	ATRACE_BEGIN("unmap_buffer");
	dma_unmap_sg(mdss_smmu->dev, table->sgl, table->nents, dir);
	msm_dma_unmap_sg(mdss_smmu->dev, table->sgl, table->nents, dir,
		 dma_buf);
	ATRACE_END("unmap_buffer");
}

Loading