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

Commit c96cf682 authored by Dhaval Patel's avatar Dhaval Patel Committed by Gerrit - the friendly Code Review server
Browse files

msm: mdss: set the correct buffer state after operation



Rotator modules uses the buffer but does not set the
correct state. Configure the buffer state, alloc time,
free time, data planes to provide valid information
during debugging.

Change-Id: I7e0942699abfbd3a4be9c531a6174cdc917b22a4
Signed-off-by: default avatarDhaval Patel <pdhaval@codeaurora.org>
parent 46d4e4a5
Loading
Loading
Loading
Loading
+1 −0
Original line number Diff line number Diff line
@@ -1320,6 +1320,7 @@ void mdss_mdp_data_free(struct mdss_mdp_data *data, bool rotator, int dir)
	mdss_iommu_ctrl(1);
	for (i = 0; i < data->num_planes && data->p[i].len; i++)
		mdss_mdp_put_img(&data->p[i], rotator, dir);
	memset(&data->p, 0, sizeof(struct mdss_mdp_img_data) * MAX_PLANES);
	mdss_iommu_ctrl(0);

	data->num_planes = 0;
+14 −2
Original line number Diff line number Diff line
@@ -508,6 +508,8 @@ static int mdss_rotator_import_buffer(struct mdp_layer_buffer *buffer,

	ret =  mdss_mdp_data_get_and_validate_size(data, planes,
			buffer->plane_count, flags, dev, true, dir, buffer);
	data->state = MDP_BUF_STATE_READY;
	data->last_alloc = local_clock();

	return ret;
}
@@ -534,12 +536,14 @@ static int mdss_rotator_map_and_check_data(struct mdss_rot_entry *entry)
	}

	/* if error during map, the caller will release the data */
	entry->src_buf.state = MDP_BUF_STATE_ACTIVE;
	ret = mdss_mdp_data_map(&entry->src_buf, true, DMA_TO_DEVICE);
	if (ret) {
		pr_err("source buffer mapping failed ret:%d\n", ret);
		goto end;
	}

	entry->dst_buf.state = MDP_BUF_STATE_ACTIVE;
	ret = mdss_mdp_data_map(&entry->dst_buf, true, DMA_FROM_DEVICE);
	if (ret) {
		pr_err("destination buffer mapping failed ret:%d\n", ret);
@@ -624,8 +628,16 @@ static struct mdss_rot_perf *mdss_rotator_find_session(

static void mdss_rotator_release_data(struct mdss_rot_entry *entry)
{
	mdss_mdp_data_free(&entry->src_buf, true, DMA_TO_DEVICE);
	mdss_mdp_data_free(&entry->dst_buf, true, DMA_FROM_DEVICE);
	struct mdss_mdp_data *src_buf = &entry->src_buf;
	struct mdss_mdp_data *dst_buf = &entry->dst_buf;

	mdss_mdp_data_free(src_buf, true, DMA_TO_DEVICE);
	src_buf->last_freed = local_clock();
	src_buf->state = MDP_BUF_STATE_UNUSED;

	mdss_mdp_data_free(dst_buf, true, DMA_FROM_DEVICE);
	dst_buf->last_freed = local_clock();
	dst_buf->state = MDP_BUF_STATE_UNUSED;
}

static int mdss_rotator_import_data(struct mdss_rot_mgr *mgr,