speed up video proc when phys to phys
authorzsq <zsq@rock-chips.com>
Thu, 26 Apr 2012 08:56:49 +0000 (16:56 +0800)
committerzsq <zsq@rock-chips.com>
Thu, 26 Apr 2012 08:56:49 +0000 (16:56 +0800)
drivers/video/rockchip/rga/rga_drv.c

index 68d6dee5bb76609c5aa95264f6cb5840b553b42e..a04d7bfb4bade4027c791381b23b556504055b02 100755 (executable)
@@ -155,6 +155,8 @@ static void rga_dump(void)
        running = atomic_read(&rga_service.total_running);\r
        printk("rga total_running %d\n", running);\r
 \r
+    return;\r
+\r
     /* Dump waiting list info */\r
     if (!list_empty(&rga_service.waiting))\r
     {        \r
@@ -243,7 +245,7 @@ static void rga_power_off(void)
                pr_alert("power off when %d task running!!\n", total_running);               \r
                mdelay(50);\r
                pr_alert("delay 50 ms for running task\n");        \r
-        //rga_dump();\r
+        rga_dump();\r
        }\r
     \r
        clk_disable(aclk_rga);\r
@@ -394,6 +396,8 @@ static struct rga_reg * rga_reg_init(rga_session *session, struct rga_req *req)
        INIT_LIST_HEAD(&reg->status_link);\r
 \r
     memcpy(&reg->req, req, sizeof(struct rga_req));\r
+\r
+    reg->MMU_base = NULL;\r
             \r
     if (req->mmu_info.mmu_en)\r
     {\r
@@ -618,7 +622,7 @@ static void rga_try_set_reg(uint32_t num)
 }\r
 \r
 \r
-#if 1//RGA_TEST  \r
+#if RGA_TEST  \r
 static void print_info(struct rga_req *req)\r
 {      \r
     printk("src.yrgb_addr = %.8x, src.uv_addr = %.8x, src.v_addr = %.8x\n", \r
@@ -709,7 +713,7 @@ static void rga_del_running_list_timeout(void)
 }\r
 \r
 \r
-static rga_mem_addr_sel(struct rga_req *req)\r
+static void rga_mem_addr_sel(struct rga_req *req)\r
 {\r
     switch(req->src.format)\r
     {\r
@@ -718,10 +722,18 @@ static rga_mem_addr_sel(struct rga_req *req)
         case RK_FORMAT_YCbCr_422_P :\r
             break;\r
         case RK_FORMAT_YCbCr_420_SP :\r
+            if((req->src.yrgb_addr > 0xc0000000) && (req->src.uv_addr > 0xc0000000)\r
+                && (req->dst.yrgb_addr > 0xc0000000))\r
+            {\r
+                req->src.yrgb_addr = req->src.yrgb_addr - 0x60000000;\r
+                req->src.uv_addr = req->src.uv_addr - 0x60000000;\r
+                req->dst.yrgb_addr = req->dst.yrgb_addr - 0x60000000;\r
+                req->mmu_info.mmu_en = 0;\r
+                req->mmu_info.mmu_flag &= 0xfffe;\r
+            }\r
             break;\r
         case RK_FORMAT_YCbCr_420_P :\r
             break;\r
-\r
         case RK_FORMAT_YCrCb_422_SP :\r
             break;\r
         case RK_FORMAT_YCrCb_422_P :\r
@@ -800,6 +812,11 @@ static int rga_blit(rga_session *session, struct rga_req *req)
                 printk("req argument is inval\n");\r
                 break;\r
                }\r
+\r
+            if(req->render_mode == bitblt_mode)\r
+            {\r
+                rga_mem_addr_sel(req);                \r
+            }\r
            \r
             reg = rga_reg_init(session, req);\r
             if(reg == NULL) {\r
@@ -1009,10 +1026,7 @@ static int rga_release(struct inode *inode, struct file *file)
 \r
 static irqreturn_t rga_irq(int irq,  void *dev_id)\r
 {\r
-    //struct rga_reg *reg;\r
-    uint32_t flag;\r
-    uint32_t i = 0;\r
-    //int int_enable = 0;\r
+    unsigned long flag;\r
     \r
     #if RGA_TEST\r
     printk("rga_irq is valid\n");\r
@@ -1041,18 +1055,7 @@ static irqreturn_t rga_irq(int irq,  void *dev_id)
     {\r
         spin_unlock_irqrestore(&rga_service.lock, flag);\r
     }\r
-   \r
-    /* add cmd to cmd buf */\r
-    /*\r
-    while((!list_empty(next)) && ((int_enable) == 0) && (num <= 0xf))\r
-    {        \r
-        num += 1;\r
-        reg = list_entry(next->next, struct rga_reg, status_link);\r
-        int_enable = atomic_read(&reg->int_enable);        \r
-        next = next->next;\r
-    } \r
-    */\r
-                               \r
+                               \r
        return IRQ_HANDLED;\r
 }\r
 \r