From 749cd2df64f1fb4d60ab604ceadadeff3bcbc187 Mon Sep 17 00:00:00 2001 From: zsq Date: Fri, 4 Jan 2013 16:54:31 +0800 Subject: [PATCH] fix rga kernel interface bugwq --- drivers/video/rockchip/rga/rga_drv.c | 25 ++++++++++++++++++------- 1 file changed, 18 insertions(+), 7 deletions(-) diff --git a/drivers/video/rockchip/rga/rga_drv.c b/drivers/video/rockchip/rga/rga_drv.c index 3a8bf2cef971..65c23b9ce290 100755 --- a/drivers/video/rockchip/rga/rga_drv.c +++ b/drivers/video/rockchip/rga/rga_drv.c @@ -77,7 +77,7 @@ ktime_t rga_end; int rga_num = 0; -rga_session *rga_session_global; +rga_session rga_session_global; struct rga_drvdata { struct miscdevice miscdev; @@ -135,9 +135,9 @@ static void print_info(struct rga_req *req) printk("clip.xmin = %d, clip.xmax = %d. clip.ymin = %d, clip.ymax = %d\n", req->clip.xmin, req->clip.xmax, req->clip.ymin, req->clip.ymax); - printk("alpha_rop_flag = %.8x\n", req->alpha_rop_flag); - printk("alpha_rop_mode = %.8x\n", req->alpha_rop_mode); - printk("PD_mode = %.8x\n", req->PD_mode); + //printk("alpha_rop_flag = %.8x\n", req->alpha_rop_flag); + //printk("alpha_rop_mode = %.8x\n", req->alpha_rop_mode); + //printk("PD_mode = %.8x\n", req->PD_mode); } #endif @@ -991,7 +991,7 @@ long rga_ioctl_kernel(struct rga_req *req) mutex_lock(&rga_service.mutex); - session = (rga_session *)rga_session_global; + session = &rga_session_global; if (NULL == session) { @@ -1049,8 +1049,6 @@ static int rga_open(struct inode *inode, struct file *file) file->private_data = (void *)session; - rga_session_global = session; - //DBG("*** rga dev opened by pid %d *** \n", session->pid); return nonseekable_open(inode, file); @@ -1271,6 +1269,19 @@ static int __init rga_init(void) return ret; } + { + rga_session_global.pid = 0x0000ffff; + INIT_LIST_HEAD(&rga_session_global.waiting); + INIT_LIST_HEAD(&rga_session_global.running); + INIT_LIST_HEAD(&rga_session_global.list_session); + init_waitqueue_head(&rga_session_global.wait); + //mutex_lock(&rga_service.lock); + list_add_tail(&rga_session_global.list_session, &rga_service.session); + //mutex_unlock(&rga_service.lock); + atomic_set(&rga_session_global.task_running, 0); + atomic_set(&rga_session_global.num_done, 0); + } + //rga_test_0(); INFO("Module initialized.\n"); -- 2.34.1