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

Commit fc9f422c authored by Jayant Shekhar's avatar Jayant Shekhar
Browse files

fbdev: msm: Correct ion sequence for splash and pan display



Make changes as per ion call sequence shared by memory team.
dma buf get is not required after dma buf allocation. If not,
put has to be done twice. So remove the redundant get buf
and get fd calls.

Change-Id: I4a521815a9bf75cb12d399a5643a8ef31a1dc2ca
Signed-off-by: default avatarJayant Shekhar <jshekhar@codeaurora.org>
parent e15f923a
Loading
Loading
Loading
Loading
+0 −8
Original line number Diff line number Diff line
@@ -2171,14 +2171,6 @@ int mdss_fb_alloc_fb_ion_memory(struct msm_fb_data_type *mfd, size_t fb_size)
	}

	if (mfd->mdp.fb_mem_get_iommu_domain) {
		fd = dma_buf_fd(mfd->fbmem_buf, 0);
		if (IS_ERR(mfd->fbmem_buf)) {
			rc = PTR_ERR(mfd->fbmem_buf);
			goto fb_mmap_failed;
		}

		mfd->fbmem_buf = dma_buf_get(fd);

		domain = mfd->mdp.fb_mem_get_iommu_domain();

		mfd->fb_attachment = mdss_smmu_dma_buf_attach(mfd->fbmem_buf,
+3 −14
Original line number Diff line number Diff line
@@ -39,8 +39,6 @@ static int mdss_mdp_splash_alloc_memory(struct msm_fb_data_type *mfd,
	struct msm_fb_splash_info *sinfo;
	unsigned long buf_size = size;
	struct mdss_data_type *mdata;
	struct dma_buf *dma_buf = NULL;
	int fd = 0;

	if (!mfd || !size)
		return -EINVAL;
@@ -51,19 +49,10 @@ static int mdss_mdp_splash_alloc_memory(struct msm_fb_data_type *mfd,
	if (!mdata || sinfo->splash_buffer)
		return -EINVAL;

	dma_buf = ion_alloc(size, ION_HEAP(ION_SYSTEM_HEAP_ID), 0);
	if (IS_ERR_OR_NULL(dma_buf)) {
	sinfo->dma_buf = ion_alloc(size, ION_HEAP(ION_SYSTEM_HEAP_ID), 0);
	if (IS_ERR_OR_NULL(sinfo->dma_buf)) {
		pr_err("ion memory allocation failed\n");
		rc = PTR_RET(dma_buf);
		goto end;
	}

	fd = dma_buf_fd(dma_buf, 0);

	sinfo->size = size;
	sinfo->dma_buf = dma_buf_get(fd);
	if (IS_ERR(sinfo->dma_buf)) {
		rc = PTR_ERR(sinfo->dma_buf);
		rc = PTR_RET(sinfo->dma_buf);
		goto end;
	}