author | Yahui Han <yahui.han@amlogic.com> | 2020-04-23 06:11:26 (GMT) |
---|---|---|
committer | Shen Liu <shen.liu@amlogic.com> | 2020-05-13 09:30:55 (GMT) |
commit | 09ed775b969bbb70f9ee69a325d3cc25562cf691 (patch) | |
tree | bbe16d5afb338b2009026c23aa263eb1d27fa5ec | |
parent | b6ca496954e0aa0020fd6b72bab17aacafded0bd (diff) | |
download | media_modules-09ed775b969bbb70f9ee69a325d3cc25562cf691.zip media_modules-09ed775b969bbb70f9ee69a325d3cc25562cf691.tar.gz media_modules-09ed775b969bbb70f9ee69a325d3cc25562cf691.tar.bz2 |
demux: fix ARB flush momery issue. [1/1]
PD#SWPL-24235
Problem:
SWPL-24235/SWPL-23934.
Solution:
1. add stored_page for asyncfifo.
2. add addr condition judge for secure dvr.
3. enable section monitor
Verify:
u215
Change-Id: I8e3e36f37aadc38b521f1f3c53e3e69154a9db53
Signed-off-by: yahui.han <yahui.han@amlogic.com>
-rw-r--r-- | drivers/stream_input/parser/hw_demux/aml_dmx.c | 29 | ||||
-rw-r--r-- | drivers/stream_input/parser/hw_demux/aml_dvb.c | 1 | ||||
-rw-r--r-- | drivers/stream_input/parser/hw_demux/aml_dvb.h | 1 |
3 files changed, 19 insertions, 12 deletions
diff --git a/drivers/stream_input/parser/hw_demux/aml_dmx.c b/drivers/stream_input/parser/hw_demux/aml_dmx.c index 4deefb5..dc09426 100644 --- a/drivers/stream_input/parser/hw_demux/aml_dmx.c +++ b/drivers/stream_input/parser/hw_demux/aml_dmx.c @@ -114,6 +114,9 @@ MODULE_PARM_DESC(disable_dsc, "\n\t\t Disable discrambler"); static int disable_dsc; module_param(disable_dsc, int, 0644); +MODULE_PARM_DESC(enable_sec_monitor, "\n\t\t Enable sec monitor default is disable"); +static int enable_sec_monitor = 1; +module_param(enable_sec_monitor, int, 0644); /*For old version kernel */ #ifndef MESON_CPU_MAJOR_ID_GXL #define MESON_CPU_MAJOR_ID_GXL 0x21 @@ -1388,7 +1391,7 @@ static void dvr_process_channel(struct aml_asyncfifo *afifo, if (afifo->buf_read > afifo->buf_toggle) { cnt = total - afifo->buf_read; - if (!afifo->secure_enable) { + if (!(afifo->secure_enable && afifo->blk.addr)) { dma_sync_single_for_cpu(asyncfifo_get_dev(afifo), afifo->pages_map+afifo->buf_read*size, cnt*size, @@ -1422,7 +1425,7 @@ static void dvr_process_channel(struct aml_asyncfifo *afifo, if (afifo->buf_toggle > afifo->buf_read) { cnt = afifo->buf_toggle - afifo->buf_read; - if (!afifo->secure_enable) { + if (!(afifo->secure_enable && afifo->blk.addr)) { dma_sync_single_for_cpu(asyncfifo_get_dev(afifo), afifo->pages_map+afifo->buf_read*size, cnt*size, @@ -2234,19 +2237,21 @@ static int dmx_alloc_pes_buffer(struct aml_dmx *dmx) } /*Allocate ASYNC FIFO Buffer*/ -static unsigned long asyncfifo_alloc_buffer(int len) +static unsigned long asyncfifo_alloc_buffer(struct aml_asyncfifo *afifo, int len) { - unsigned long pages = __get_free_pages(GFP_KERNEL, get_order(len)); + if (!afifo->stored_pages) { + afifo->stored_pages = __get_free_pages(GFP_KERNEL, get_order(len)); + } - if (!pages) { + if (!afifo->stored_pages) { pr_error("cannot allocate async fifo buffer\n"); return 0; } - return pages; + return afifo->stored_pages; } static void asyncfifo_free_buffer(unsigned long buf, int len) { - free_pages(buf, get_order(len)); + //free_pages(buf, get_order(len)); } static int asyncfifo_set_buffer(struct aml_asyncfifo *afifo, @@ -2258,8 +2263,8 @@ static int asyncfifo_set_buffer(struct aml_asyncfifo *afifo, afifo->buf_toggle = 0; afifo->buf_read = 0; afifo->buf_len = len; - pr_error("++++async fifo %d buf size %d, flush size %d\n", - afifo->id, afifo->buf_len, afifo->flush_size); + pr_error("++++async fifo %d buf %lu buf size %d, flush size %d, secure_enable %d, blk.addr %u\n", + afifo->id, buf, afifo->buf_len, afifo->flush_size, afifo->secure_enable, afifo->blk.addr); if ((afifo->flush_size <= 0) || (afifo->flush_size > (afifo->buf_len>>1))) { @@ -3218,7 +3223,7 @@ static void dmx_clear_filter_buffer(struct aml_dmx *dmx, int fid) static void async_fifo_set_regs(struct aml_asyncfifo *afifo, int source_val) { - u32 start_addr = afifo->secure_enable ? afifo->blk.addr : + u32 start_addr = (afifo->secure_enable && afifo->blk.addr) ? afifo->blk.addr : virt_to_phys((void *)afifo->pages); u32 size = afifo->buf_len; u32 flush_size = afifo->flush_size; @@ -4435,7 +4440,7 @@ int aml_asyncfifo_hw_init(struct aml_asyncfifo *afifo) int ret; int len = asyncfifo_buf_len; - unsigned long buf = asyncfifo_alloc_buffer(len); + unsigned long buf = asyncfifo_alloc_buffer(afifo, len); if (!buf) return -1; @@ -4486,7 +4491,7 @@ int aml_asyncfifo_hw_reset(struct aml_asyncfifo *afifo) unsigned long buf = 0; int len = asyncfifo_buf_len; - buf = asyncfifo_alloc_buffer(len); + buf = asyncfifo_alloc_buffer(afifo, len); if (!buf) return -1; diff --git a/drivers/stream_input/parser/hw_demux/aml_dvb.c b/drivers/stream_input/parser/hw_demux/aml_dvb.c index 0aded37..afaabfa 100644 --- a/drivers/stream_input/parser/hw_demux/aml_dvb.c +++ b/drivers/stream_input/parser/hw_demux/aml_dvb.c @@ -692,6 +692,7 @@ static int aml_dvb_asyncfifo_init(struct aml_dvb *advb, asyncfifo->secure_enable = 0; asyncfifo->blk.addr = 0; asyncfifo->blk.len = 0; + asyncfifo->stored_pages = 0; return aml_asyncfifo_hw_init(asyncfifo); } diff --git a/drivers/stream_input/parser/hw_demux/aml_dvb.h b/drivers/stream_input/parser/hw_demux/aml_dvb.h index a858098..ee3831f 100644 --- a/drivers/stream_input/parser/hw_demux/aml_dvb.h +++ b/drivers/stream_input/parser/hw_demux/aml_dvb.h @@ -253,6 +253,7 @@ struct aml_asyncfifo { struct tasklet_struct asyncfifo_tasklet; struct aml_dvb *dvb; struct aml_dvr_block blk; + unsigned long stored_pages; }; enum{ |