{\r
int total_running;\r
\r
- printk("rga_power_off\n");\r
+ \r
if(!rga_service.enable)\r
return;\r
\r
+ rga_service.enable = false;\r
+\r
+ printk("rga_power_off\n");\r
+\r
total_running = atomic_read(&rga_service.total_running);\r
if (total_running) {\r
pr_alert("power off when %d task running!!\n", total_running); \r
\r
clk_disable(aclk_rga);\r
clk_disable(hclk_rga);\r
-\r
- rga_service.enable = false;\r
+ \r
}\r
\r
static int rga_flush(rga_session *session, unsigned long arg)\r
{\r
/*RGA can support up to 8192*8192 resolution in RGB format,but we limit the image size to 8191*8191 here*/\r
//check src width and height\r
- if (unlikely((req->src.act_w <= 0) || (req->src.act_w > 8191) || (req->src.act_h <= 0) || (req->src.act_h > 8191))) \r
+\r
+ if(!((req->render_mode == color_fill_mode) || (req->render_mode == line_point_drawing_mode)))\r
{\r
- ERR("invalid source resolution act_w = %d, act_h = %d\n", req->src.act_w, req->src.act_h);\r
- return -EINVAL;\r
- }\r
+ if (unlikely((req->src.act_w <= 0) || (req->src.act_w > 8191) || (req->src.act_h <= 0) || (req->src.act_h > 8191))) \r
+ {\r
+ ERR("invalid source resolution act_w = %d, act_h = %d\n", req->src.act_w, req->src.act_h);\r
+ return -EINVAL;\r
+ }\r
+ }\r
\r
//check dst width and height\r
if (unlikely((req->dst.act_w <= 0) || (req->dst.act_w > 2048) || (req->dst.act_h <= 0) || (req->dst.act_h > 2048))) \r
}\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
ret = -EFAULT;\r
break;\r
}\r
+ rga_power_on();\r
ret = rga_blit_sync(session, req);\r
break;\r
case RGA_BLIT_ASYNC:\r
ret = -EFAULT;\r
break;\r
}\r
+ rga_power_on();\r
ret = rga_blit_async(session, req); \r
break;\r
case RGA_FLUSH:\r
uint32_t enable;\r
\r
enable = rga_service.enable; \r
- rga_power_off(); \r
+ rga_power_off();\r
rga_service.enable = enable;\r
\r
return 0;\r
\r
static int rga_resume(struct platform_device *pdev)\r
{ \r
- rga_power_on(); \r
+ if(rga_service.enable)\r
+ {\r
+ rga_service.enable = false;\r
+ rga_power_on();\r
+ rga_try_set_reg(1);\r
+ }\r
+ \r
return 0;\r
}\r
\r
extern void rk_direct_fb_show(struct fb_info * fbi);\r
EXPORT_SYMBOL(rk_direct_fb_show);\r
\r
-unsigned int src_buf[1024*1024];\r
-unsigned int dst_buf[1024*1024];\r
+unsigned int src_buf[1920*1080];\r
+unsigned int dst_buf[1280*800];\r
\r
void rga_test_0(void)\r
{\r
src = src_buf;\r
dst = dst_buf;\r
\r
- memset(src_buf, 0x80, 1024*1024*4);\r
+ memset(src_buf, 0x80, 1920*1080*4);\r
\r
- dmac_flush_range(&src_buf[0], &src_buf[1024*1024]);\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
\r
#if 0\r
outer_flush_range(virt_to_phys(&dst_buf[0]),virt_to_phys(&dst_buf[800*480]));\r
#endif\r
\r
- req.src.act_w = 1024;\r
- req.src.act_h = 1024;\r
+ req.src.act_w = 1920;\r
+ req.src.act_h = 1080;\r
\r
- req.src.vir_w = 1024;\r
- req.src.vir_h = 1024;\r
- req.src.yrgb_addr = (uint32_t)virt_to_phys(src_buf);\r
+ req.src.vir_w = 1920;\r
+ req.src.vir_h = 1080;\r
+ req.src.yrgb_addr = (uint32_t)src_buf;\r
req.src.uv_addr = req.src.yrgb_addr + 1920;\r
//req.src.v_addr = (uint32_t)V4200_320_240_swap0;\r
- req.src.format = RK_FORMAT_RGBA_8888;\r
+ req.src.format = RK_FORMAT_YCbCr_420_SP;\r
\r
- req.dst.act_w = 1024;\r
- req.dst.act_h = 1024;\r
+ req.dst.act_w = 1280;\r
+ req.dst.act_h = 736;\r
\r
- req.dst.vir_w = 1024;\r
- req.dst.vir_h = 1024;\r
- req.dst.x_offset = 1023;\r
+ req.dst.vir_w = 1280;\r
+ req.dst.vir_h = 736;\r
+ req.dst.x_offset = 0;\r
req.dst.y_offset = 0;\r
- req.dst.yrgb_addr = (uint32_t)virt_to_phys(dst);\r
+ req.dst.yrgb_addr = (uint32_t)dst;\r
\r
//req.dst.format = RK_FORMAT_RGB_565;\r
\r
req.clip.xmin = 0;\r
- req.clip.xmax = 1023;\r
+ req.clip.xmax = 1279;\r
req.clip.ymin = 0;\r
- req.clip.ymax = 1023;\r
+ req.clip.ymax = 799;\r
\r
//req.render_mode = color_fill_mode;\r
//req.fg_color = 0x80ffffff;\r
req.rotate_mode = 1;\r
req.scale_mode = 0;\r
\r
- req.alpha_rop_flag = 1;\r
+ req.alpha_rop_flag = 0;\r
req.alpha_rop_mode = 0x1;\r
\r
- req.sina = 65536;\r
- req.cosa = 0;\r
+ req.sina = 0;\r
+ req.cosa = 65536;\r
\r
- req.mmu_info.mmu_flag = 0x0;\r
- req.mmu_info.mmu_en = 0;\r
+ req.mmu_info.mmu_flag = 0x21;\r
+ req.mmu_info.mmu_en = 1;\r
\r
rga_blit_sync(&session, &req);\r
\r