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

Commit 848ab820 authored by Maheshwar Ajja's avatar Maheshwar Ajja
Browse files

msm: vidc: Compare vb2 planes instead of dmabuf planes



Video encoding usecases failed if client queues same buffer
again with different fd. Resolve the issue by comparing
vb2 planes (which compares fd) instead of dmabuf planes
to treat it as new buffer.

CRs-Fixed: 2119724
Change-Id: Ice4e714c7a23cd5f9f096297a1c36a80754eaa2c
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent d14a930f
Loading
Loading
Loading
Loading
+20 −4
Original line number Diff line number Diff line
@@ -6310,12 +6310,28 @@ struct msm_vidc_buffer *msm_comm_get_vidc_buffer(struct msm_vidc_inst *inst,
	}

	mutex_lock(&inst->registeredbufs.lock);
	if (inst->session_type == MSM_VIDC_DECODER) {
		list_for_each_entry(mbuf, &inst->registeredbufs.list, list) {
			if (msm_comm_compare_dma_planes(inst, mbuf,
					dma_planes)) {
				found = true;
				break;
			}
		}
	} else {
		/*
		 * for encoder, client may queue the same buffer with different
		 * fd before driver returned old buffer to the client. This
		 * buffer should be treated as new buffer. Search the list with
		 * fd so that it will be treated as new msm_vidc_buffer.
		 */
		list_for_each_entry(mbuf, &inst->registeredbufs.list, list) {
		if (msm_comm_compare_dma_planes(inst, mbuf, dma_planes)) {
			if (msm_comm_compare_vb2_planes(inst, mbuf, vb2)) {
				found = true;
				break;
			}
		}
	}

	if (!found) {
		/* this is new vb2_buffer */