\r
int rga_num = 0;\r
\r
+rga_session *session_global;\r
+\r
struct rga_drvdata {\r
struct miscdevice miscdev;\r
struct device dev;\r
return ret;\r
}\r
\r
+\r
+long rga_ioctl_kernel(struct rga_req *req)\r
+{\r
+ int ret = 0;\r
+ rga_session *session;\r
+\r
+ mutex_lock(&rga_service.mutex);\r
+ \r
+ session = (rga_session *)session_global;\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
+ switch (RGA_BLIT_SYNC)\r
+ {\r
+ case RGA_BLIT_SYNC:\r
+ ret = rga_blit_sync(session, req);\r
+ break;\r
+ case RGA_BLIT_ASYNC:\r
+ break;\r
+ case RGA_FLUSH:\r
+ break;\r
+ case RGA_GET_RESULT:\r
+ break;\r
+ case RGA_GET_VERSION:\r
+ //ret = 0;\r
+ break;\r
+ default:\r
+ ERR("unknown ioctl cmd!\n");\r
+ ret = -EINVAL;\r
+ break;\r
+ }\r
+\r
+ mutex_unlock(&rga_service.mutex);\r
+ \r
+ return ret;\r
+}\r
+\r
+\r
static int rga_open(struct inode *inode, struct file *file)\r
{\r
rga_session *session = kzalloc(sizeof(rga_session), GFP_KERNEL);\r
\r
file->private_data = (void *)session;\r
\r
+ session_global = session;\r
+\r
//DBG("*** rga dev opened by pid %d *** \n", session->pid);\r
return nonseekable_open(inode, file);\r
\r
\r
#endif\r
\r
-unsigned int src_buf[320*240];\r
-unsigned int dst_buf[1024*768];\r
+unsigned int src_buf[1280*720];\r
+unsigned int dst_buf[720*480];\r
\r
void rga_test_0(void)\r
{\r
src = src_buf;\r
dst = dst_buf;\r
\r
- memset(src_buf, 0x80, 320*240*4);\r
+ memset(src_buf, 0x80, 1280*480*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
+ dmac_flush_range(&src_buf[0], &src_buf[1280*480]);\r
+ outer_flush_range(virt_to_phys(&src_buf[0]),virt_to_phys(&src_buf[1280*480]));\r
\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 = 320;\r
- req.src.act_h = 240;\r
+ req.src.act_w = 1280;\r
+ req.src.act_h = 720;\r
\r
- req.src.vir_w = 320;\r
- req.src.vir_h = 240;\r
+ req.src.vir_w = 1280;\r
+ req.src.vir_h = 720;\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
+ req.dst.act_w = 720;\r
+ req.dst.act_h = 480;\r
\r
- req.dst.vir_w = 1024;\r
- req.dst.vir_h = 768;\r
+ req.dst.vir_w = 1280;\r
+ req.dst.vir_h = 720;\r
req.dst.x_offset = 0;\r
req.dst.y_offset = 0;\r
- req.dst.yrgb_addr = (uint32_t)dst;\r
+ req.dst.yrgb_addr = (uint32_t)virt_to_phys(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 = 767;\r
+ req.clip.ymax = 719;\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
+ req.rotate_mode = 1;\r
+ req.scale_mode = 2;\r
\r
//req.alpha_rop_flag = 1;\r
//req.alpha_rop_mode = 0x19;\r
#if 1\r
fb->var.bits_per_pixel = 32;\r
\r
- fb->var.xres = 1024;\r
- fb->var.yres = 768;\r
+ fb->var.xres = 1280;\r
+ fb->var.yres = 800;\r
\r
fb->var.red.length = 8;\r
fb->var.red.offset = 0;\r
#define V7_VATOPA_GET_NS(X) ((X>>9) & 1)\r
#define V7_VATOPA_GET_SS(X) ((X>>1) & 1)\r
\r
+#if 0\r
static unsigned int armv7_va_to_pa(unsigned int v_addr)\r
{\r
unsigned int p_addr;\r
else\r
return (V7_VATOPA_GET_SS(p_addr) ? 0xFFFFFFFF : V7_VATOPA_GET_PADDR(p_addr));\r
}\r
+#endif\r
\r
static int rga_mem_size_cal(uint32_t Mem, uint32_t MemSize, uint32_t *StartAddr) \r
{\r
uint32_t i;\r
uint32_t status;\r
uint32_t Address;\r
- uint32_t temp;\r
+ //uint32_t temp;\r
\r
status = 0;\r
Address = 0;\r
}\r
#endif\r
\r
- for (i = 0; i < pageCount; i++)\r
- {\r
- /* Flush the data cache. */\r
-#ifdef ANDROID\r
- dma_sync_single_for_device(\r
- NULL,\r
- page_to_phys(pages[i]),\r
- PAGE_SIZE,\r
- DMA_TO_DEVICE);\r
-#else\r
- flush_dcache_page(pages[i]);\r
-#endif\r
- }\r
-\r
/* Fill the page table. */\r
for(i=0; i<pageCount; i++) \r
{\r
return 0;\r
}\r
while(0);\r
-\r
- if (rgaIS_ERROR(status))\r
- {\r
- /* Release page array. */\r
- if (result > 0 && pages != NULL)\r
- {\r
- for (i = 0; i < result; i++)\r
- {\r
- if (pages[i] == NULL)\r
- {\r
- break;\r
- }\r
-#ifdef ANDROID\r
- dma_sync_single_for_device(\r
- NULL,\r
- page_to_phys(pages[i]),\r
- PAGE_SIZE,\r
- DMA_FROM_DEVICE);\r
-#endif\r
- page_cache_release(pages[i]);\r
- }\r
- }\r
- }\r
-\r
+ \r
return status;\r
}\r
\r