rk29 gpu :
author杜坤明 <dkm@rockchip.com>
Tue, 27 Mar 2012 05:07:19 +0000 (13:07 +0800)
committer杜坤明 <dkm@rockchip.com>
Tue, 27 Mar 2012 05:07:19 +0000 (13:07 +0800)
    1. modify the judgment conditions on wait_for_completion_interruptible_timeout return;
    2. modify code for build ko;
    3. add gcdTILESTATUS_SINGLE_BANK but no use it;
    4. update version to 2.2.4;
    5. modify pack-kernel.sh to remove uu of gpu;

arch/arm/mach-rk29/board-rk29-ddr3sdk.c
arch/arm/mach-rk29/board-rk29-k97.c
arch/arm/mach-rk29/clock.c
drivers/staging/rk29/vivante/Kconfig
drivers/staging/rk29/vivante/hal/inc/gc_hal_options.h
drivers/staging/rk29/vivante/hal/kernel/gc_hal_kernel.h
drivers/staging/rk29/vivante/hal/kernel/gc_hal_kernel_video_memory.c
drivers/staging/rk29/vivante/hal/os/linux/kernel/gc_hal_kernel_driver.c
drivers/staging/rk29/vivante/hal/os/linux/kernel/gc_hal_kernel_os.c
pack-kernel.sh

index 6f8d695a0314ce2b866d1ec60bf14008b6f61d20..4bae125b865771bd551838dd2e02ac0ad660fded 100755 (executable)
@@ -2586,7 +2586,7 @@ static struct platform_device rk29sdk_rfkill = {
 };
 
 
-#ifdef CONFIG_VIVANTE
+//#ifdef CONFIG_VIVANTE
 #define GPU_HIGH_CLOCK        552
 #define GPU_LOW_CLOCK         (periph_pll_default / 1000000) /* same as general pll clock rate below */
 static struct resource resources_gpu[] = {
@@ -2621,7 +2621,7 @@ static struct platform_device rk29_device_gpu = {
     .num_resources    = ARRAY_SIZE(resources_gpu),
     .resource         = resources_gpu,
 };
-#endif
+//#endif
 
 #ifdef CONFIG_KEYS_RK29
 extern struct rk29_keys_platform_data rk29_keys_pdata;
@@ -2807,9 +2807,9 @@ static struct platform_device *devices[] __initdata = {
 #ifdef CONFIG_RK29_VMAC
        &rk29_device_vmac,
 #endif
-#ifdef CONFIG_VIVANTE
+//#ifdef CONFIG_VIVANTE
        &rk29_device_gpu,
-#endif
+//#endif
 #ifdef CONFIG_VIDEO_RK29
        &rk29_device_camera,      /* ddl@rock-chips.com : camera support  */
        #if (CONFIG_SENSOR_IIC_ADDR_0 != 0x00)
index ab32e956dc62809929304d2991a25abc8262a8bc..62f5fefe0e7abcc975757dcf89386a26e70660b4 100755 (executable)
@@ -2554,7 +2554,7 @@ static struct platform_device rk29sdk_rfkill = {
 };
 
 
-#ifdef CONFIG_VIVANTE
+//#ifdef CONFIG_VIVANTE
 #define GPU_HIGH_CLOCK        552
 #define GPU_LOW_CLOCK         (periph_pll_default / 1000000) /* same as general pll clock rate below */
 static struct resource resources_gpu[] = {
@@ -2589,7 +2589,7 @@ static struct platform_device rk29_device_gpu = {
     .num_resources    = ARRAY_SIZE(resources_gpu),
     .resource         = resources_gpu,
 };
-#endif
+//#endif
 
 #ifdef CONFIG_KEYS_RK29
 extern struct rk29_keys_platform_data rk29_keys_pdata;
@@ -2775,9 +2775,9 @@ static struct platform_device *devices[] __initdata = {
 #ifdef CONFIG_RK29_VMAC
        &rk29_device_vmac,
 #endif
-#ifdef CONFIG_VIVANTE
+//#ifdef CONFIG_VIVANTE
        &rk29_device_gpu,
-#endif
+//#endif
 #ifdef CONFIG_VIDEO_RK29
        &rk29_device_camera,      /* ddl@rock-chips.com : camera support  */
        #if (CONFIG_SENSOR_IIC_ADDR_0 != 0x00)
index 57ec2b67ea61afdd871a77b171b077fb7372bff3..d88ad3ac6ca718aa0e825ec2dcafe127a0dc8bc6 100755 (executable)
@@ -1937,6 +1937,7 @@ void pmu_set_power_domain(enum pmu_power_domain pd, bool on)
        local_irq_restore(flags);
        mdelay(10);
 }
+EXPORT_SYMBOL(pmu_set_power_domain);
 
 static int pd_vcodec_mode(struct clk *clk, int on)
 {
index e8e7de59ef0a16a8b5b71244dcc2baccb722416d..9fb364ea4d026d55ed27a6b147977a575695a141 100644 (file)
@@ -3,7 +3,7 @@ menu "GPU Vivante"
 
 config VIVANTE
        tristate "ROCKCHIP Vivante GPU"
-       default y
+       default m
        help
           Vivante GPU module.
 endmenu
index 21f453f501f2f1bbcf731fdcb91f41759891262c..38654b7eac3f3f0ed74f81979f37493bb23ec9e1 100644 (file)
     
     GPU¹Ì¼þ°æ±¾(×î´ó19¸ö×Ö·û´®)
 */
-#define GPU_FW_VERSION                      "2.2.2"
+#define GPU_FW_VERSION                      "2.2.4"
 
 
 /*
 */
 #define gcdENABLE_MMU_PROTECTING                       1
 
+
+/*
+       dkm: gcdTILESTATUS_SINGLE_BANK
+
+       make TileStatus alloced in one single bank.
+       gcdTILESTATUS_SINGLE_BANK:
+          0 - no use,original code
+          1 - use
+*/
+#define gcdTILESTATUS_SINGLE_BANK                      0
+
+
 #endif /* __gc_hal_options_h_ */
 
index c961074e8d7021cce47db03e7fc0c24ea4a3ad37..945915c9cef0948217e27b1221fa0fd7f9cc40bf 100644 (file)
@@ -343,6 +343,10 @@ struct _gckVIDMEM
 
     /* The heap mutex. */
     gctPOINTER                  mutex;
+
+#if gcdTILESTATUS_SINGLE_BANK
+    gctINT                      tilestatusBank;
+#endif
 };
 
 /* gckMMU object. */
index 623ce372c4511d3fe1b76e2858172cee8ee34797..3e25e63bacb1d1f0e8a99df6580fd47930ce6964 100755 (executable)
@@ -492,6 +492,26 @@ gckVIDMEM_Construct(
         banks       ++;
     }
 
+// dkm : gcdTILESTATUS_SINGLE_BANK
+#if gcdTILESTATUS_SINGLE_BANK
+    /* Assign all the bank mappings. */
+    memory->mapping[gcvSURF_RENDER_TARGET]      = banks - 1;
+    memory->mapping[gcvSURF_BITMAP]             = banks - 1;
+    if (banks > 1) --banks;
+    memory->mapping[gcvSURF_TILE_STATUS]        = banks - 1;
+    memory->tilestatusBank = banks - 1;
+    if (banks > 1) --banks;
+    memory->mapping[gcvSURF_DEPTH]              = banks - 1;
+    memory->mapping[gcvSURF_HIERARCHICAL_DEPTH] = banks - 1;
+    if (banks > 1) --banks;
+    memory->mapping[gcvSURF_TEXTURE]            = banks - 1;
+    if (banks > 1) --banks;
+    memory->mapping[gcvSURF_VERTEX]             = banks - 1;
+    if (banks > 1) --banks;
+    memory->mapping[gcvSURF_INDEX]              = banks - 1;
+    if (banks > 1) --banks;
+    memory->mapping[gcvSURF_TYPE_UNKNOWN]       = 0;
+#else
     /* Assign all the bank mappings. */
     memory->mapping[gcvSURF_RENDER_TARGET]      = banks - 1;
     memory->mapping[gcvSURF_BITMAP]             = banks - 1;
@@ -508,6 +528,7 @@ gckVIDMEM_Construct(
     memory->mapping[gcvSURF_TILE_STATUS]        = banks - 1;
     if (banks > 1) --banks;
     memory->mapping[gcvSURF_TYPE_UNKNOWN]       = 0;
+#endif
 
     gcmkTRACE_ZONE(gcvLEVEL_INFO, gcvZONE_VIDMEM,
                   "[GALCORE] INDEX:         bank %d",
@@ -822,7 +843,7 @@ gckVIDMEM_AllocateLinear(
 
     acquired = gcvTRUE;
 
-#if 0
+#if gcdTILESTATUS_SINGLE_BANK
     // dkm: ¶ÔÓÚ»¨ÆÁËÀ»úµÄÎÊÌ⣬¸Ð¾õVVÕâô×öÖ»Êǹæ±Ü£¬»¹ÊÇûÓÐÕÒµ½ÎÊÌâµÄÔ­Òò
        if (Type == gcvSURF_TILE_STATUS
     && (Bytes + (1 << 20) > Memory->freeBytes))
@@ -859,11 +880,18 @@ gckVIDMEM_AllocateLinear(
     node = _FindNode(Memory, bank, Bytes, &alignment);
 
     /* Out of memory? */
+#if gcdTILESTATUS_SINGLE_BANK
+    if (node == gcvNULL && Type!=gcvSURF_TILE_STATUS)
+#else
     if (node == gcvNULL)
+#endif
     {
         /* Walk all lower banks. */
         for (i = bank - 1; i >= 0; --i)
         {
+#if gcdTILESTATUS_SINGLE_BANK
+            if(i==Memory->tilestatusBank)    continue;
+#endif
             /* Find a free node inside the current bank. */
             node = _FindNode(Memory, i, Bytes, &alignment);
             if (node != gcvNULL)
@@ -873,7 +901,11 @@ gckVIDMEM_AllocateLinear(
         }
     }
 
+#if gcdTILESTATUS_SINGLE_BANK
+    if (node == gcvNULL && Type!=gcvSURF_TILE_STATUS)
+#else
     if (node == gcvNULL)
+#endif
     {
         /* Walk all upper banks. */
         for (i = bank + 1; i < gcmCOUNTOF(Memory->sentinel); ++i)
@@ -884,6 +916,9 @@ gckVIDMEM_AllocateLinear(
                 break;
             }
 
+#if gcdTILESTATUS_SINGLE_BANK
+            if(i==Memory->tilestatusBank)    continue;
+#endif
             /* Find a free node inside the current bank. */
             node = _FindNode(Memory, i, Bytes, &alignment);
             if (node != gcvNULL)
index 823e5de8b1d3a006bda0ce34b737b4c5ab304f4a..b507c652ddd690701e70eb97b6e7e1f5a8424cb1 100755 (executable)
@@ -1271,91 +1271,6 @@ static struct platform_device * gpu_device;
 #endif
 #endif
 
-static int __init gpu_init(void)
-{
-       int ret = 0;
-
-#if 0   //add by dkm
-#ifndef CONFIG_DOVE_GPU
-       gpu_resources[0].start = gpu_resources[0].end = irqLine;
-
-       gpu_resources[1].start = registerMemBase;
-       gpu_resources[1].end   = registerMemBase + registerMemSize - 1;
-
-       gpu_resources[2].start = contiguousBase;
-       gpu_resources[2].end   = contiguousBase + contiguousSize - 1;
-
-       /* Allocate device */
-       gpu_device = platform_device_alloc(DEVICE_NAME, -1);
-       if (!gpu_device)
-       {
-               printk(KERN_ERR "galcore: platform_device_alloc failed.\n");
-               ret = -ENOMEM;
-               goto out;
-       }
-
-       /* Insert resource */
-       ret = platform_device_add_resources(gpu_device, gpu_resources, 3);
-       if (ret)
-       {
-               printk(KERN_ERR "galcore: platform_device_add_resources failed.\n");
-               goto put_dev;
-       }
-
-       /* Add device */
-       ret = platform_device_add(gpu_device);
-       if (ret)
-       {
-               printk(KERN_ERR "galcore: platform_device_add failed.\n");
-               goto del_dev;
-       }
-#endif
-#endif
-       ret = platform_driver_register(&gpu_driver);
-       if (!ret)
-       {
-// add by vv
-#if gcdkREPORT_VIDMEM_USAGE
-        gckDeviceProc_Register();
-#endif
-        
-               goto out;
-       }
-
-#if 0   //add by dkm
-#ifndef CONFIG_DOVE_GPU
-del_dev:
-       platform_device_del(gpu_device);
-put_dev:
-       platform_device_put(gpu_device);
-#endif
-#endif
-
-out:
-       return ret;
-
-}
-
-static void __exit gpu_exit(void)
-{
-       platform_driver_unregister(&gpu_driver);
-#if 0   //add by dkm
-#ifndef CONFIG_DOVE_GPU
-       platform_device_unregister(gpu_device);
-#endif
-#endif
-
-// add by vv
-#if gcdkREPORT_VIDMEM_USAGE
-   gckDeviceProc_UnRegister();
-#endif
-   printk("UnLoad galcore.ko success.\n");
-}
-
-module_init(gpu_init);
-module_exit(gpu_exit);
-
-
 #ifdef CONFIG_PROC_FS
 #include <linux/proc_fs.h>
 #include <linux/seq_file.h>
@@ -1491,15 +1406,98 @@ static const struct file_operations proc_gpu_fops = {
        .llseek         = seq_lseek,
        .release        = single_release,
 };
+#endif /* CONFIG_PROC_FS */
+
+static int __init gpu_init(void)
+{
+       int ret = 0;
+
+#ifdef CONFIG_PROC_FS
+    proc_create("gpu", 0, NULL, &proc_gpu_fops);
+#endif
+
+#if 0   //add by dkm
+#ifndef CONFIG_DOVE_GPU
+       gpu_resources[0].start = gpu_resources[0].end = irqLine;
+
+       gpu_resources[1].start = registerMemBase;
+       gpu_resources[1].end   = registerMemBase + registerMemSize - 1;
+
+       gpu_resources[2].start = contiguousBase;
+       gpu_resources[2].end   = contiguousBase + contiguousSize - 1;
+
+       /* Allocate device */
+       gpu_device = platform_device_alloc(DEVICE_NAME, -1);
+       if (!gpu_device)
+       {
+               printk(KERN_ERR "galcore: platform_device_alloc failed.\n");
+               ret = -ENOMEM;
+               goto out;
+       }
+
+       /* Insert resource */
+       ret = platform_device_add_resources(gpu_device, gpu_resources, 3);
+       if (ret)
+       {
+               printk(KERN_ERR "galcore: platform_device_add_resources failed.\n");
+               goto put_dev;
+       }
 
-static int __init gpu_proc_init(void)
+       /* Add device */
+       ret = platform_device_add(gpu_device);
+       if (ret)
+       {
+               printk(KERN_ERR "galcore: platform_device_add failed.\n");
+               goto del_dev;
+       }
+#endif
+#endif
+       ret = platform_driver_register(&gpu_driver);
+       if (!ret)
+       {
+// add by vv
+#if gcdkREPORT_VIDMEM_USAGE
+        gckDeviceProc_Register();
+#endif
+        
+               goto out;
+       }
+
+#if 0   //add by dkm
+#ifndef CONFIG_DOVE_GPU
+del_dev:
+       platform_device_del(gpu_device);
+put_dev:
+       platform_device_put(gpu_device);
+#endif
+#endif
+
+out:
+       return ret;
+
+}
+
+static void __exit gpu_exit(void)
 {
-       proc_create("gpu", 0, NULL, &proc_gpu_fops);
-       return 0;
+       platform_driver_unregister(&gpu_driver);
+#if 0   //add by dkm
+#ifndef CONFIG_DOVE_GPU
+       platform_device_unregister(gpu_device);
+#endif
+#endif
 
+// add by vv
+#if gcdkREPORT_VIDMEM_USAGE
+   gckDeviceProc_UnRegister();
+#endif
+   printk("UnLoad galcore.ko success.\n");
 }
-late_initcall(gpu_proc_init);
-#endif /* CONFIG_PROC_FS */
+
+module_init(gpu_init);
+module_exit(gpu_exit);
+
+
+
 
 #endif
 
index 1e1b0d4ae36588d079da3f57a96c3d64cbc90827..7465b622df6a662bdc2aadafdc7af6d3226b019e 100755 (executable)
@@ -4559,7 +4559,7 @@ gckOS_WaitSignal(
     rc = wait_for_completion_interruptible_timeout(&signal->event, timeout);
 
 #if 1   // dkm : avoid return OK when timeout in kernel3.0
-    status = (rc == 0) ? gcvSTATUS_TIMEOUT : gcvSTATUS_OK;
+    status = (rc <= 0) ? gcvSTATUS_TIMEOUT : gcvSTATUS_OK;
 #else
     status = ((rc == 0) && !signal->event.done) ? gcvSTATUS_TIMEOUT
                                                 : gcvSTATUS_OK;
index e34829076ddbdb5aec8377c7f96c18d0291ea147..af6d3469481d868d814f020d1d7f47462dc9cad6 100755 (executable)
@@ -11,10 +11,6 @@ arch/arm/mach-rk29/verifyID.c
 drivers/staging/rk29/ipp/rk29-ipp.c
 )
 
-DIRS=(
-drivers/staging/rk29/vivante/
-)
-
 EXCLUDES=(
 arch/arm/mach-rk2818/*.c
 arch/arm/mach-rk2818/*.h
@@ -27,8 +23,7 @@ include/*rk28*
 
 arch/arm/mach-rk29/ddr_reconfig.c
 
-drivers/staging/rk29/vivante/*.c
-drivers/staging/rk29/vivante/*.h
+drivers/staging/rk29/vivante
 
 arch/arm/mach-rk29/board-rk29sdk.c
 arch/arm/configs/rk29_sdk_defconfig