add Dma mem to mem
authorroot <root@huangds-desktop.(none)>
Wed, 26 Jan 2011 07:55:28 +0000 (15:55 +0800)
committerroot <root@huangds-desktop.(none)>
Wed, 26 Jan 2011 07:55:28 +0000 (15:55 +0800)
arch/arm/mach-rk29/Makefile
arch/arm/mach-rk29/board-rk29sdk.c
arch/arm/mach-rk29/devices.h
arch/arm/mach-rk29/dma.c [changed mode: 0644->0755]
arch/arm/mach-rk29/include/mach/dma.h [changed mode: 0644->0755]
arch/arm/mach-rk29/include/mach/rk29-dma-pl330.h [changed mode: 0644->0755]
arch/arm/mach-rk29/rk29-pl330.c [changed mode: 0644->0755]
drivers/video/rk29_fb.c [changed mode: 0644->0755]
include/linux/fb.h [changed mode: 0644->0755]

index 352e1c6fc1ccf9c35654f4df447bb14b29e34135..13c2290d081ff58b65cd90259569e61a0f7561a6 100755 (executable)
@@ -1,4 +1,4 @@
-obj-y += timer.o io.o devices.o iomux.o clock.o rk29-pl330.o dma.o gpio.o ddr.o sram.o
+obj-y += timer.o io.o devices.o iomux.o clock.o rk29-pl330.o dma.o gpio.o ddr.o sram.o Memcpy_Dma.o
 obj-$(CONFIG_PM) += pm.o
 obj-$(CONFIG_CPU_FREQ) += cpufreq.o
 obj-$(CONFIG_RK29_VPU) += vpu.o vpu_mem.o
index 5b5db3a5c5027f3d8cfb654a53d5d1ef3aa0a07c..9208746b8f9a5c5050fb04e4f7ada23be35645c0 100755 (executable)
@@ -228,6 +228,13 @@ struct platform_device rk29_device_fb = {
                .platform_data  = &rk29_fb_info,
        }
 };
+
+struct platform_device rk29_device_Dma_cpy = {
+       .name             = "dma_memcpy",
+       .id               = 4,
+
+};
+
 #endif
 
 static struct android_pmem_platform_data android_pmem_pdata = {
@@ -1436,6 +1443,7 @@ static struct platform_device *devices[] __initdata = {
 
 #ifdef CONFIG_FB_RK29
        &rk29_device_fb,
+       &rk29_device_Dma_cpy,
 #endif
 #ifdef CONFIG_BACKLIGHT_RK29_BL
        &rk29_device_backlight,
index b80198fa832573e0e4e7f11dba7d1886391491c5..b8637fb5c1f3977c34b7eb8f74381a94effdcb24 100755 (executable)
@@ -40,6 +40,7 @@ extern struct platform_device rk29xx_device_spi1m;
 extern struct rk29xx_spi_platform_data rk29xx_spi0_platdata;
 extern struct rk29xx_spi_platform_data rk29xx_spi1_platdata;
 extern struct platform_device rk29_device_fb;
+extern struct platform_device rk29_device_Dma_cpy;
 extern struct platform_device rk29_device_nand;
 extern struct platform_device rk29xx_device_nand;
 extern struct rk29_sdmmc_platform_data default_sdmmc0_data;
old mode 100644 (file)
new mode 100755 (executable)
index ac54740..35c0e77
@@ -30,7 +30,7 @@ static struct rk29_pl330_platdata rk29_dmac0_pdata = {
                [4] = DMACH_I2S_2CH_TX,
                [5] = DMACH_I2S_2CH_RX,
                [6] = DMACH_SPDIF,
-               [7] = DMACH_MAX,
+        [7] = DMACH_DMAC0_MemToMem,
                [8] = DMACH_MAX,
                [9] = DMACH_MAX,
                [10] = DMACH_MAX,
old mode 100644 (file)
new mode 100755 (executable)
index bf2ba7e..f55f040
@@ -18,7 +18,8 @@ enum rk29_dma_buffresult {
 
 enum rk29_dmasrc {
        RK29_DMASRC_HW,         /* source is memory */
-       RK29_DMASRC_MEM         /* source is hardware */
+       RK29_DMASRC_MEM,                /* source is hardware */
+       RK29_DMASRC_MEMTOMEM
 };
 
 /* enum rk29_chan_op
old mode 100644 (file)
new mode 100755 (executable)
index 8419558..8443d55
@@ -46,6 +46,7 @@ enum dma_ch {
        DMACH_SPI1_TX,
        DMACH_SPI1_RX,
        DMACH_PID_FILTER,
+    DMACH_DMAC0_MemToMem,
        /* END Marker, also used to denote a reserved channel */
        DMACH_MAX,
 };
old mode 100644 (file)
new mode 100755 (executable)
index 1c12f70..ec290dd
@@ -984,6 +984,12 @@ int rk29_dma_devconfig(enum dma_ch id, enum rk29_dmasrc source,
                ch->rqcfg.src_inc = 1;
                ch->rqcfg.dst_inc = 0;
                break;
+        case RK29_DMASRC_MEMTOMEM:
+                ch->req[0].rqtype = MEMTOMEM;
+               ch->req[1].rqtype = MEMTOMEM;
+               ch->rqcfg.src_inc = 1;
+               ch->rqcfg.dst_inc = 1;
+                break;
        default:
                ret = -EINVAL;
                goto devcfg_exit;
old mode 100644 (file)
new mode 100755 (executable)
index 507adf1..238043c
@@ -166,7 +166,7 @@ struct rk29fb_inf {
     LCDC_REG regbak;
 
        int in_suspend;
-
+    int fb0_color_deepth;
     /* variable used in mcu panel */
        int mcu_needflush;
        int mcu_isrcnt;
@@ -1140,6 +1140,7 @@ static int fb0_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
         return -EINVAL;
     }
 
+    if(inf->fb0_color_deepth)var->bits_per_pixel=inf->fb0_color_deepth;
     switch(var->bits_per_pixel)
     {
     case 16:    // rgb565
@@ -1184,6 +1185,7 @@ static int fb0_set_par(struct fb_info *info)
 
        CHK_SUSPEND(inf);
 
+    if(inf->fb0_color_deepth)var->bits_per_pixel=inf->fb0_color_deepth;
     if((inf->video_mode == 1)&&(screen->y_res < var->yres))ypos_virtual += (var->yres-screen->y_res);
 
     switch(var->bits_per_pixel)
@@ -1191,7 +1193,7 @@ static int fb0_set_par(struct fb_info *info)
     case 16:    // rgb565
         par->format = 1;
         fix->line_length = 2 * xres_virtual;
-        offset = (ypos_virtual*xres_virtual + xpos_virtual)*2;
+        offset = (ypos_virtual*xres_virtual + xpos_virtual)*(inf->fb0_color_deepth ? 4:2);
         break;
     case 32:    // rgb888
     default:
@@ -1251,13 +1253,14 @@ static int fb0_pan_display(struct fb_var_screeninfo *var, struct fb_info *info)
        //fbprintk(">>>>>> %s : %s \n", __FILE__, __FUNCTION__);
 
        CHK_SUSPEND(inf);
-
+    if(inf->fb0_color_deepth)var->bits_per_pixel=inf->fb0_color_deepth;
+    
     switch(var1->bits_per_pixel)
     {
     case 16:    // rgb565
         var->xoffset = (var->xoffset) & (~0x1);
-        offset = (var->yoffset*var1->xres_virtual + var->xoffset)*2;
-        break;
+        offset = (var->yoffset*var1->xres_virtual + var->xoffset)*(inf->fb0_color_deepth ? 4:2);
+        break; 
     case 32:    // rgb888
         offset = (var->yoffset*var1->xres_virtual + var->xoffset)*4;
         break;
@@ -1304,6 +1307,11 @@ static int fb0_ioctl(struct fb_info *info, unsigned int cmd, unsigned long arg)
             inf->mcu_usetimer = 0;
         }
         break;
+   case FBIOPUT_16OR32:
+        
+        inf->fb0_color_deepth = arg;
+        
+           break;
    default:
         break;
     }
@@ -2069,6 +2077,7 @@ static int __init rk29fb_probe (struct platform_device *pdev)
     inf->fb0->var.xres = screen->x_res;
     inf->fb0->var.yres = screen->y_res;
     inf->fb0->var.bits_per_pixel = 16;
+    inf->fb0_color_deepth = 0;
     inf->fb0->var.xres_virtual = screen->x_res;
     inf->fb0->var.yres_virtual = screen->y_res;
     inf->fb0->var.width = screen->width;
old mode 100644 (file)
new mode 100755 (executable)
index 862e7d4..4a8b2fc
@@ -18,6 +18,7 @@ struct dentry;
 #define FBIOGETCMAP            0x4604
 #define FBIOPUTCMAP            0x4605
 #define FBIOPAN_DISPLAY                0x4606
+#define FBIOPUT_16OR32      0x4607
 #ifdef __KERNEL__
 #define FBIO_CURSOR            _IOWR('F', 0x08, struct fb_cursor_user)
 #else