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

Commit ef2de6dc authored by Govindaraj Rajagopal's avatar Govindaraj Rajagopal Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Perform cache operations on all planes



Perform cache operations on all planes including buffer extradata
planes, since userspace may set cache flag on all planes.

Change-Id: I9cc6060ec7fb2626b4885c7df7592abae99fb955
Signed-off-by: default avatarMihir Ganu <mganu@codeaurora.org>
Signed-off-by: default avatarGovindaraj Rajagopal <grajagop@codeaurora.org>
parent 40e06473
Loading
Loading
Loading
Loading
+19 −27
Original line number Original line Diff line number Diff line
@@ -6743,40 +6743,33 @@ int msm_comm_qbuf_cache_operations(struct msm_vidc_inst *inst,
		unsigned long offset, size;
		unsigned long offset, size;
		enum smem_cache_ops cache_op;
		enum smem_cache_ops cache_op;


		skip = true;
		offset = vb->planes[i].data_offset;
		size = vb->planes[i].length - offset;
		cache_op = SMEM_CACHE_INVALIDATE;
		skip = false;

		if (inst->session_type == MSM_VIDC_DECODER) {
		if (inst->session_type == MSM_VIDC_DECODER) {
			if (vb->type == INPUT_MPLANE) {
			if (vb->type == INPUT_MPLANE) {
				if (!i) { /* bitstream */
				if (!i) { /* bitstream */
					skip = false;
					offset = vb->planes[i].data_offset;
					size = vb->planes[i].bytesused;
					size = vb->planes[i].bytesused;
					cache_op = SMEM_CACHE_CLEAN_INVALIDATE;
					cache_op = SMEM_CACHE_CLEAN_INVALIDATE;
				}
				}
			} else if (vb->type == OUTPUT_MPLANE) {
			} else if (vb->type == OUTPUT_MPLANE) {
				if (!i) { /* yuv */
				if (!i) { /* yuv */
					skip = false;
					/* all values are correct */
					offset = 0;
					size = vb->planes[i].length;
					cache_op = SMEM_CACHE_INVALIDATE;
				}
				}
			}
			}
		} else if (inst->session_type == MSM_VIDC_ENCODER) {
		} else if (inst->session_type == MSM_VIDC_ENCODER) {
			if (vb->type == INPUT_MPLANE) {
			if (vb->type == INPUT_MPLANE) {
				if (!i) { /* yuv */
				if (!i) { /* yuv */
					skip = false;
					offset = vb->planes[i].data_offset;
					size = vb->planes[i].bytesused;
					size = vb->planes[i].bytesused;
					cache_op = SMEM_CACHE_CLEAN_INVALIDATE;
					cache_op = SMEM_CACHE_CLEAN_INVALIDATE;
				} else { /* extradata */
					cache_op = SMEM_CACHE_CLEAN_INVALIDATE;
				}
				}
			} else if (vb->type == OUTPUT_MPLANE) {
			} else if (vb->type == OUTPUT_MPLANE) {
				if (!i) { /* bitstream */
				if (!i && inst->max_filled_len)
					skip = false;
					offset = 0;
					size = vb->planes[i].length;
					if (inst->max_filled_len)
					size = inst->max_filled_len;
					size = inst->max_filled_len;
					cache_op = SMEM_CACHE_INVALIDATE;
				}
			}
			}
		}
		}


@@ -6811,26 +6804,26 @@ int msm_comm_dqbuf_cache_operations(struct msm_vidc_inst *inst,
		unsigned long offset, size;
		unsigned long offset, size;
		enum smem_cache_ops cache_op;
		enum smem_cache_ops cache_op;


		skip = true;
		offset = vb->planes[i].data_offset;
		size = vb->planes[i].length - offset;
		cache_op = SMEM_CACHE_INVALIDATE;
		skip = false;

		if (inst->session_type == MSM_VIDC_DECODER) {
		if (inst->session_type == MSM_VIDC_DECODER) {
			if (vb->type == INPUT_MPLANE) {
			if (vb->type == INPUT_MPLANE) {
				/* bitstream and extradata */
				if (!i) /* bitstream */
				/* we do not need cache operations */
					skip = true;
			} else if (vb->type == OUTPUT_MPLANE) {
			} else if (vb->type == OUTPUT_MPLANE) {
				if (!i) { /* yuv */
				if (!i) { /* yuv */
					skip = false;
					/* All values are correct */
					offset = vb->planes[i].data_offset;
					size = vb->planes[i].bytesused;
					cache_op = SMEM_CACHE_INVALIDATE;
				}
				}
			}
			}
		} else if (inst->session_type == MSM_VIDC_ENCODER) {
		} else if (inst->session_type == MSM_VIDC_ENCODER) {
			if (vb->type == INPUT_MPLANE) {
			if (vb->type == INPUT_MPLANE) {
				/* yuv and extradata */
				/* yuv and extradata */
				/* we do not need cache operations */
				skip = true;
			} else if (vb->type == OUTPUT_MPLANE) {
			} else if (vb->type == OUTPUT_MPLANE) {
				if (!i) { /* bitstream */
				if (!i) { /* bitstream */
					skip = false;
					/*
					/*
					 * Include vp8e header bytes as well
					 * Include vp8e header bytes as well
					 * by making offset equal to zero
					 * by making offset equal to zero
@@ -6838,7 +6831,6 @@ int msm_comm_dqbuf_cache_operations(struct msm_vidc_inst *inst,
					offset = 0;
					offset = 0;
					size = vb->planes[i].bytesused +
					size = vb->planes[i].bytesused +
						vb->planes[i].data_offset;
						vb->planes[i].data_offset;
					cache_op = SMEM_CACHE_INVALIDATE;
				}
				}
			}
			}
		}
		}