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

Commit 98557a27 authored by Maheshwar Ajja's avatar Maheshwar Ajja
Browse files

msm: vidc: Queue buffers based on client buffer type



Skip queuing output_mplane buffers if client queued
buffer type is capture_mplane and vice versa to avoid
video failures due to buffers being reordered before
sent to video firmware.

CRs-Fixed: 2119069
Change-Id: I091c2152fbada69c38030076050b1ed9951430dd
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent 099e9fc7
Loading
Loading
Loading
Loading
+13 −0
Original line number Diff line number Diff line
@@ -4187,6 +4187,19 @@ int msm_comm_qbuf(struct msm_vidc_inst *inst, struct msm_vidc_buffer *mbuf)
	output_count = (batch_mode ? &count_single_batch : &count_buffers)
		(inst, V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE);

	if (!batch_mode && mbuf) {
		/*
		 * don't queue output_mplane buffers if buffer queued
		 * by client is capture_mplane type and vice versa.
		 */
		if (mbuf->vvb.vb2_buf.type ==
				V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
			output_count = 0;
		else if (mbuf->vvb.vb2_buf.type ==
				V4L2_BUF_TYPE_VIDEO_OUTPUT_MPLANE)
			capture_count = 0;
	}

	/*
	 * Somewhat complicated logic to prevent queuing the buffer to hardware.
	 * Don't queue if: