From: Nanxin Qin Date: Thu, 6 Feb 2020 10:41:55 +0000 (+0800) Subject: decode: fixed issue of vmap fail when playback 8k. [2/2] X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=f76eb5e4eee46d08c8efceca73cfeb4160aaf28f;p=GitHub%2FLineageOS%2FG12%2Fandroid_hardware_amlogic_kernel-modules_media.git decode: fixed issue of vmap fail when playback 8k. [2/2] 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 --- diff --git a/drivers/frame_provider/decoder/h265/vh265.c b/drivers/frame_provider/decoder/h265/vh265.c index ac497bd..0d5ea48 100644 --- a/drivers/frame_provider/decoder/h265/vh265.c +++ b/drivers/frame_provider/decoder/h265/vh265.c @@ -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); } } }