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

Commit 27c972cc 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 dmabuf cache maintenance control"

parents 17e77f21 ac8e339e
Loading
Loading
Loading
Loading
+2 −6
Original line number Diff line number Diff line
@@ -708,17 +708,13 @@ static int sde_rotator_map_and_check_data(struct sde_rot_entry *entry)
	}

	/* if error during map, the caller will release the data */
	ret = sde_mdp_data_map(&entry->src_buf, true, DMA_TO_DEVICE,
			sde_mdp_is_ubwc_format(in_fmt) ||
			sde_mdp_is_tilea5x_format(in_fmt));
	ret = sde_mdp_data_map(&entry->src_buf, true, DMA_TO_DEVICE);
	if (ret) {
		SDEROT_ERR("source buffer mapping failed ret:%d\n", ret);
		goto end;
	}

	ret = sde_mdp_data_map(&entry->dst_buf, true, DMA_FROM_DEVICE,
			sde_mdp_is_ubwc_format(out_fmt) ||
			sde_mdp_is_tilea5x_format(out_fmt));
	ret = sde_mdp_data_map(&entry->dst_buf, true, DMA_FROM_DEVICE);
	if (ret) {
		SDEROT_ERR("destination buffer mapping failed ret:%d\n", ret);
		goto end;
+18 −7
Original line number Diff line number Diff line
@@ -31,6 +31,7 @@
#include <linux/regulator/consumer.h>
#include <media/msm_media_info.h>
#include <linux/videodev2.h>
#include <linux/ion.h>

#include "sde_rotator_util.h"
#include "sde_rotator_smmu.h"
@@ -868,13 +869,14 @@ static int sde_mdp_get_img(struct sde_fb_data *img,
}

static int sde_mdp_map_buffer(struct sde_mdp_img_data *data, bool rotator,
		int dir, bool skip_sync)
		int dir)
{
	int ret = -EINVAL;
	int domain;
	struct scatterlist *sg;
	unsigned int i;
	struct sg_table *table;
	unsigned long flags = 0;

	if (data->addr && data->len)
		return 0;
@@ -894,9 +896,19 @@ static int sde_mdp_map_buffer(struct sde_mdp_img_data *data, bool rotator,
		 */
		data->srcp_attachment->dma_map_attrs |=
			DMA_ATTR_DELAYED_UNMAP;
		if (skip_sync)

		if (data->srcp_dma_buf && data->srcp_dma_buf->ops &&
				data->srcp_dma_buf->ops->get_flags) {
			if (data->srcp_dma_buf->ops->get_flags(
						data->srcp_dma_buf,
						&flags) == 0) {
				if ((flags & ION_FLAG_CACHED) == 0) {
					SDEROT_DBG("dmabuf is uncached type\n");
					data->srcp_attachment->dma_map_attrs |=
						DMA_ATTR_SKIP_CPU_SYNC;
				}
			}
		}

		if (sde_mdp_is_map_needed(data)) {
			data->srcp_table =
@@ -1016,8 +1028,7 @@ static int sde_mdp_data_get(struct sde_mdp_data *data,
	return rc;
}

int sde_mdp_data_map(struct sde_mdp_data *data, bool rotator, int dir,
		bool skip_sync)
int sde_mdp_data_map(struct sde_mdp_data *data, bool rotator, int dir)
{
	int i, rc = 0;

@@ -1025,7 +1036,7 @@ int sde_mdp_data_map(struct sde_mdp_data *data, bool rotator, int dir,
		return -EINVAL;

	for (i = 0; i < data->num_planes; i++) {
		rc = sde_mdp_map_buffer(&data->p[i], rotator, dir, skip_sync);
		rc = sde_mdp_map_buffer(&data->p[i], rotator, dir);
		if (rc) {
			SDEROT_ERR("failed to map buf p=%d\n", i);
			while (i > 0) {
+1 −2
Original line number Diff line number Diff line
@@ -194,8 +194,7 @@ int sde_mdp_get_plane_sizes(struct sde_mdp_format_params *fmt, u32 w, u32 h,
	struct sde_mdp_plane_sizes *ps, u32 bwc_mode,
	bool rotation);

int sde_mdp_data_map(struct sde_mdp_data *data, bool rotator, int dir,
		bool skip_sync);
int sde_mdp_data_map(struct sde_mdp_data *data, bool rotator, int dir);

int sde_mdp_data_check(struct sde_mdp_data *data,
			struct sde_mdp_plane_sizes *ps,