video/rockchip: fix rga driver compile when LPAE
authorZikim,Wei <wzq@rock-chips.com>
Wed, 22 Feb 2017 14:22:14 +0000 (22:22 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Thu, 25 May 2017 12:14:59 +0000 (20:14 +0800)
Change-Id: Ifc50e0ae52ece8c93ab8fab4ddabc01916ace526
Signed-off-by: Zikim,Wei <wzq@rock-chips.com>
(cherry picked from commit c1f2cf28941e5a31e00b21025fe48260bb235b9a)

drivers/video/rockchip/rga/rga_drv.c
drivers/video/rockchip/rga2/rga2_drv.c

index 410d3fc27d27e085484f12789515c7bf7d927124..171b09ad7f1b7095cac1543972688b071e91dbf2 100755 (executable)
@@ -1349,7 +1349,8 @@ static int __init rga_init(void)
     unsigned long *mmu_buf_virtual;\r
     uint32_t i;\r
     uint32_t *buf_p;\r
-\r
+    uint32_t *buf;
+
     /* malloc pre scale mid buf mmu table */\r
     mmu_buf = kzalloc(1024*8, GFP_KERNEL);\r
     mmu_buf_virtual = kzalloc(1024*2*sizeof(unsigned long), GFP_KERNEL);\r
@@ -1374,7 +1375,12 @@ static int __init rga_init(void)
 \r
     buf_p = kmalloc(1024*256, GFP_KERNEL);\r
     rga_mmu_buf.buf_virtual = buf_p;\r
-    rga_mmu_buf.buf = (uint32_t *)virt_to_phys((void *)((unsigned long)buf_p));\r
+#if (defined(CONFIG_ARM) && defined(CONFIG_ARM_LPAE))
+    buf = (uint32_t *)(uint32_t)virt_to_phys((void *)((unsigned long)buf_p));
+#else
+    buf = (uint32_t *)virt_to_phys((void *)((unsigned long)buf_p));
+#endif
+    rga_mmu_buf.buf = buf;
     rga_mmu_buf.front = 0;\r
     rga_mmu_buf.back = 64*1024;\r
     rga_mmu_buf.size = 64*1024;\r
index a42edc1f6061f932e8bd88a3ccd14d46708f728e..b754c32e64db607620f744196c1afc0f6d0c9f12 100644 (file)
@@ -1513,11 +1513,17 @@ static int __init rga2_init(void)
 {
        int ret;
        uint32_t *buf_p;
+       uint32_t *buf;
 
        /* malloc pre scale mid buf mmu table */
        buf_p = kmalloc(1024*256, GFP_KERNEL);
        rga2_mmu_buf.buf_virtual = buf_p;
-       rga2_mmu_buf.buf = (uint32_t *)virt_to_phys((void *)((unsigned long)buf_p));
+#if (defined(CONFIG_ARM) && defined(CONFIG_ARM_LPAE))
+       buf = (uint32_t *)(uint32_t)virt_to_phys((void *)((unsigned long)buf_p));
+#else
+       buf = (uint32_t *)virt_to_phys((void *)((unsigned long)buf_p));
+#endif
+       rga2_mmu_buf.buf = buf;
        rga2_mmu_buf.front = 0;
        rga2_mmu_buf.back = 64*1024;
        rga2_mmu_buf.size = 64*1024;