decode: fixed issue of vmap fail when playback 8k. [2/2]
authorNanxin Qin <nanxin.qin@amlogic.com>
Thu, 6 Feb 2020 10:41:55 +0000 (18:41 +0800)
committerHui Zhang <hui.zhang@amlogic.com>
Fri, 28 Aug 2020 06:03:59 +0000 (23:03 -0700)
PD#SWPL-30672

Problem:
the vmap fail cause crash that reason is not enough addr map.

Solution:
split a big block mem to many piece area then mapping.

Verify:
u212

Change-Id: I2ba11789f66c3bfd1bf636243b5e7a0a2df2e1da
Signed-off-by: Nanxin Qin <nanxin.qin@amlogic.com>
drivers/frame_provider/decoder/h265/vh265.c

index ac497bd3252e05a10dc371b48c20fe7172be9c34..0d5ea48b2cd38d91a60a1fb35929478cbf33daa7 100644 (file)
@@ -3319,20 +3319,8 @@ static int alloc_buf(struct hevc_state_s *hevc)
                                                codec_mm_dma_flush(mem_start_virt,
                                                hevc->m_BUF[i].size, DMA_TO_DEVICE);
                                        } else {
-                                               mem_start_virt = codec_mm_vmap(
-                                               hevc->m_BUF[i].start_adr,
-                                               hevc->m_BUF[i].size);
-                                               if (mem_start_virt) {
-                                                       memset(mem_start_virt, 0, hevc->m_BUF[i].size);
-                                                       codec_mm_dma_flush(mem_start_virt,
-                                                       hevc->m_BUF[i].size,
-                                                       DMA_TO_DEVICE);
-                                                       codec_mm_unmap_phyaddr(mem_start_virt);
-                                               } else {
-                                                       /*not virt for tvp playing,
-                                                       may need clear on ucode.*/
-                                                       pr_err("ref %s  mem_start_virt failed\n", __func__);
-                                               }
+                                               codec_mm_memset(hevc->m_BUF[i].start_adr,
+                                                       0, hevc->m_BUF[i].size);
                                        }
                                }
                        }