hc
2024-12-19 9370bb92b2d16684ee45cf24e879c93c509162da
kernel/drivers/video/fbdev/au1100fb.c
....@@ -340,17 +340,15 @@
340340 */
341341 int au1100fb_fb_mmap(struct fb_info *fbi, struct vm_area_struct *vma)
342342 {
343
- struct au1100fb_device *fbdev;
343
+ struct au1100fb_device *fbdev = to_au1100fb_device(fbi);
344344
345
- fbdev = to_au1100fb_device(fbi);
346
-
347
- vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
348345 pgprot_val(vma->vm_page_prot) |= (6 << 9); //CCA=6
349346
350
- return vm_iomap_memory(vma, fbdev->fb_phys, fbdev->fb_len);
347
+ return dma_mmap_coherent(fbdev->dev, vma, fbdev->fb_mem, fbdev->fb_phys,
348
+ fbdev->fb_len);
351349 }
352350
353
-static struct fb_ops au1100fb_ops =
351
+static const struct fb_ops au1100fb_ops =
354352 {
355353 .owner = THIS_MODULE,
356354 .fb_setcolreg = au1100fb_fb_setcolreg,
....@@ -412,7 +410,6 @@
412410 {
413411 struct au1100fb_device *fbdev;
414412 struct resource *regs_res;
415
- unsigned long page;
416413 struct clk *c;
417414
418415 /* Allocate new device private */
....@@ -424,6 +421,7 @@
424421 goto failed;
425422
426423 platform_set_drvdata(dev, (void *)fbdev);
424
+ fbdev->dev = &dev->dev;
427425
428426 /* Allocate region for our registers and map them */
429427 regs_res = platform_get_resource(dev, IORESOURCE_MEM, 0);
....@@ -471,20 +469,6 @@
471469
472470 au1100fb_fix.smem_start = fbdev->fb_phys;
473471 au1100fb_fix.smem_len = fbdev->fb_len;
474
-
475
- /*
476
- * Set page reserved so that mmap will work. This is necessary
477
- * since we'll be remapping normal memory.
478
- */
479
- for (page = (unsigned long)fbdev->fb_mem;
480
- page < PAGE_ALIGN((unsigned long)fbdev->fb_mem + fbdev->fb_len);
481
- page += PAGE_SIZE) {
482
-#ifdef CONFIG_DMA_NONCOHERENT
483
- SetPageReserved(virt_to_page(CAC_ADDR((void *)page)));
484
-#else
485
- SetPageReserved(virt_to_page(page));
486
-#endif
487
- }
488472
489473 print_dbg("Framebuffer memory map at %p", fbdev->fb_mem);
490474 print_dbg("phys=0x%08x, size=%dK", fbdev->fb_phys, fbdev->fb_len / 1024);