fix cvi_fb.ko for arm core

Signed-off-by: carbon <carbon@milkv.io>
This commit is contained in:
carbon
2024-07-15 16:34:44 +08:00
parent 0f2d73ce35
commit b52e10e42d

View File

@ -699,8 +699,13 @@ int cvifb_probe(struct platform_device *pdev)
info->pseudo_palette = par->pseudo_palette;
#if (KERNEL_VERSION(5, 10, 0) <= LINUX_VERSION_CODE)
#if defined(__arm__) || defined(__aarch64__)
info->screen_base = devm_memremap(&pdev->dev,
info->fix.smem_start, info->fix.smem_len, MEMREMAP_WB);
#else
info->screen_base = devm_ioremap(&pdev->dev,
info->fix.smem_start, info->fix.smem_len);
#endif
#else
info->screen_base = devm_ioremap_nocache(&pdev->dev,
info->fix.smem_start, info->fix.smem_len);
@ -762,11 +767,7 @@ int cvifb_probe(struct platform_device *pdev)
// clear the framebuffer.
//memset_io(info->screen_base, 0x00, info->screen_size);
#if (LINUX_VERSION_CODE >= KERNEL_VERSION(5, 10, 0)) && defined(__riscv)
arch_sync_dma_for_device(info->fix.smem_start, info->fix.smem_len, DMA_TO_DEVICE);
#else
__dma_map_area(info->screen_base, info->fix.smem_len, DMA_TO_DEVICE);
#endif
smp_mb(); /*memory barrier*/