From: chenli Date: Tue, 27 Sep 2011 04:21:27 +0000 (+0800) Subject: rk29-ipp:1.fix deadlock bug of scaling UI when playing the video via HDMI X-Git-Tag: firefly_0821_release~9766^2~50 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=0745231b745757dbcc34d864e7bcf47d05f07291;p=firefly-linux-kernel-4.4.55.git rk29-ipp:1.fix deadlock bug of scaling UI when playing the video via HDMI 2.when format is YUV420,check the width and height of input and output images --- diff --git a/drivers/staging/rk29/ipp/rk29-ipp.c b/drivers/staging/rk29/ipp/rk29-ipp.c index d8903cbdf2f1..63d0936dcddd 100755 --- a/drivers/staging/rk29/ipp/rk29-ipp.c +++ b/drivers/staging/rk29/ipp/rk29-ipp.c @@ -87,6 +87,7 @@ struct ipp_drvdata { bool issync; //sync or async bool enable; //clk enable or disable int ipp_result; //0:success + int ipp_async_result; //ipp_blit_async result 0:success void (*ipp_irq_callback)(int ipp_retval); //callback function used by aync call }; @@ -233,14 +234,14 @@ static int ipp_get_result(unsigned long arg) //printk("ipp_get_result %d\n",drvdata->ipp_result); int ret =0; - if (unlikely(copy_to_user((void __user *)arg, &drvdata->ipp_result, sizeof(int)))) { + if (unlikely(copy_to_user((void __user *)arg, &drvdata->ipp_async_result, sizeof(int)))) { printk("copy_to_user failed\n"); ERR("copy_to_user failed\n"); ret = -EFAULT; } - idle_condition = 1; + //idle_condition = 1; //dmac_clean_range((const void*)&idle_condition,(const void*)&idle_condition+4); - wake_up_interruptible_sync(&blit_wait_queue); + //wake_up_interruptible_sync(&blit_wait_queue); return ret; } @@ -259,6 +260,14 @@ int ipp_check_param(const struct rk29_ipp_req *req) return -EINVAL; } + if(req->src0.fmt == IPP_Y_CBCR_H2V2) + { + if (unlikely((req->src0.w&0x1 != 0) || (req->src0.h&0x1 != 0) || (req->dst0.w&0x1 != 0)) || (req->dst0.h&0x1 != 0)) { + printk("YUV420 src or dst resolution is invalid! \n"); + return -EINVAL; + } + } + //check src_vir_w if(unlikely(req->src_vir_w < req->src0.w)){ printk("ipp invalid src_vir_w\n"); @@ -969,7 +978,7 @@ int ipp_blit_sync(const struct rk29_ipp_req *req) #endif if (wait_ret <= 0) { - printk("%s wait_ret=%d,wq_condition =%d,wait_event_timeout! \n",__FUNCTION__,wait_ret,wq_condition); + printk("%s wait_ret=%d,wq_condition =%d,wait_event_timeout:%dms! \n",__FUNCTION__,wait_ret,wq_condition,req->timeout); if(wq_condition==0) { @@ -1125,7 +1134,6 @@ static int ipp_release(struct inode *inode, struct file *file) static irqreturn_t rk29_ipp_irq(int irq, void *dev_id) { - //static int temp =0; DBG("rk29_ipp_irq %d \n",irq); //printk("rk29_ipp_irq %d \n",irq); @@ -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)); drvdata->ipp_irq_callback(drvdata->ipp_result); - //drvdata->ipp_irq_callback(temp); - - //In the case of async call in kernel space,we wake up the wait queue here - //In the case of async call in user space, we will wake up the wait queue until app get the result - if(drvdata->ipp_irq_callback != ipp_blit_complete) - { - idle_condition = 1; - wake_up_interruptible_sync(&blit_wait_queue); - } - //temp++; + //In the case of async call ,we wake up the wait queue here + drvdata->ipp_async_result = drvdata->ipp_result; + idle_condition = 1; + wake_up_interruptible_sync(&blit_wait_queue); }