#include "RGA_API.h"\r
\r
#define RGA_TEST_CASE 0\r
- \r
+\r
#define RGA_TEST 0\r
#define RGA_TEST_TIME 0\r
#define RGA_TEST_FLUSH_TIME 0\r
start = ktime_get();\r
#endif\r
\r
- ret_timeout = wait_event_interruptible_timeout(session->wait, atomic_read(&session->done), RGA_TIMEOUT_DELAY);\r
+ ret_timeout = wait_event_timeout(session->wait, atomic_read(&session->done), RGA_TIMEOUT_DELAY);\r
\r
if (unlikely(ret_timeout < 0)) {\r
pr_err("flush pid %d wait task ret %d\n", session->pid, ret);\r
mutex_lock(&rga_service.lock);\r
rga_del_running_list();\r
mutex_unlock(&rga_service.lock);\r
- ret = -ETIMEDOUT;\r
+ ret = ret_timeout;\r
} else if (0 == ret_timeout) {\r
pr_err("flush pid %d wait %d task done timeout\n", session->pid, atomic_read(&session->task_running));\r
printk("bus = %.8x\n", rga_read(RGA_INT));\r
reg->session = session;\r
INIT_LIST_HEAD(®->session_link);\r
INIT_LIST_HEAD(®->status_link);\r
- \r
+\r
reg->MMU_base = NULL;\r
\r
if (req->mmu_info.mmu_en)\r
rga_soft_reset();\r
#endif\r
\r
- rga_write(0x0, RGA_SYS_CTRL); \r
+ rga_write(0x0, RGA_SYS_CTRL);\r
rga_write(0, RGA_MMU_CTRL);\r
\r
/* CMD buff */\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
if(list_empty(®->session->waiting))\r
{\r
atomic_set(®->session->done, 1);\r
- wake_up_interruptible_sync(®->session->wait);\r
+ wake_up(®->session->wait);\r
}\r
\r
rga_reg_deinit(reg);\r
\r
printk("RGA soft reset for timeout process\n");\r
rga_soft_reset();\r
- \r
+\r
\r
#if 0\r
printk("RGA_INT is %.8x\n", rga_read(RGA_INT));\r
if(list_empty(®->session->waiting))\r
{\r
atomic_set(®->session->done, 1);\r
- wake_up_interruptible_sync(®->session->wait);\r
+ wake_up(®->session->wait);\r
}\r
\r
rga_reg_deinit(reg);\r
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
{\r
- /* generate 2 cmd for pre scale */ \r
+ /* generate 2 cmd for pre scale */\r
\r
ret = rga_check_param(req);\r
if(ret == -EINVAL) {\r
break;\r
}\r
num = 2;\r
- \r
+\r
}\r
else\r
{\r
atomic_add(num, &rga_service.total_running);\r
rga_try_set_reg();\r
mutex_unlock(&rga_service.lock);\r
- \r
+\r
return 0;\r
}\r
while(0);\r
#endif\r
\r
atomic_set(&session->done, 0);\r
- \r
+\r
ret = rga_blit(session, req);\r
if(ret < 0)\r
{\r
return ret;\r
}\r
\r
- ret_timeout = wait_event_interruptible_timeout(session->wait, atomic_read(&session->done), RGA_TIMEOUT_DELAY);\r
+ ret_timeout = wait_event_timeout(session->wait, atomic_read(&session->done), RGA_TIMEOUT_DELAY);\r
\r
if (unlikely(ret_timeout< 0))\r
{\r
mutex_lock(&rga_service.lock);\r
rga_del_running_list();\r
mutex_unlock(&rga_service.lock);\r
- ret = -ETIMEDOUT;\r
+ ret = ret_timeout;\r
}\r
else if (0 == ret_timeout)\r
{\r
rga_session *session;\r
\r
mutex_lock(&rga_service.mutex);\r
- \r
+\r
session = (rga_session *)file->private_data;\r
\r
if (NULL == session)\r
return -EINVAL;\r
}\r
\r
- memset(&req, 0x0, sizeof(req)); \r
- \r
+ memset(&req, 0x0, sizeof(req));\r
+\r
switch (cmd)\r
{\r
case RGA_BLIT_SYNC:\r
}\r
\r
mutex_unlock(&rga_service.mutex);\r
- \r
+\r
return ret;\r
}\r
\r
rga_session *session;\r
\r
mutex_lock(&rga_service.mutex);\r
- \r
+\r
session = &rga_session_global;\r
\r
if (NULL == session)\r
mutex_unlock(&rga_service.mutex);\r
return -EINVAL;\r
}\r
- \r
+\r
switch (RGA_BLIT_SYNC)\r
{\r
case RGA_BLIT_SYNC:\r
}\r
\r
mutex_unlock(&rga_service.mutex);\r
- \r
+\r
return ret;\r
}\r
\r
/*ͬ²½*/\r
}\r
\r
- wake_up_interruptible_sync(&session->wait);\r
+ wake_up(&session->wait);\r
mutex_lock(&rga_service.lock);\r
list_del(&session->list_session);\r
rga_service_session_clear(session);\r
pr_info("failed to reserve rga HW regs\n");\r
return -EBUSY;\r
}\r
- \r
+\r
data->rga_base = (void*)ioremap_nocache(RK30_RGA_PHYS, RK30_RGA_SIZE);\r
if (data->rga_base == NULL)\r
{\r
uint32_t i, j;\r
uint8_t *p;\r
uint8_t t;\r
- uint32_t *dst0, *dst1, *dst2; \r
+ uint32_t *dst0, *dst1, *dst2;\r
\r
struct fb_info *fb;\r
\r
//file->private_data = (void *)session;\r
\r
fb = rk_get_fb(0);\r
- \r
+\r
memset(&req, 0, sizeof(struct rga_req));\r
src = src_buf;\r
dst = dst_buf;\r
dmac_flush_range(&src_buf[0], &src_buf[800*600]);\r
outer_flush_range(virt_to_phys(&src_buf[0]),virt_to_phys(&src_buf[800*600]));\r
\r
- \r
+\r
#if 0\r
memset(src_buf, 0x80, 800*480*4);\r
memset(dst_buf, 0xcc, 800*480*4);\r
req.dst.x_offset = 0;\r
req.dst.y_offset = 0;\r
\r
- if((i&3) == 0) \r
- dst = dst0; \r
+ if((i&3) == 0)\r
+ dst = dst0;\r
else if ((i&3) == 1)\r
dst = dst1;\r
else\r
printk("dst = %.8x\n", req.dst.yrgb_addr);\r
\r
rga_blit_sync(&session, &req);\r
- \r
+\r
#if 1\r
fb->var.bits_per_pixel = 32;\r
- \r
+\r
fb->var.xres = 800;\r
fb->var.yres = 600;\r
\r