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

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

Merge "msm: sde: update dma buf lazy mapping for sde rotator"

parents 5ecc1000 782305fc
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
/* Copyright (c) 2015-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2015-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -335,14 +335,15 @@ int sde_smmu_map_dma_buf(struct dma_buf *dma_buf,
{
	int rc;
	struct sde_smmu_client *sde_smmu = sde_smmu_get_cb(domain);
	unsigned long attrs = 0;

	if (!sde_smmu) {
		SDEROT_ERR("not able to get smmu context\n");
		return -EINVAL;
	}

	rc = msm_dma_map_sg_lazy(sde_smmu->dev, table->sgl, table->nents, dir,
		dma_buf);
	rc = dma_map_sg_attrs(sde_smmu->dev, table->sgl, table->nents, dir,
			attrs);
	if (rc != table->nents) {
		SDEROT_ERR("dma map sg failed\n");
		return -ENOMEM;
@@ -363,8 +364,7 @@ void sde_smmu_unmap_dma_buf(struct sg_table *table, int domain,
		return;
	}

	msm_dma_unmap_sg(sde_smmu->dev, table->sgl, table->nents, dir,
		 dma_buf);
	dma_unmap_sg(sde_smmu->dev, table->sgl, table->nents, dir);
}

static DEFINE_MUTEX(sde_smmu_ref_cnt_lock);
+5 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012, 2015-2017, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012, 2015-2018, The Linux Foundation. All rights reserved.
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License version 2 and
@@ -788,6 +788,8 @@ static int sde_mdp_put_img(struct sde_mdp_img_data *data, bool rotator,
					data->len, domain, data->flags);
		}
		if (!data->skip_detach) {
			data->srcp_attachment->dma_map_attrs |=
				DMA_ATTR_DELAYED_UNMAP;
			dma_buf_unmap_attachment(data->srcp_attachment,
				data->srcp_table, dir);
			dma_buf_detach(data->srcp_dma_buf,
@@ -846,6 +848,7 @@ static int sde_mdp_get_img(struct sde_fb_data *img,
		}

		SDEROT_DBG("%d attach=%p\n", __LINE__, data->srcp_attachment);
		data->srcp_attachment->dma_map_attrs |= DMA_ATTR_DELAYED_UNMAP;
		data->srcp_table =
			dma_buf_map_attachment(data->srcp_attachment, dir);
		if (IS_ERR(data->srcp_table)) {
@@ -872,6 +875,7 @@ static int sde_mdp_get_img(struct sde_fb_data *img,
			goto err_put;
		}

		data->srcp_attachment->dma_map_attrs |= DMA_ATTR_DELAYED_UNMAP;
		data->srcp_table = dma_buf_map_attachment(
				data->srcp_attachment, dir);
		if (IS_ERR(data->srcp_table)) {