}\r
\r
\r
-\r
static int rga_check_param(const struct rga_req *req)\r
{\r
/*RGA can support up to 8192*8192 resolution in RGB format,but we limit the image size to 8191*8191 here*/\r
}\r
\r
\r
+static rga_mem_addr_sel(struct rga_req *req)\r
+{\r
+ switch(req->src.format)\r
+ {\r
+ case RK_FORMAT_YCbCr_422_SP:\r
+ break;\r
+ case RK_FORMAT_YCbCr_422_P :\r
+ break;\r
+ case RK_FORMAT_YCbCr_420_SP :\r
+ break;\r
+ case RK_FORMAT_YCbCr_420_P :\r
+ break;\r
+\r
+ case RK_FORMAT_YCrCb_422_SP :\r
+ break;\r
+ case RK_FORMAT_YCrCb_422_P :\r
+ break;\r
+ case RK_FORMAT_YCrCb_420_SP :\r
+ break;\r
+ case RK_FORMAT_YCrCb_420_P : \r
+ break;\r
+ default :\r
+ break;\r
+ }\r
+ \r
+}\r
+\r
\r
static int rga_blit(rga_session *session, struct rga_req *req)\r
{\r
\r
static int rga_open(struct inode *inode, struct file *file)\r
{\r
+ unsigned long flag;\r
rga_session *session = (rga_session *)kmalloc(sizeof(rga_session), GFP_KERNEL);\r
if (NULL == session) {\r
pr_err("unable to allocate memory for rga_session.");\r
INIT_LIST_HEAD(&session->running);\r
INIT_LIST_HEAD(&session->list_session);\r
init_waitqueue_head(&session->wait);\r
- /* no need to protect */\r
+ \r
+ spin_lock_irqsave(&rga_service.lock, flag);\r
list_add_tail(&session->list_session, &rga_service.session);\r
+ spin_unlock_irqrestore(&rga_service.lock, flag);\r
+ \r
atomic_set(&session->task_running, 0);\r
atomic_set(&session->num_done, 0);\r
file->private_data = (void *)session;\r
\r
spin_lock_irqsave(&rga_service.lock, flag); \r
rga_del_running_list();\r
- spin_unlock_irqrestore(&rga_service.lock, flag);\r
- \r
+ \r
if(!list_empty(&rga_service.waiting))\r
{\r
+ spin_unlock_irqrestore(&rga_service.lock, flag);\r
rga_try_set_reg(1);\r
}\r
+ else\r
+ {\r
+ spin_unlock_irqrestore(&rga_service.lock, flag);\r
+ }\r
\r
/* add cmd to cmd buf */\r
/*\r