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

Commit dc0c2baa authored by Maheshwar Ajja's avatar Maheshwar Ajja
Browse files

msm: vidc: Correct conditional check



The buffer type is not bit mask value and hence
do not use bitwise operations for buffer type check.
bitwise check condition sometimes resulting in queuing
input buffer in msm_comm_qbuf_decode_batch() function
which is expected to queue output buffers only.

Change-Id: I73548f725a9f58e5466c9afae226e5f386f126ed
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent d2560a26
Loading
Loading
Loading
Loading
+7 −5
Original line number Original line Diff line number Diff line
@@ -4188,15 +4188,16 @@ int msm_comm_qbuf_decode_batch(struct msm_vidc_inst *inst,
	mutex_lock(&inst->registeredbufs.lock);
	mutex_lock(&inst->registeredbufs.lock);
	list_for_each_entry(buf, &inst->registeredbufs.list, list) {
	list_for_each_entry(buf, &inst->registeredbufs.list, list) {
		/* Don't queue if buffer is not CAPTURE_MPLANE */
		/* Don't queue if buffer is not CAPTURE_MPLANE */
		if (!(buf->vvb.vb2_buf.type &
		if (buf->vvb.vb2_buf.type !=
			V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE))
			V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE)
			continue;
			goto loop_end;
		/* Don't queue if buffer is not a deferred buffer */
		/* Don't queue if buffer is not a deferred buffer */
		if (!(buf->flags & MSM_VIDC_FLAG_DEFERRED))
		if (!(buf->flags & MSM_VIDC_FLAG_DEFERRED))
			continue;
			goto loop_end;
		/* Don't queue if RBR event is pending on this buffer */
		/* Don't queue if RBR event is pending on this buffer */
		if (buf->flags & MSM_VIDC_FLAG_RBR_PENDING)
		if (buf->flags & MSM_VIDC_FLAG_RBR_PENDING)
			continue;
			goto loop_end;

		print_vidc_buffer(VIDC_DBG, "batch-qbuf", inst, buf);
		print_vidc_buffer(VIDC_DBG, "batch-qbuf", inst, buf);
		rc = msm_comm_qbuf_to_hfi(inst, buf);
		rc = msm_comm_qbuf_to_hfi(inst, buf);
		if (rc) {
		if (rc) {
@@ -4204,6 +4205,7 @@ int msm_comm_qbuf_decode_batch(struct msm_vidc_inst *inst,
				__func__, rc);
				__func__, rc);
			break;
			break;
		}
		}
loop_end:
		/* Queue pending buffers till the current buffer only */
		/* Queue pending buffers till the current buffer only */
		if (buf == mbuf)
		if (buf == mbuf)
			break;
			break;