Skip to content

Commit 2ed5e10

Browse files
Putin Leerkhuangtao
authored andcommitted
video/rockchip: rga2: Fixup some situation rga will flush null page.
Change-Id: Ie803779eced9524baedf2941d771c9c46edd5a77 Signed-off-by: Putin Lee <putin.li@rock-chips.com>
1 parent 327aa30 commit 2ed5e10

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

drivers/video/rockchip/rga2/rga2_mmu_info.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,9 @@ static int rga2_MapUserMemory(struct page **pages, uint32_t *pageTable,
323323
for (i = 0; i < pageCount; i++) {
324324
/* Get the physical address from page struct. */
325325
pageTable[i] = page_to_phys(pages[i]);
326+
/* ensure dst not flush null cache */
327+
if (writeFlag && i >= pageCount - 2)
328+
break;
326329
rga_dma_flush_page(pages[i]);
327330
}
328331
for (i = 0; i < result; i++)
@@ -372,6 +375,8 @@ static int rga2_MapUserMemory(struct page **pages, uint32_t *pageTable,
372375
<< PAGE_SHIFT)) & ~PAGE_MASK));
373376
pte_unmap_unlock(pte, ptl);
374377
pageTable[i] = (uint32_t)Address;
378+
if ( writeFlag && (i >= pageCount - 2))
379+
break;
375380
rga_dma_flush_page(pfn_to_page(pfn));
376381
}
377382
up_read(&current->mm->mmap_sem);
@@ -468,7 +473,8 @@ static int rga2_mmu_info_BitBlt_mode(struct rga2_reg *reg, struct rga2_req *req)
468473
req->dst.vir_w,
469474
req->dst.vir_h,
470475
&DstStart);
471-
DstPageCount = (DstPageCount + 3) & (~3);
476+
/* if vir_address not 4k align need more page */
477+
DstPageCount += 2;
472478
if (DstPageCount == 0)
473479
return -EINVAL;
474480
}

0 commit comments

Comments
 (0)