\r
static long rga_ioctl(struct file *file, uint32_t cmd, unsigned long arg)\r
{\r
- struct rga_req *req;\r
+ struct rga_req req;\r
int ret = 0;\r
rga_session *session;\r
\r
mutex_unlock(&rga_service.mutex);\r
return -EINVAL;\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
+ memset(&req, 0x0, sizeof(req)); \r
\r
switch (cmd)\r
{\r
case RGA_BLIT_SYNC:\r
- if (unlikely(copy_from_user(req, (struct rga_req*)arg, sizeof(struct rga_req))))\r
+ if (unlikely(copy_from_user(&req, (struct rga_req*)arg, sizeof(struct rga_req))))\r
{\r
ERR("copy_from_user failed\n");\r
ret = -EFAULT;\r
break;\r
}\r
- ret = rga_blit_sync(session, req);\r
+ ret = rga_blit_sync(session, &req);\r
break;\r
case RGA_BLIT_ASYNC:\r
- if (unlikely(copy_from_user(req, (struct rga_req*)arg, sizeof(struct rga_req))))\r
+ if (unlikely(copy_from_user(&req, (struct rga_req*)arg, sizeof(struct rga_req))))\r
{\r
ERR("copy_from_user failed\n");\r
ret = -EFAULT;\r
\r
if((atomic_read(&rga_service.total_running) > 16))\r
{\r
- ret = rga_blit_sync(session, req);\r
+ ret = rga_blit_sync(session, &req);\r
}\r
else\r
{\r
- ret = rga_blit_async(session, req);\r
+ ret = rga_blit_async(session, &req);\r
}\r
break;\r
case RGA_FLUSH:\r
break;\r
}\r
\r
- kfree(req);\r
-\r
mutex_unlock(&rga_service.mutex);\r
\r
return ret;\r