From 41732b656dfb28ef180227c31c10e3709ca357b1 Mon Sep 17 00:00:00 2001 From: Nanxin Qin Date: Sat, 9 May 2020 12:12:32 +0800 Subject: [PATCH] subtitle: need to flush memory before read sub data. [1/1] PD#SWPL-25219 Problem: Caption data acquisition error. Solution: flush memory before read sub data. Verify: u212 Change-Id: I68963f36a3ff6ceaabe93cd9d9f151ec989805c3 Signed-off-by: Nanxin Qin --- drivers/stream_input/amports/amstream.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/drivers/stream_input/amports/amstream.c b/drivers/stream_input/amports/amstream.c index 95ea2ae..9f747e4 100644 --- a/drivers/stream_input/amports/amstream.c +++ b/drivers/stream_input/amports/amstream.c @@ -1306,7 +1306,11 @@ static ssize_t amstream_sub_read(struct file *file, char __user *buf, if (sub_wp == sub_rp || sub_rp == 0) return 0; - + /*flush sub buf before read*/ + codec_mm_dma_flush( + (void*)codec_mm_phys_to_virt(sub_start), + stbuf_size(s_buf), + DMA_FROM_DEVICE); if (sub_wp > sub_rp) data_size = sub_wp - sub_rp; else -- 2.20.1