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

Commit 6f732e04 authored by Vaibhav Deshu Venkatesh's avatar Vaibhav Deshu Venkatesh Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Cache invalidate performance fix



When allocate buffer is used we allocate one huge buffer
with offsets instead of allocating multiple small buffers.
During cache invalidate we pass this big buffer and the
size passed is the size of this big buffer. This causes
performance issue. Instead we now pass the actual offsetted
buffer and smaller individual buffer size for invalidation.

CRs-Fixed: 1096624
Change-Id: Ifad386882e4a404b1e455cc3e11ae0e820d2a577
Signed-off-by: default avatarVaibhav Deshu Venkatesh <vdeshuve@codeaurora.org>
Signed-off-by: default avatarChinmay Sawarkar <chinmays@codeaurora.org>
parent 243d79cf
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -513,10 +513,10 @@ static int ion_cache_operations(struct smem_client *client,
			rc = -EINVAL;
			goto cache_op_failed;
		}
		rc = msm_ion_do_cache_op(client->clnt,
		rc = msm_ion_do_cache_offset_op(client->clnt,
				(struct ion_handle *)mem->smem_priv,
				0, (unsigned long)mem->size,
				msm_cache_ops);
				0, mem->offset,
				(unsigned long)mem->size, msm_cache_ops);
		if (rc) {
			dprintk(VIDC_ERR,
					"cache operation failed %d\n", rc);
+6 −2
Original line number Diff line number Diff line
@@ -333,7 +333,7 @@ static inline void populate_buf_info(struct buffer_info *binfo,
	binfo->timestamp.tv_sec = b->timestamp.tv_sec;
	binfo->timestamp.tv_usec = b->timestamp.tv_usec;
	dprintk(VIDC_DBG, "%s: fd[%d] = %d b->index = %d",
			__func__, i, binfo->fd[0], b->index);
			__func__, i, binfo->fd[i], b->index);
}

static inline void repopulate_v4l2_buffer(struct v4l2_buffer *b,
@@ -658,8 +658,12 @@ int output_buffer_cache_invalidate(struct msm_vidc_inst *inst,

	for (i = 0; i < binfo->num_planes; i++) {
		if (binfo->handle[i]) {
			struct msm_smem smem = *binfo->handle[i];

			smem.offset = (unsigned int)(binfo->buff_off[i]);
			smem.size   = binfo->size[i];
			rc = msm_comm_smem_cache_operations(inst,
				binfo->handle[i], SMEM_CACHE_INVALIDATE);
				&smem, SMEM_CACHE_INVALIDATE);
			if (rc) {
				dprintk(VIDC_ERR,
					"%s: Failed to clean caches: %d\n",
+2 −1
Original line number Diff line number Diff line
/* Copyright (c) 2012-2015, The Linux Foundation. All rights reserved.
/* Copyright (c) 2012-2016, 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
@@ -68,6 +68,7 @@ struct msm_smem {
	void *smem_priv;
	enum hal_buffer buffer_type;
	struct dma_mapping_info mapping_info;
	unsigned int offset;
};

enum smem_cache_ops {