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

Commit 93337f77 authored by Praneeth Paladugu's avatar Praneeth Paladugu Committed by Ashray Kulkarni
Browse files

msm: vidc: Skip processing of release buffer event



When clients call Close command without Flush, FW tries to flush
the output buffers internally and return FBD's and release buffer
reference events. These events are not meaningful to clients which
already called close. Processing these events at this stage causes
unnecessary confusion and deadlocks. Hence drop them.

Change-Id: I9a8850d20321024d1db481e37247163c3ae31044
Signed-off-by: default avatarPraneeth Paladugu <ppaladug@codeaurora.org>
Signed-off-by: default avatarAshray Kulkarni <ashrayk@codeaurora.org>
parent b0f900ce
Loading
Loading
Loading
Loading
+15 −3
Original line number Diff line number Diff line
@@ -667,12 +667,24 @@ static void handle_event_change(enum command_response cmd, void *data)
				__func__, inst, &event_notify->packet_buffer,
				&event_notify->extra_data_buffer);

			if (inst->state == MSM_VIDC_CORE_INVALID ||
			/*
			* If buffer release event is received with inst->state
			* greater than STOP means client called STOP directly
			* without FLUSH. This also means that they don't expect
			* these buffers back. Processing these commands will not
			* add any value. This can also results deadlocks between
			* try_state and event_notify due to inst->sync_lock.
			*/

			mutex_lock(&inst->lock);
			if (inst->state >= MSM_VIDC_STOP ||
				inst->core->state == VIDC_CORE_INVALID) {
				dprintk(VIDC_DBG,
					"Event release buf ref received in invalid state - discard\n");
				dprintk(VIDC_ERR,
					"Release buffer reference called in invalid state\n");
				mutex_unlock(&inst->lock);
				return;
			}
			mutex_unlock(&inst->lock);

			/*
			* Get the buffer_info entry for the