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

Commit 46ec83c9 authored by Maheshwar Ajja's avatar Maheshwar Ajja Committed by Gerrit - the friendly Code Review server
Browse files

msm: vidc: Add memory barrier after queue header update



Add memory barrier after updating queue header variables
to ensure main memory is updated so that video hardware
reads the updated header values.

CRs-Fixed: 2135048
Change-Id: I1a2778bee16c9093284c4d33980e6985c279f499
Signed-off-by: default avatarMaheshwar Ajja <majja@codeaurora.org>
parent 87ef03a5
Loading
Loading
Loading
Loading
+10 −0
Original line number Diff line number Diff line
@@ -504,6 +504,11 @@ static int __read_queue(struct vidc_iface_q_info *qinfo, u8 *packet,

	if (queue->qhdr_read_idx == queue->qhdr_write_idx) {
		queue->qhdr_rx_req = receive_request;
		/*
		 * mb() to ensure qhdr is updated in main memory
		 * so that venus reads the updated header values
		 */
		mb();
		*pb_tx_req_is_set = 0;
		dprintk(VIDC_DBG,
			"%s queue is empty, rx_req = %u, tx_req = %u, read_idx = %u\n",
@@ -551,6 +556,11 @@ static int __read_queue(struct vidc_iface_q_info *qinfo, u8 *packet,
		queue->qhdr_rx_req = 0;
	else
		queue->qhdr_rx_req = receive_request;
	/*
	 * mb() to ensure qhdr is updated in main memory
	 * so that venus reads the updated header values
	 */
	mb();

	*pb_tx_req_is_set = (queue->qhdr_tx_req == 1) ? 1 : 0;