From: Nanxin Qin Date: Tue, 12 Mar 2019 12:35:54 +0000 (+0800) Subject: codec_mm: changes the prot of pages to PAGE_KERNEL. [2/2] X-Git-Tag: hardkernel-4.9.236-104~1621 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=38c72c8cf1a4666358490c75417e4996077dd792;p=platform%2Fkernel%2Flinux-amlogic.git codec_mm: changes the prot of pages to PAGE_KERNEL. [2/2] PD#SWPL-4597 Problem: Probabilistic full-screen display mosaic after seek 8K H265 Solution: alloc mem area with the cached which from the vmap. this way can improve the efficiency of I/O. Change-Id: Icf18b9cd57bdc54f832aa827a535399939b28611 Signed-off-by: Nanxin Qin --- diff --git a/drivers/amlogic/media/common/codec_mm/codec_mm.c b/drivers/amlogic/media/common/codec_mm/codec_mm.c index 4461f65..33466a8 100644 --- a/drivers/amlogic/media/common/codec_mm/codec_mm.c +++ b/drivers/amlogic/media/common/codec_mm/codec_mm.c @@ -329,14 +329,11 @@ u8 *codec_mm_vmap(ulong addr, u32 size) struct page **pages = NULL; u32 i, npages, offset = 0; ulong phys, page_start; - pgprot_t pgprot; + pgprot_t pgprot = PAGE_KERNEL; if (!PageHighMem(phys_to_page(addr))) return phys_to_virt(addr); - /*No cache*/ - pgprot = pgprot_noncached(PAGE_KERNEL); - offset = offset_in_page(addr); page_start = addr - offset; npages = DIV_ROUND_UP(size + offset, PAGE_SIZE); @@ -874,7 +871,8 @@ void codec_mm_dma_flush(void *vaddr, phy_addr = page_to_phys(vmalloc_to_page(vaddr)) + offset_in_page(vaddr); if (phy_addr && PageHighMem(phys_to_page(phy_addr))) - flush_cache_vmap(phy_addr, phy_addr + size); + dma_sync_single_for_device(mgt->dev, + phy_addr, size, dir); return; }