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

Commit 86dc23c3 authored by qctecmdr's avatar qctecmdr Committed by Gerrit - the friendly Code Review server
Browse files

Merge "msm: vidc: Perform cache operations on all planes"

parents db0e597b ef2de6dc
Loading
Loading
Loading
Loading
+19 −27
Original line number Diff line number Diff line
@@ -6753,40 +6753,33 @@ int msm_comm_qbuf_cache_operations(struct msm_vidc_inst *inst,
		unsigned long offset, size;
		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 (vb->type == INPUT_MPLANE) {
				if (!i) { /* bitstream */
					skip = false;
					offset = vb->planes[i].data_offset;
					size = vb->planes[i].bytesused;
					cache_op = SMEM_CACHE_CLEAN_INVALIDATE;
				}
			} else if (vb->type == OUTPUT_MPLANE) {
				if (!i) { /* yuv */
					skip = false;
					offset = 0;
					size = vb->planes[i].length;
					cache_op = SMEM_CACHE_INVALIDATE;
					/* all values are correct */
				}
			}
		} else if (inst->session_type == MSM_VIDC_ENCODER) {
			if (vb->type == INPUT_MPLANE) {
				if (!i) { /* yuv */
					skip = false;
					offset = vb->planes[i].data_offset;
					size = vb->planes[i].bytesused;
					cache_op = SMEM_CACHE_CLEAN_INVALIDATE;
				} else { /* extradata */
					cache_op = SMEM_CACHE_CLEAN_INVALIDATE;
				}
			} else if (vb->type == OUTPUT_MPLANE) {
				if (!i) { /* bitstream */
					skip = false;
					offset = 0;
					size = vb->planes[i].length;
					if (inst->max_filled_len)
				if (!i && inst->max_filled_len)
					size = inst->max_filled_len;
					cache_op = SMEM_CACHE_INVALIDATE;
				}
			}
		}

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