#define INFO(format, args...)\r
#endif\r
\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, format = %d\n",\r
+ req->src.yrgb_addr, req->src.uv_addr, req->src.v_addr, req->src.format);\r
+ printk("src : act_w = %d, act_h = %d, vir_w = %d, vir_h = %d\n",\r
+ req->src.act_w, req->src.act_h, req->src.vir_w, req->src.vir_h);\r
+ printk("src : x_offset = %.8x y_offset = %.8x\n", req->src.x_offset, req->src.y_offset);\r
+\r
+ printk("dst : yrgb_addr = %.8x, dst.uv_addr = %.8x, dst.v_addr = %.8x\n",\r
+ req->dst.yrgb_addr, req->dst.uv_addr, req->dst.v_addr);\r
+ printk("dst : x_offset = %.8x y_offset = %.8x\n", req->dst.x_offset, req->dst.y_offset);\r
+ printk("dst : act_w = %d, act_h = %d, vir_w = %d, vir_h = %d\n",\r
+ req->dst.act_w, req->dst.act_h, req->dst.vir_w, req->dst.vir_h);\r
+\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
\r
static inline void rga_write(u32 b, u32 r)\r
{\r
reg->session = session;\r
INIT_LIST_HEAD(®->session_link);\r
INIT_LIST_HEAD(®->status_link);\r
-\r
- //memcpy(®->req, req, sizeof(struct rga_req));\r
-\r
+ \r
reg->MMU_base = NULL;\r
\r
if (req->mmu_info.mmu_en)\r
}\r
\r
\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
- req->src.yrgb_addr, req->src.uv_addr, req->src.v_addr);\r
- printk("src : act_w = %d, act_h = %d, vir_w = %d, vir_h = %d\n",\r
- req->src.act_w, req->src.act_h, req->src.vir_w, req->src.vir_h);\r
- printk("src : x_offset = %.8x y_offset = %.8x\n", req->src.x_offset, req->src.y_offset);\r
\r
- printk("dst.yrgb_addr = %.8x, dst.uv_addr = %.8x, dst.v_addr = %.8x\n",\r
- req->dst.yrgb_addr, req->dst.uv_addr, req->dst.v_addr);\r
- printk("dst : x_offset = %.8x y_offset = %.8x\n", req->dst.x_offset, req->dst.y_offset);\r
- printk("dst : act_w = %d, act_h = %d, vir_w = %d, vir_h = %d\n",\r
- req->dst.act_w, req->dst.act_h, req->dst.vir_w, req->dst.vir_h);\r
-\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
/* Caller must hold rga_service.lock */\r
static void rga_del_running_list(void)\r
while(!list_empty(&rga_service.running))\r
{\r
reg = list_entry(rga_service.running.next, struct rga_reg, status_link);\r
-\r
+ \r
if(reg->MMU_base != NULL)\r
{\r
kfree(reg->MMU_base);\r
{\r
struct rga_req *req;\r
int ret = 0;\r
- rga_session *session = (rga_session *)file->private_data;\r
+ rga_session *session;\r
+\r
+ mutex_lock(&rga_service.mutex);\r
+ \r
+ session = (rga_session *)file->private_data;\r
\r
if (NULL == session)\r
{\r
printk("%s [%d] rga thread session is null\n",__FUNCTION__,__LINE__);\r
+ mutex_unlock(&rga_service.mutex);\r
return -EINVAL;\r
}\r
-\r
+ \r
req = kzalloc(sizeof(struct rga_req), GFP_KERNEL);\r
if(req == NULL)\r
{\r
printk("%s [%d] get rga_req mem failed\n",__FUNCTION__,__LINE__);\r
+ mutex_unlock(&rga_service.mutex);\r
return -EINVAL;\r
}\r
-\r
- mutex_lock(&rga_service.mutex);\r
-\r
+ \r
switch (cmd)\r
{\r
case RGA_BLIT_SYNC:\r
break;\r
}\r
\r
- mutex_unlock(&rga_service.mutex);\r
-\r
- kfree(req);\r
+ kfree(req);\r
\r
+ mutex_unlock(&rga_service.mutex);\r
+ \r
return ret;\r
}\r
\r
req.mmu_info.mmu_en = 1;\r
\r
rga_blit_sync(&session, &req);\r
-\r
- dmac_inv_range(&dst_buf[0], &dst_buf[320*240]);\r
- outer_inv_range(virt_to_phys(&dst_buf[0]),virt_to_phys(&dst_buf[320*240]));\r
-\r
- for(j=0; j<17; j++)\r
- {\r
- for(i=0; i<8; i++)\r
- {\r
- printk("%.8x, ", dst_buf[j*16 + i]); \r
- }\r
- printk("\n");\r
-\r
- for(i=8; i<16; i++)\r
- {\r
- printk("%.8x, ", dst_buf[j*16 + i]); \r
- }\r
- printk("\n");\r
- }\r
-\r
- p = (uint8_t *)src_buf;\r
- p = p + 16 * 4;\r
-\r
- for(i=0; i<16; i++)\r
- src_buf[i] = 0;\r
-\r
- for(j=0; j<16; j++)\r
- {\r
- for(i=0; i<16; i++)\r
- {\r
- t = j*16 + i;\r
- src_buf[(j+1)*16 + i] = (t<<24)|(t<<16)|(t<<8)|t;\r
- }\r
- }\r
-\r
- dmac_flush_range(&src_buf[0], &src_buf[320*240]);\r
- outer_flush_range(virt_to_phys(&src_buf[0]),virt_to_phys(&src_buf[320*240]));\r
-\r
- dmac_inv_range(&src_buf[0], &src_buf[320*240]);\r
- outer_inv_range(virt_to_phys(&src_buf[0]),virt_to_phys(&src_buf[320*240]));\r
-\r
- printk("SRC DATA \n");\r
- for(j=0; j<17; j++)\r
- {\r
- for(i=0; i<8; i++)\r
- {\r
- printk("%.8x, ", src_buf[j*16 + i]); \r
- }\r
- printk("\n");\r
-\r
- for(i=8; i<16; i++)\r
- {\r
- printk("%.8x, ", src_buf[j*16 + i]); \r
- }\r
- printk("\n");\r
- } \r
-\r
- req.src.act_w = 320;\r
- req.src.act_h = 240;\r
-\r
- req.src.vir_w = 320;\r
- req.src.vir_h = 240;\r
- req.src.yrgb_addr = (uint32_t)src;\r
- req.src.uv_addr = (uint32_t)virt_to_phys(src);\r
- req.src.v_addr = (uint32_t)virt_to_phys(src);\r
- req.src.format = 0;\r
-\r
- req.dst.act_w = 320;\r
- req.dst.act_h = 240;\r
-\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)(dst);\r
-\r
- //req.dst.format = RK_FORMAT_RGB_565;\r
-\r
- req.clip.xmin = 0;\r
- req.clip.xmax = 1023;\r
- req.clip.ymin = 0;\r
- req.clip.ymax = 767;\r
-\r
- //req.render_mode = color_fill_mode;\r
- //req.fg_color = 0x80ffffff;\r
-\r
- //req.rotate_mode = 1;\r
- //req.scale_mode = 2;\r
-\r
- req.alpha_rop_flag = 0x19;\r
- req.alpha_rop_mode = 0x1;\r
- req.PD_mode = 3;\r
-\r
- req.sina = 0;\r
- req.cosa = 65536;\r
-\r
- req.mmu_info.mmu_flag = 0x21;\r
- req.mmu_info.mmu_en = 1;\r
\r
- rga_blit_sync(&session, &req);\r
-\r
- dmac_inv_range(&dst_buf[0], &dst_buf[320*240]);\r
- outer_inv_range(virt_to_phys(&dst_buf[0]),virt_to_phys(&dst_buf[320*240]));\r
-\r
- for(j=0; j<17; j++)\r
- {\r
- for(i=0; i<8; i++)\r
- {\r
- printk("%.8x, ", dst_buf[j*16 + i]); \r
- }\r
- printk("\n");\r
- for(i=8; i<16; i++)\r
- {\r
- printk("%.8x, ", dst_buf[j*16 + i]); \r
- }\r
- printk("\n");\r
- }\r
-\r
- memset(src_buf, 0x80, 320*240*4);\r
-\r
- dmac_flush_range(&src_buf[0], &src_buf[320*240]);\r
- outer_flush_range(virt_to_phys(&src_buf[0]),virt_to_phys(&src_buf[320*240]));\r
-\r
- \r
- #if 0\r
- memset(src_buf, 0x80, 800*480*4);\r
- memset(dst_buf, 0xcc, 800*480*4);\r
-\r
- dmac_flush_range(&dst_buf[0], &dst_buf[800*480]);\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 = 320;\r
- req.src.act_h = 240;\r
-\r
- req.src.vir_w = 320;\r
- req.src.vir_h = 240;\r
- req.src.yrgb_addr = (uint32_t)(src);\r
- req.src.uv_addr = (uint32_t)virt_to_phys(src);\r
- req.src.v_addr = (uint32_t)virt_to_phys(src);\r
- req.src.format = 0;\r
-\r
- req.dst.act_w = 320;\r
- req.dst.act_h = 240;\r
-\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)(dst);\r
-\r
- //req.dst.format = RK_FORMAT_RGB_565;\r
-\r
- req.clip.xmin = 0;\r
- req.clip.xmax = 1023;\r
- req.clip.ymin = 0;\r
- req.clip.ymax = 767;\r
-\r
- //req.render_mode = color_fill_mode;\r
- //req.fg_color = 0x80ffffff;\r
-\r
- //req.rotate_mode = 1;\r
- //req.scale_mode = 2;\r
-\r
- req.alpha_rop_flag = 0;\r
- req.alpha_rop_mode = 0x0;\r
-\r
- req.sina = 0;\r
- req.cosa = 65536;\r
-\r
- req.mmu_info.mmu_flag = 0x21;\r
- req.mmu_info.mmu_en = 1;\r
-\r
- rga_blit_sync(&session, &req);\r
-\r
- dmac_inv_range(&dst_buf[0], &dst_buf[320*240]);\r
- outer_inv_range(virt_to_phys(&dst_buf[0]),virt_to_phys(&dst_buf[320*240]));\r
-\r
- for(j=0; j<17; j++)\r
- {\r
- for(i=0; i<8; i++)\r
- {\r
- printk("%.8x, ", dst_buf[j*16 + i]); \r
- }\r
- printk("\n");\r
-\r
- for(i=8; i<16; i++)\r
- {\r
- printk("%.8x, ", dst_buf[j*16 + i]); \r
- }\r
- printk("\n");\r
- }\r
-\r
- p = (uint8_t *)src_buf;\r
- p = p + 16 * 4;\r
-\r
- for(i=0; i<16; i++)\r
- src_buf[i] = 0;\r
-\r
- for(j=0; j<16; j++)\r
- {\r
- for(i=0; i<16; i++)\r
- {\r
- t = j*16 + i;\r
- src_buf[(j+1)*16 + i] = (t<<24)|(t<<16)|(t<<8)|t;\r
- }\r
- }\r
-\r
- dmac_inv_range(&src_buf[0], &src_buf[320*240]);\r
- outer_inv_range(virt_to_phys(&src_buf[0]),virt_to_phys(&src_buf[320*240]));\r
- printk("SRC DATA \n");\r
- for(j=0; j<17; j++)\r
- {\r
- for(i=0; i<8; i++)\r
- {\r
- printk("%.8x, ", src_buf[j*16 + i]); \r
- }\r
- printk("\n");\r
-\r
- for(i=8; i<16; i++)\r
- {\r
- printk("%.8x, ", src_buf[j*16 + i]); \r
- }\r
- printk("\n");\r
- }\r
-\r
- dmac_flush_range(&src_buf[0], &src_buf[320*240]);\r
- outer_flush_range(virt_to_phys(&src_buf[0]),virt_to_phys(&src_buf[320*240]));\r
-\r
- req.src.act_w = 320;\r
- req.src.act_h = 240;\r
-\r
- req.src.vir_w = 320;\r
- req.src.vir_h = 240;\r
- req.src.yrgb_addr = (uint32_t)(src);\r
- req.src.uv_addr = (uint32_t)virt_to_phys(src);\r
- req.src.v_addr = (uint32_t)virt_to_phys(src);\r
- req.src.format = 0;\r
-\r
- req.dst.act_w = 320;\r
- req.dst.act_h = 240;\r
-\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)(dst);\r
-\r
- //req.dst.format = RK_FORMAT_RGB_565;\r
-\r
- req.clip.xmin = 0;\r
- req.clip.xmax = 1023;\r
- req.clip.ymin = 0;\r
- req.clip.ymax = 767;\r
-\r
- //req.render_mode = color_fill_mode;\r
- //req.fg_color = 0x80ffffff;\r
-\r
- //req.rotate_mode = 1;\r
- //req.scale_mode = 2;\r
-\r
- req.alpha_rop_flag = 0x19;\r
- req.alpha_rop_mode = 0x1;\r
- req.PD_mode = 3;\r
-\r
- req.sina = 0;\r
- req.cosa = 65536;\r
-\r
- req.mmu_info.mmu_flag = 0x21;\r
- req.mmu_info.mmu_en = 1;\r
- \r
- rga_blit_sync(&session, &req);\r
-\r
- dmac_inv_range(&dst_buf[0], &dst_buf[320*240]);\r
- outer_inv_range(virt_to_phys(&dst_buf[0]),virt_to_phys(&dst_buf[320*240]));\r
-\r
- for(j=0; j<17; j++)\r
- {\r
- for(i=0; i<8; i++)\r
- {\r
- printk("%.8x, ", dst_buf[j*16 + i]); \r
- }\r
- printk("\n");\r
- for(i=8; i<16; i++)\r
- {\r
- printk("%.8x, ", dst_buf[j*16 + i]); \r
- }\r
- printk("\n");\r
- }\r
-\r
#if 1\r
fb->var.bits_per_pixel = 32;\r
\r