From 1a195fe3684e40d27f024eea560b8a13e3c4ad7b Mon Sep 17 00:00:00 2001 From: Pengfei Liu Date: Tue, 15 Jun 2021 17:07:46 +0800 Subject: [PATCH] demux: clean demux output buffer [1/1] PD#SWPL-52784 Problem: dmx have remaining data. Solution: clean dmx output buffer Verify: verified at vo svp. Signed-off-by: Pengfei Liu Change-Id: Ia392e83533a0ec8e3b6d9ed13a219a07a23eced3 --- drivers/amlogic/dvb/demux/sc2_demux/mem_desc.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/amlogic/dvb/demux/sc2_demux/mem_desc.c b/drivers/amlogic/dvb/demux/sc2_demux/mem_desc.c index 54c3b1458c37..73acd9eb497e 100644 --- a/drivers/amlogic/dvb/demux/sc2_demux/mem_desc.c +++ b/drivers/amlogic/dvb/demux/sc2_demux/mem_desc.c @@ -379,6 +379,9 @@ int _alloc_buff(unsigned int len, int sec_level, iret = cache_malloc(len, &buf_start_virt, &buf_start); if (iret == 0) { + pr_dbg("init cache phy:0x%lx, virt:0x%lx, len:%d\n", + buf_start, buf_start_virt, len); + memset((char *)buf_start_virt, 0, len); if (sec_level) { #ifdef CONFIG_AMLOGIC_TEE ret = tee_protect_mem_by_type(TEE_MEM_TYPE_DEMUX, @@ -405,6 +408,10 @@ int _alloc_buff(unsigned int len, int sec_level, dprint("%s fail\n", __func__); return -1; } + buf_start_virt = (unsigned long)codec_mm_phys_to_virt(buf_start); + pr_dbg("init phy:0x%lx, virt:0x%lx, len:%d\n", + buf_start, buf_start_virt, len); + memset((char *)buf_start_virt, 0, len); if (sec_level) { #ifdef CONFIG_AMLOGIC_TEE //ret = tee_protect_tvp_mem(buf_start, len, handle); @@ -414,7 +421,6 @@ int _alloc_buff(unsigned int len, int sec_level, pr_dbg("%s, protect 0x%lx, len:%d, ret:0x%x\n", __func__, buf_start, len, ret); } - buf_start_virt = (unsigned long)codec_mm_phys_to_virt(buf_start); *vir_mem = buf_start_virt; *phy_mem = buf_start; -- 2.20.1