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: Vikash Garodia <vgarodia@codeaurora.org>
Signed-off-by: Sanjay Singh <sisanj@codeaurora.org>
This commit is contained in:
Maheshwar Ajja 2017-11-17 15:04:28 +05:30 committed by Sanjay Singh
parent 412b07f4da
commit 7fef9d4e2d

View file

@ -501,6 +501,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",
@ -548,6 +553,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 = (1 == queue->qhdr_tx_req) ? 1 : 0;