rk29: vivante: fix computation of resource size for 1G memory
author黄涛 <huangtao@rock-chips.com>
Mon, 27 Jun 2011 05:14:38 +0000 (13:14 +0800)
committer黄涛 <huangtao@rock-chips.com>
Mon, 27 Jun 2011 05:59:23 +0000 (13:59 +0800)
drivers/staging/rk29/vivante/hal/os/linux/kernel/gc_hal_kernel_driver.c

index 6a45a9daa1e70a8a1f8510f2feb8f76ac610bdc0..23e98d4ac2979360cdc06985bee1ce6c648aa4f9 100755 (executable)
@@ -1057,8 +1057,7 @@ static int __devinit gpu_probe(struct platform_device *pdev)
                goto gpu_probe_fail;
        }
        registerMemBase = res->start;
-    // dkm: ²»ÄÜ+1
-       registerMemSize = res->end - res->start;
+       registerMemSize = res->end - res->start + ((res->end & 1) ? 1 : 0);
 
        res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "gpu_mem");
        if (!res) {
@@ -1066,8 +1065,7 @@ static int __devinit gpu_probe(struct platform_device *pdev)
                goto gpu_probe_fail;
        }
        contiguousBase  = res->start;
-    // dkm: ²»ÄÜ+1
-       contiguousSize  = res->end - res->start;
+       contiguousSize  = res->end - res->start + ((res->end & 1) ? 1 : 0);
 
        res = platform_get_resource_byname(pdev, IORESOURCE_IO, "gpu_clk");
        if (!res) {