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

Commit d23a4d38 authored by Sachin Bhayare's avatar Sachin Bhayare Committed by Krishna Manikandan
Browse files

msm: mdss: fix SMMU attach issue when using gpu composition



When gpu composition is used as default composition type.
SMMU is not attached by the time OVERLAY_PLAY ioctl get called.
This results in incorrect mapping of the buffer and causes failure
for subsequent OVERLAY_PLAY request for the same buffer.

Fix the issue by calling SMMU attach before mapping buffer in SMMU
page table via OVERLAY_PLAY ioctl.

Change-Id: Ia09b95d911aef86d0689ddb4cf7b8057d5c4f15a
Signed-off-by: default avatarSachin Bhayare <sachin.bhayare@codeaurora.org>
parent 6bf146d3
Loading
Loading
Loading
Loading
+19 −5
Original line number Diff line number Diff line
@@ -1199,16 +1199,26 @@ static int mdp3_overlay_queue_buffer(struct msm_fb_data_type *mfd,
					struct msmfb_overlay_data *req)
{
	int rc;
	bool is_panel_type_cmd = false;
	struct mdp3_session_data *mdp3_session = mfd->mdp.private1;
	struct msmfb_data *img = &req->data;
	struct mdp3_img_data data;
	struct mdp3_dma *dma = mdp3_session->dma;

	memset(&data, 0, sizeof(struct mdp3_img_data));
	if (mfd->panel.type == MIPI_CMD_PANEL)
		is_panel_type_cmd = true;
	if (is_panel_type_cmd) {
		rc = mdp3_iommu_enable(MDP3_CLIENT_DMA_P);
		if (rc) {
			pr_err("fail to enable iommu\n");
			return rc;
		}
	}
	rc = mdp3_get_img(img, &data, MDP3_CLIENT_DMA_P);
	if (rc) {
		pr_err("fail to get overlay buffer\n");
		return rc;
		goto err;
	}

	if (data.len < dma->source_config.stride * dma->source_config.height) {
@@ -1216,16 +1226,20 @@ static int mdp3_overlay_queue_buffer(struct msm_fb_data_type *mfd,
			data.len, (dma->source_config.stride *
			dma->source_config.height));
		mdp3_put_img(&data, MDP3_CLIENT_DMA_P);
		return -EINVAL;
		rc = -EINVAL;
		goto err;
	}

	rc = mdp3_bufq_push(&mdp3_session->bufq_in, &data);
	if (rc) {
		pr_err("fail to queue the overlay buffer, buffer drop\n");
		mdp3_put_img(&data, MDP3_CLIENT_DMA_P);
		return rc;
		goto err;
	}
	return 0;
	rc = 0;
err:
	if (is_panel_type_cmd)
		mdp3_iommu_disable(MDP3_CLIENT_DMA_P);
	return rc;
}

static int mdp3_overlay_play(struct msm_fb_data_type *mfd,