fix rgb / yuv switch rga sync error bug
authorzsq <zsq@rock-chips.com>
Fri, 30 Mar 2012 10:04:23 +0000 (02:04 -0800)
committerzsq <zsq@rock-chips.com>
Fri, 30 Mar 2012 10:05:01 +0000 (02:05 -0800)
drivers/video/rockchip/rga/rga_drv.c
drivers/video/rockchip/rga/rga_mmu_info.c
drivers/video/rockchip/rga/rga_reg_info.c

index 1449156d92086817c05fb9342dc7c02898293a2f..0e413e477c216c09d917e396c981b64f6826c892 100755 (executable)
@@ -71,8 +71,6 @@
 ktime_t rga_start;\r
 ktime_t rga_end;\r
 \r
-dev_t rga_devi;\r
-\r
 struct rga_drvdata {\r
        struct miscdevice miscdev;\r
        struct device dev;\r
@@ -596,7 +594,6 @@ static void rga_try_set_reg(uint32_t num)
                                                               \r
                 /* All CMD finish int */\r
                 rga_write(0x1<<10, RGA_INT);\r
-\r
                 \r
                 #if RGA_TEST_TIME\r
                 rga_start = ktime_get();\r
@@ -712,7 +709,7 @@ static int rga_blit_sync(rga_session *session, struct rga_req *req)
     sah = req->src.act_h;\r
     daw = req->dst.act_w;\r
     dah = req->dst.act_h;\r
-\r
+   \r
     #if RGA_TEST\r
 \r
     printk("src.yrgb_addr = %.8x, src.uv_addr = %.8x, src.v_addr = %.8x\n", \r
@@ -761,8 +758,10 @@ static int rga_blit_sync(rga_session *session, struct rga_req *req)
         //rga_power_on();\r
         atomic_set(&reg->int_enable, 1);        \r
         rga_try_set_reg(num);\r
-\r
+        \r
         ret_timeout = wait_event_interruptible_timeout(session->wait, atomic_read(&session->done), RGA_TIMEOUT_DELAY);\r
+\r
+        rga_soft_reset();\r
         if (unlikely(ret_timeout< 0)) \r
         {\r
                pr_err("pid %d wait task ret %d\n", session->pid, ret_timeout);\r
@@ -922,6 +921,8 @@ static irqreturn_t rga_irq(int irq,  void *dev_id)
                printk(" INT ERROR RGA is not idle!\n");\r
                rga_soft_reset();\r
        }\r
+\r
+    rga_soft_reset();\r
     \r
     spin_lock(&rga_service.lock);\r
     do\r
index f172aebbb470107e1701f538d68efa10723a2055..d9f4af01fa8df7841512684ba9cc6573b39a9c70 100755 (executable)
@@ -18,6 +18,7 @@
 #include "rga_mmu_info.h"\r
 \r
 extern rga_service_info rga_service;\r
+extern int mmu_buff_temp[1024];\r
 \r
 #define KERNEL_SPACE_VALID    0xc0000000\r
 \r
@@ -416,7 +417,7 @@ static int rga_mmu_info_BitBlt_mode(struct rga_reg *reg, struct rga_req *req)
             break;                \r
         }\r
         \r
-        MMU_Base = (uint32_t *)kmalloc(AllSize * sizeof(uint32_t), GFP_KERNEL);\r
+        MMU_Base = (uint32_t *)kmalloc(AllSize * sizeof(uint32_t), GFP_KERNEL);      \r
         if(MMU_Base == NULL) {\r
             pr_err("RGA MMU malloc MMU_Base point failed\n");\r
             status = RGA_MALLOC_ERROR;\r
@@ -428,15 +429,13 @@ static int rga_mmu_info_BitBlt_mode(struct rga_reg *reg, struct rga_req *req)
         }\r
 \r
         if(req->src.yrgb_addr < KERNEL_SPACE_VALID)\r
-        {\r
-            \r
+        {            \r
             ret = rga_MapUserMemory(&pages[CMDMemSize], &MMU_Base[CMDMemSize], SrcStart, SrcMemSize);\r
             if (ret < 0) {\r
                 pr_err("rga map src memory failed\n");\r
                 status = ret;\r
                 break;\r
-            }\r
-            \r
+            }            \r
         }\r
         else\r
         {\r
index 65595ee1e4e796149aec01364296a8d1f4662455..fe50ef0b1da5f27602f7e6329b2ffa1a0dfba625 100755 (executable)
@@ -1421,8 +1421,8 @@ RGA_set_mmu_ctrl_reg_info(u8 *base, const struct rga_req *msg)
     reg = *RGA_MMU_CTRL_ADDR;    \r
     reg = ((reg & (~m_RGA_MMU_CTRL_PAGE_TABLE_SIZE)) | s_RGA_MMU_CTRL_PAGE_TABLE_SIZE(TLB_size));\r
     reg = ((reg & (~m_RGA_MMU_CTRL_MMU_ENABLE)) | s_RGA_MMU_CTRL_MMU_ENABLE(mmu_enable));\r
-    reg = ((reg & (~m_RGA_MMU_CTRL_SRC_FLUSH)) | s_RGA_MMU_CTRL_SRC_FLUSH(src_flag));\r
-    reg = ((reg & (~m_RGA_MMU_CTRL_DST_FLUSH)) | s_RGA_MMU_CTRL_DST_FLUSH(dst_flag));\r
+    reg = ((reg & (~m_RGA_MMU_CTRL_SRC_FLUSH)) | s_RGA_MMU_CTRL_SRC_FLUSH(1));\r
+    reg = ((reg & (~m_RGA_MMU_CTRL_DST_FLUSH)) | s_RGA_MMU_CTRL_DST_FLUSH(1));\r
     reg = ((reg & (~m_RGA_MMU_CTRL_CMD_CHAN_FLUSH)) | s_RGA_MMU_CTRL_CMD_CHAN_FLUSH(CMD_flag));\r
     *RGA_MMU_CTRL_ADDR = reg;\r
 \r