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

Commit aa2310c7 authored by Vasantha Balla's avatar Vasantha Balla Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Queue buffers till max batch size in decode batching

As per current decoder batching logic, output buffers are queued
only till it finds current buffer in registered buffer list.
If current buffer is registered long back and its reference
has not yet come from firmware, it will stop queuing other
deferred buffers in batching which causes firmware to starve for
output buffers. So change is added to queue buffers till max batch
size.

Change-Id: Ie688fa260aa0f900e7d199df00fb44d34f917345
parent 5f86b412
Loading
Loading
Loading
Loading
+6 −2
Original line number Diff line number Diff line
@@ -4826,6 +4826,7 @@ int msm_comm_qbufs_batch(struct msm_vidc_inst *inst,
	int rc = 0;
	struct msm_vidc_buffer *buf;
	int do_bw_calc = 0;
	int num_buffers_queued = 0;

	do_bw_calc = mbuf ? mbuf->vvb.vb2_buf.type == INPUT_MPLANE : 0;
	rc = msm_comm_scale_clocks_and_bus(inst, do_bw_calc);
@@ -4851,11 +4852,14 @@ int msm_comm_qbufs_batch(struct msm_vidc_inst *inst,
				__func__, rc);
			break;
		}
		num_buffers_queued++;
loop_end:
		/* Queue pending buffers till the current buffer only */
		if (buf == mbuf)
		/* Queue pending buffers till batch size */
		if (num_buffers_queued == inst->batch.size) {
			s_vpr_e(inst->sid, "%s: Queue buffers till batch size\n");
			break;
		}
	}
	mutex_unlock(&inst->registeredbufs.lock);

	return rc;