diff options
author | Guan Xuetao <gxt@mprc.pku.edu.cn> | 2011-04-01 04:38:59 -0400 |
---|---|---|
committer | Guan Xuetao <gxt@mprc.pku.edu.cn> | 2011-04-02 04:17:38 -0400 |
commit | 6b794743b2c5e21825d35b5d5dd57d6fcc388198 (patch) | |
tree | 4568d347074a1b7e7917de1114be045d61515256 /drivers/video/fb-puv3.c | |
parent | 28e58cc9586ab3f4dbc79c55110955ad192e4c29 (diff) |
unicore32 framebuffer fix: get videomemory by __get_free_pages() and make it floatable
1. get videomemory by __get_free_pages() in fb-puv3.c
2. remove resource reservation for old fixed UNIGFX_MMAP & UVC_MMAP space
3. remove unused macros: PKUNTIY_UNIGFX_MMAP_BASE, PKUNITY_UNIGFX_MMAP_SIZE,
PKUNITY_UVC_MMAP_BASE, PKUNITY_UVC_MMAP_SIZE and KUSER_UNIGFX_BASE
4. remove unused header linux/vmalloc.h in fb-puv3.h
Signed-off-by: Guan Xuetao <gxt@mprc.pku.edu.cn>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'drivers/video/fb-puv3.c')
-rw-r--r-- | drivers/video/fb-puv3.c | 28 |
1 files changed, 17 insertions, 11 deletions
diff --git a/drivers/video/fb-puv3.c b/drivers/video/fb-puv3.c index dbd2dc4745d..27f2c57e06e 100644 --- a/drivers/video/fb-puv3.c +++ b/drivers/video/fb-puv3.c | |||
@@ -13,7 +13,6 @@ | |||
13 | #include <linux/module.h> | 13 | #include <linux/module.h> |
14 | #include <linux/kernel.h> | 14 | #include <linux/kernel.h> |
15 | #include <linux/errno.h> | 15 | #include <linux/errno.h> |
16 | #include <linux/vmalloc.h> | ||
17 | #include <linux/platform_device.h> | 16 | #include <linux/platform_device.h> |
18 | #include <linux/clk.h> | 17 | #include <linux/clk.h> |
19 | #include <linux/fb.h> | 18 | #include <linux/fb.h> |
@@ -531,7 +530,7 @@ static int unifb_set_par(struct fb_info *info) | |||
531 | return -EINVAL; | 530 | return -EINVAL; |
532 | } | 531 | } |
533 | 532 | ||
534 | writel(PKUNITY_UNIGFX_MMAP_BASE, UDE_FSA); | 533 | writel(info->fix.smem_start, UDE_FSA); |
535 | writel(info->var.yres, UDE_LS); | 534 | writel(info->var.yres, UDE_LS); |
536 | writel(get_line_length(info->var.xres, | 535 | writel(get_line_length(info->var.xres, |
537 | info->var.bits_per_pixel) >> 3, UDE_PS); | 536 | info->var.bits_per_pixel) >> 3, UDE_PS); |
@@ -680,13 +679,27 @@ static int unifb_probe(struct platform_device *dev) | |||
680 | struct fb_info *info; | 679 | struct fb_info *info; |
681 | u32 unifb_regs[UNIFB_REGS_NUM]; | 680 | u32 unifb_regs[UNIFB_REGS_NUM]; |
682 | int retval = -ENOMEM; | 681 | int retval = -ENOMEM; |
683 | struct resource *iomem, *mapmem; | 682 | struct resource *iomem; |
683 | void *videomemory; | ||
684 | |||
685 | videomemory = (void *)__get_free_pages(GFP_KERNEL | __GFP_COMP, | ||
686 | get_order(UNIFB_MEMSIZE)); | ||
687 | if (!videomemory) | ||
688 | goto err; | ||
689 | |||
690 | memset(videomemory, 0, UNIFB_MEMSIZE); | ||
691 | |||
692 | unifb_fix.smem_start = virt_to_phys(videomemory); | ||
693 | unifb_fix.smem_len = UNIFB_MEMSIZE; | ||
694 | |||
695 | iomem = platform_get_resource(dev, IORESOURCE_MEM, 0); | ||
696 | unifb_fix.mmio_start = iomem->start; | ||
684 | 697 | ||
685 | info = framebuffer_alloc(sizeof(u32)*256, &dev->dev); | 698 | info = framebuffer_alloc(sizeof(u32)*256, &dev->dev); |
686 | if (!info) | 699 | if (!info) |
687 | goto err; | 700 | goto err; |
688 | 701 | ||
689 | info->screen_base = (char __iomem *)KUSER_UNIGFX_BASE; | 702 | info->screen_base = (char __iomem *)videomemory; |
690 | info->fbops = &unifb_ops; | 703 | info->fbops = &unifb_ops; |
691 | 704 | ||
692 | retval = fb_find_mode(&info->var, info, NULL, | 705 | retval = fb_find_mode(&info->var, info, NULL, |
@@ -695,13 +708,6 @@ static int unifb_probe(struct platform_device *dev) | |||
695 | if (!retval || (retval == 4)) | 708 | if (!retval || (retval == 4)) |
696 | info->var = unifb_default; | 709 | info->var = unifb_default; |
697 | 710 | ||
698 | iomem = platform_get_resource(dev, IORESOURCE_MEM, 0); | ||
699 | unifb_fix.mmio_start = iomem->start; | ||
700 | |||
701 | mapmem = platform_get_resource(dev, IORESOURCE_MEM, 1); | ||
702 | unifb_fix.smem_start = mapmem->start; | ||
703 | unifb_fix.smem_len = UNIFB_MEMSIZE; | ||
704 | |||
705 | info->fix = unifb_fix; | 711 | info->fix = unifb_fix; |
706 | info->pseudo_palette = info->par; | 712 | info->pseudo_palette = info->par; |
707 | info->par = NULL; | 713 | info->par = NULL; |