rk29-ipp:1.fix deadlock bug of scaling UI when playing the video via HDMI
authorchenli <chenli@rock-chips.com>
Tue, 27 Sep 2011 04:21:27 +0000 (12:21 +0800)
committerchenli <chenli@rock-chips.com>
Tue, 27 Sep 2011 04:21:27 +0000 (12:21 +0800)
         2.when format is YUV420,check the width and height of input and output images

drivers/staging/rk29/ipp/rk29-ipp.c

index d8903cbdf2f17b12ef36c3cfa41c4092d80052ff..63d0936dcdddcdad1ab5c2924a7bd67b17c7a759 100755 (executable)
@@ -87,6 +87,7 @@ struct ipp_drvdata {
        bool issync;                                                    //sync or async\r
        bool enable;                                                    //clk enable or disable\r
        int ipp_result;                                                 //0:success\r
+       int ipp_async_result;                                           //ipp_blit_async result 0:success\r
        void (*ipp_irq_callback)(int ipp_retval);   //callback function used by aync call\r
 };\r
 \r
@@ -233,14 +234,14 @@ static int ipp_get_result(unsigned long arg)
        //printk("ipp_get_result %d\n",drvdata->ipp_result);\r
        int ret =0;\r
        \r
-       if (unlikely(copy_to_user((void __user *)arg, &drvdata->ipp_result, sizeof(int)))) {\r
+       if (unlikely(copy_to_user((void __user *)arg, &drvdata->ipp_async_result, sizeof(int)))) {\r
                        printk("copy_to_user failed\n");\r
                        ERR("copy_to_user failed\n");\r
                        ret =  -EFAULT; \r
                }\r
-       idle_condition = 1;\r
+       //idle_condition = 1;\r
        //dmac_clean_range((const void*)&idle_condition,(const void*)&idle_condition+4);\r
-       wake_up_interruptible_sync(&blit_wait_queue);\r
+       //wake_up_interruptible_sync(&blit_wait_queue);\r
        return ret;\r
 }\r
 \r
@@ -259,6 +260,14 @@ int ipp_check_param(const struct rk29_ipp_req *req)
                return  -EINVAL;\r
        }\r
 \r
+       if(req->src0.fmt == IPP_Y_CBCR_H2V2)\r
+       {\r
+               if (unlikely((req->src0.w&0x1 != 0) || (req->src0.h&0x1 != 0) || (req->dst0.w&0x1 != 0)) || (req->dst0.h&0x1 != 0)) {\r
+                               printk("YUV420 src or dst resolution is invalid! \n");\r
+                               return  -EINVAL;\r
+                       }\r
+       }\r
+       \r
        //check src_vir_w\r
        if(unlikely(req->src_vir_w < req->src0.w)){\r
                printk("ipp invalid src_vir_w\n");\r
@@ -969,7 +978,7 @@ int ipp_blit_sync(const struct rk29_ipp_req *req)
 #endif                         \r
                if (wait_ret <= 0)\r
                {\r
-                       printk("%s wait_ret=%d,wq_condition =%d,wait_event_timeout! \n",__FUNCTION__,wait_ret,wq_condition);\r
+                       printk("%s wait_ret=%d,wq_condition =%d,wait_event_timeout:%dms! \n",__FUNCTION__,wait_ret,wq_condition,req->timeout);\r
 \r
                        if(wq_condition==0)\r
                        {\r
@@ -1125,7 +1134,6 @@ static int ipp_release(struct inode *inode, struct file *file)
 \r
 static irqreturn_t rk29_ipp_irq(int irq,  void *dev_id)\r
 {\r
-       //static int temp =0;\r
        DBG("rk29_ipp_irq %d \n",irq);\r
        //printk("rk29_ipp_irq %d \n",irq);\r
 \r
@@ -1160,17 +1168,11 @@ static irqreturn_t rk29_ipp_irq(int irq,  void *dev_id)
                schedule_delayed_work(&drvdata->power_off_work, msecs_to_jiffies(1000));\r
                        \r
                drvdata->ipp_irq_callback(drvdata->ipp_result);\r
-               //drvdata->ipp_irq_callback(temp);\r
                \r
-\r
-               //In the case of async call in kernel space,we wake up the wait queue here\r
-               //In the case of async call in user space, we will wake up the wait queue until app get the result\r
-               if(drvdata->ipp_irq_callback != ipp_blit_complete)\r
-               {\r
-                       idle_condition = 1;\r
-                       wake_up_interruptible_sync(&blit_wait_queue);\r
-               }\r
-               //temp++;\r
+               //In the case of async call ,we wake up the wait queue here\r
+               drvdata->ipp_async_result = drvdata->ipp_result;\r
+               idle_condition = 1;\r
+               wake_up_interruptible_sync(&blit_wait_queue);\r
        }\r
        \r
        \r