demux: clean demux output buffer [1/1]
authorPengfei Liu <pengfei.liu@amlogic.com>
Tue, 15 Jun 2021 09:07:46 +0000 (17:07 +0800)
committerChristian Hoffmann <chrmhoffmann@gmail.com>
Sun, 12 Feb 2023 08:13:11 +0000 (09:13 +0100)
PD#SWPL-52784

Problem:
 dmx have remaining data.

Solution:
 clean dmx output buffer

Verify:
 verified at vo svp.

Signed-off-by: Pengfei Liu <pengfei.liu@amlogic.com>
Change-Id: Ia392e83533a0ec8e3b6d9ed13a219a07a23eced3

drivers/amlogic/dvb/demux/sc2_demux/mem_desc.c

index 54c3b1458c37da7ed9dfc49b4f040cd838edd1b4..73acd9eb497e48fbff9e87b392f7714706a33fb6 100644 (file)
@@ -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;