msm: vidc: Fix IOMMU pagefault for long clips
Shared command/message queues are circular, so if they get
full driver has to write/read into them from the beginning.
The address used to write/read from beginning was not the
kernel virtual address causing IOMMU page fault.
CRs-fixed: 400747
Change-Id: Ie414f75370c31c8a4fb1bf7c879d1d0f4d5c7ea0
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
diff --git a/drivers/media/video/msm_vidc/vidc_hal.c b/drivers/media/video/msm_vidc/vidc_hal.c
index 0639dea..e610f8e 100644
--- a/drivers/media/video/msm_vidc/vidc_hal.c
+++ b/drivers/media/video/msm_vidc/vidc_hal.c
@@ -177,7 +177,7 @@
new_write_idx -= queue->qhdr_q_size;
memcpy(write_ptr, packet, (packet_size_in_words -
new_write_idx) << 2);
- memcpy((void *)queue->qhdr_start_addr,
+ memcpy((void *)qinfo->q_array.align_virtual_addr,
packet + ((packet_size_in_words - new_write_idx) << 2),
new_write_idx << 2);
}
@@ -285,8 +285,9 @@
memcpy(packet, read_ptr,
(packet_size_in_words - new_read_idx) << 2);
memcpy(packet + ((packet_size_in_words -
- new_read_idx) << 2),
- (u8 *)queue->qhdr_start_addr, new_read_idx << 2);
+ new_read_idx) << 2),
+ (u8 *)qinfo->q_array.align_virtual_addr,
+ new_read_idx << 2);
}
queue->qhdr_read_idx = new_read_idx;