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

Commit 56592eca authored by Maheshwar Ajja's avatar Maheshwar Ajja
Browse files

msm: vidc: Invalidate video encoder output buffer



Invalidate encoder output buffer before giving it
to userspace to avoid corruption in encoded data.

CRs-Fixed: 2154043
Change-Id: I395eeb0b0e5f6923ef0f513bc8b60a48ac96ffb1
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent 93982edb
Loading
Loading
Loading
Loading
+11 −4
Original line number Diff line number Diff line
@@ -5682,7 +5682,7 @@ int msm_comm_qbuf_cache_operations(struct msm_vidc_inst *inst,
		handle = msm_smem_get_handle(inst->mem_client, dma_buf);

		offset = b->m.planes[i].data_offset;
		size = b->m.planes[i].length;
		size = b->m.planes[i].length - offset;
		cache_ops = SMEM_CACHE_INVALIDATE;
		skip = false;

@@ -5751,7 +5751,7 @@ int msm_comm_dqbuf_cache_operations(struct msm_vidc_inst *inst,
		handle = msm_smem_get_handle(inst->mem_client, dma_buf);

		offset = b->m.planes[i].data_offset;
		size = b->m.planes[i].length;
		size = b->m.planes[i].length - offset;
		cache_ops = SMEM_CACHE_INVALIDATE;
		skip = false;

@@ -5770,8 +5770,15 @@ int msm_comm_dqbuf_cache_operations(struct msm_vidc_inst *inst,
				skip = true;
			} else if (b->type ==
					V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
				if (!i) /* bitstream */
					skip = true;
				if (!i) { /* bitstream */
					/*
					 * Include vp8e header bytes as well
					 * by making offset equal to zero
					 */
					offset = 0;
					size = b->m.planes[i].bytesused +
						b->m.planes[i].data_offset;
				}
			}
		}