add soft reset for rga alpha mode can't use current
authorzsq <zsq@rock-chips.com>
Wed, 8 Aug 2012 13:06:16 +0000 (21:06 +0800)
committerzsq <zsq@rock-chips.com>
Wed, 8 Aug 2012 13:06:16 +0000 (21:06 +0800)
drivers/video/rockchip/rga/rga_drv.c
drivers/video/rockchip/rga/rga_reg_info.c

index 65f17f4e412e1fe8f23b95a3826a560685dc9505..06fdf674639e2b1e2a84650092642d31bebc4657 100755 (executable)
@@ -136,7 +136,7 @@ static inline u32 rga_read(u32 r)
        return __raw_readl(drvdata->rga_base + r);\r
 }\r
 \r
-#if defined(CONFIG_ARCH_RK30) || defined(CONFIG_ARCH_RK31)\r
+#if 1//defined(CONFIG_ARCH_RK30) || defined(CONFIG_ARCH_RK31)\r
 static void rga_soft_reset(void)\r
 {\r
        u32 i;\r
@@ -590,6 +590,8 @@ static void rga_try_set_reg(void)
             #elif defined(CONFIG_ARCH_RK31)\r
             rga_soft_reset();\r
             #endif\r
+\r
+            rga_soft_reset();\r
             \r
             rga_write(0, RGA_MMU_CTRL);\r
 \r
@@ -652,6 +654,10 @@ static void print_info(struct rga_req *req)
 \r
     printk("clip.xmin = %d, clip.xmax = %d. clip.ymin = %d, clip.ymax = %d\n",\r
         req->clip.xmin, req->clip.xmax, req->clip.ymin, req->clip.ymax);\r
+\r
+    printk("alpha_rop_flag = %.8x\n", req->alpha_rop_flag);\r
+    printk("alpha_rop_mode = %.8x\n", req->alpha_rop_mode);\r
+    printk("PD_mode = %.8x\n", req->PD_mode);\r
 }\r
 #endif\r
 \r
@@ -778,7 +784,7 @@ static int rga_blit(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
     do\r
     {\r
         if((req->render_mode == bitblt_mode) && (((saw>>1) >= daw) || ((sah>>1) >= dah)))\r
@@ -1055,7 +1061,7 @@ static irqreturn_t rga_irq_thread(int irq, void *dev_id)
                rga_del_running_list();\r
                rga_try_set_reg();\r
        }\r
-    printk("****** rga irq prc avil ******\n");\r
+    //printk("****** rga irq prc avil ******\n");\r
        mutex_unlock(&rga_service.lock);\r
 \r
        return IRQ_HANDLED;\r
@@ -1252,7 +1258,7 @@ static int __init rga_init(void)
                        return ret;\r
        }\r
 \r
-   // rga_test_0();\r
+    //rga_test_0();\r
 \r
        INFO("Module initialized.\n");\r
 \r
@@ -1291,8 +1297,8 @@ EXPORT_SYMBOL(rk_direct_fb_show);
 \r
 #endif\r
 \r
-unsigned int src_buf[1920*1080];\r
-unsigned int dst_buf[1920*1080];\r
+unsigned int src_buf[320*240];\r
+unsigned int dst_buf[1024*768];\r
 \r
 void rga_test_0(void)\r
 {\r
@@ -1319,7 +1325,7 @@ void rga_test_0(void)
     src = src_buf;\r
     dst = dst_buf;\r
 \r
-    memset(src_buf, 0xff, 1920*1080*4);\r
+    memset(src_buf, 0xff, 320*240*4);\r
 \r
     dmac_flush_range(&src_buf[0], &src_buf[1920*1080]);\r
     outer_flush_range(virt_to_phys(&src_buf[0]),virt_to_phys(&src_buf[1024*1024]));\r
@@ -1345,8 +1351,8 @@ void rga_test_0(void)
     req.dst.act_w = 320;\r
     req.dst.act_h = 240;\r
 \r
-    req.dst.vir_w = 800;\r
-    req.dst.vir_h = 480;\r
+    req.dst.vir_w = 1024;\r
+    req.dst.vir_h = 768;\r
     req.dst.x_offset = 0;\r
     req.dst.y_offset = 0;\r
     req.dst.yrgb_addr = (uint32_t)virt_to_phys(dst);\r
@@ -1354,9 +1360,9 @@ void rga_test_0(void)
     //req.dst.format = RK_FORMAT_RGB_565;\r
 \r
     req.clip.xmin = 0;\r
-    req.clip.xmax = 799;\r
+    req.clip.xmax = 1023;\r
     req.clip.ymin = 0;\r
-    req.clip.ymax = 479;\r
+    req.clip.ymax = 767;\r
 \r
     //req.render_mode = color_fill_mode;\r
     //req.fg_color = 0x80ffffff;\r
index f45e710ae526c517f1fb10200aacf578951b5a7d..055827e557528ad1b0a2f63b45f29ed88badf426 100755 (executable)
@@ -1,6 +1,36 @@
 \r
 //#include <linux/kernel.h>\r
 #include <linux/memory.h>\r
+#include <linux/kernel.h>\r
+#include <linux/init.h>\r
+#include <linux/module.h>\r
+#include <linux/platform_device.h>\r
+#include <linux/sched.h>\r
+#include <linux/mutex.h>\r
+#include <linux/err.h>\r
+#include <linux/clk.h>\r
+#include <asm/delay.h>\r
+#include <linux/dma-mapping.h>\r
+#include <linux/delay.h>\r
+#include <asm/io.h>\r
+#include <linux/irq.h>\r
+#include <linux/interrupt.h>\r
+#include <mach/io.h>\r
+#include <mach/irqs.h>\r
+#include <linux/fs.h>\r
+#include <asm/uaccess.h>\r
+#include <linux/miscdevice.h>\r
+#include <linux/poll.h>\r
+#include <linux/delay.h>\r
+#include <linux/wait.h>\r
+#include <linux/syscalls.h>\r
+#include <linux/timer.h>\r
+#include <linux/time.h>\r
+#include <asm/cacheflush.h>\r
+#include <linux/slab.h>\r
+#include <linux/fb.h>\r
+#include <linux/wakelock.h>\r
+\r
 #include "rga_reg_info.h"\r
 #include "rga_rop.h"\r
 #include "rga.h"\r
@@ -704,7 +734,11 @@ s32 RGA_set_dst(u8 *base, const struct rga_req *msg)
     rop_mask_stride = (((msg->src.vir_w + 7)>>3) + 3) & (~3);//not dst_vir.w,hxx,2011.7.21\r
     \r
     reg = (stride >> 2) & 0xffff;\r
-    reg = reg | ((rop_mask_stride>>2) << 16);    \r
+    reg = reg | ((rop_mask_stride>>2) << 16);\r
+\r
+    #if defined(CONFIG_ARCH_RK2928)\r
+    reg = reg | ((msg->alpha_rop_mode & 3) << 28);\r
+    #endif\r
 \r
     if (msg->render_mode == line_point_drawing_mode)\r
     {\r
@@ -1057,6 +1091,8 @@ RGA_set_bitblt_reg_info(u8 *base, const struct rga_req * msg, TILE_INFO *tile)
     stride = (msg->dst.vir_w * pixel_width + 3) & (~3);\r
     *bRGA_DST_MST = (u32)msg->dst.yrgb_addr + (tile->dst_ctrl.y_off * stride) + (tile->dst_ctrl.x_off * pixel_width);\r
     *bRGA_DST_CTR_INFO = (tile->dst_ctrl.w) | ((tile->dst_ctrl.h) << 16);\r
+\r
+    *bRGA_DST_CTR_INFO |= (1<<29);\r
 }\r
 \r
 \r