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

Commit e1177c2d authored by Govindaraj Rajagopal's avatar Govindaraj Rajagopal Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: enhance eos buffer handling



Eos buffer is queued to firmware and its ref is maintained
using eosbufs.list. Sometimes EOS request client sent even
before port_reconfig. In that case requeing same buffer
which is already with firmware at start_streaming. So during
handle_ebd of 2nd eos buffer, it can't find the entry at
eosbufs.list. So client closes the session.

Always check, if buffer is already queued, then do not queue
the same buffer again, during start_streaming after reconfig.

Change-Id: If934d8ce357226dee78db15ccb7b3c57103d2f12
Signed-off-by: default avatarGovindaraj Rajagopal <grajagop@codeaurora.org>
parent ca76af06
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -2402,6 +2402,7 @@ static bool is_eos_buffer(struct msm_vidc_inst *inst, u32 device_addr)
	list_for_each_entry_safe(temp, next, &inst->eosbufs.list, list) {
		if (temp->smem.device_addr == device_addr) {
			found = true;
			temp->is_queued = 0;
			list_del(&temp->list);
			msm_comm_smem_free(inst, &temp->smem);
			kfree(temp);
@@ -4000,6 +4001,9 @@ int msm_vidc_send_pending_eos_buffers(struct msm_vidc_inst *inst)

	mutex_lock(&inst->eosbufs.lock);
	list_for_each_entry_safe(binfo, temp, &inst->eosbufs.list, list) {
		if (binfo->is_queued)
			continue;

		data.alloc_len = binfo->smem.size;
		data.device_addr = binfo->smem.device_addr;
		data.input_tag = 0;
@@ -4016,6 +4020,7 @@ int msm_vidc_send_pending_eos_buffers(struct msm_vidc_inst *inst)

		rc = call_hfi_op(hdev, session_etb, inst->session,
				&data);
		binfo->is_queued = 1;
	}
	mutex_unlock(&inst->eosbufs.lock);

+1 −0
Original line number Diff line number Diff line
@@ -186,6 +186,7 @@ struct recon_buf {
struct eos_buf {
	struct list_head list;
	struct msm_smem smem;
	u32 is_queued;
};

struct internal_buf {