rk29-ipp:check whether support deinterlacing
authorchenli <chenli@rock-chips.com>
Sat, 27 Aug 2011 03:08:21 +0000 (11:08 +0800)
committerchenli <chenli@rock-chips.com>
Sat, 27 Aug 2011 06:22:33 +0000 (14:22 +0800)
1.Mobile phone dose not support deinterlacing
2.SF will check whether IPP support deinterlacing first

arch/arm/configs/rk29_phonesdk_defconfig
arch/arm/mach-rk29/include/mach/rk29-ipp.h
drivers/staging/rk29/ipp/Kconfig [changed mode: 0644->0755]
drivers/staging/rk29/ipp/rk29-ipp.c

index 67b6e12677a767fb27e092f7c07ada1282cfcd04..5d4b17a0e18981f788553b81000605fdf19392ef 100755 (executable)
@@ -1825,6 +1825,7 @@ CONFIG_VIVANTE=y
 # IPP
 #
 CONFIG_RK29_IPP=y
+CONFIG_DEINTERLACE=n
 
 #
 # CMMB
index 36027c802451c1d8570ae6d74ead22595be8410e..488f6e8787e21b3bacb9cf707eb1ce740f2f63d0 100755 (executable)
@@ -34,7 +34,7 @@ struct rk29_ipp_req {
        */\r
        uint8_t store_clip_mode;\r
        \r
-       //deinterlace_enable 1:enable 0:disable\r
+       //deinterlace_enable  0:disable 1:enable 2:query\r
        uint8_t deinterlace_enable;\r
        //the sum of three paras should be 32,and single para should be less than 32\r
        uint8_t deinterlace_para0;\r
old mode 100644 (file)
new mode 100755 (executable)
index f759916..81a951f
@@ -3,6 +3,14 @@ config RK29_IPP
        tristate "ROCKCHIP RK29 IPP"
        default y
        help
-          rk29 ipp module.
+          rk29 ipp module.     
+          
+config DEINTERLACE
+       bool "Deinterlacing support"
+       depends on      RK29_IPP        
+       default y
+       help 
+                                       Mobile phone dose not support deinterlacing
+       
 endmenu
 
index 8d9862bd56298c97406068be64e5c0a86d05bfa1..05e8c652e8636a93befd960b56fb46dd6745fb72 100755 (executable)
@@ -308,7 +308,7 @@ int ipp_blit(const struct rk29_ipp_req *req)
        uint32_t dst0_YrgbMst=0,dst0_CbrMst=0;\r
        uint32_t ret = 0;\r
        uint32_t deinterlace_config = 0;\r
-\r
+       \r
        //printk("ipp_blit\n");\r
        if (drvdata == NULL) {                  /* ddl@rock-chips.com : check driver is normal or not */\r
                printk("%s drvdata is NULL, IPP driver probe is fail!!\n", __FUNCTION__);\r
@@ -846,8 +846,12 @@ int ipp_blit(const struct rk29_ipp_req *req)
                                {\r
                                        deinterlace_config = (req->deinterlace_enable<<24) | (req->deinterlace_para0<<19) | (req->deinterlace_para1<<14) | (req->deinterlace_para2<<9);\r
                                        DBG("para0 %d, para1 %d, para2 %d,deinterlace_config  %x\n",req->deinterlace_para0,req->deinterlace_para1,req->deinterlace_para2,deinterlace_config);\r
-                                       ipp_write((ipp_read(IPP_CONFIG)&0xFE0001FF)|deinterlace_config, IPP_CONFIG);\r
-                                       //printk("IPP_CONFIG2 = 0x%x\n",ipp_read(IPP_CONFIG));\r
+                                       #ifdef CONFIG_DEINTERLACE\r
+                                               ipp_write((ipp_read(IPP_CONFIG)&0xFE0001FF)|deinterlace_config, IPP_CONFIG);\r
+                                       #else\r
+                                               printk("does not support deinterlacing!\n");\r
+                                               ipp_write(ipp_read(IPP_CONFIG)&(~DEINTERLACE_ENABLE), IPP_CONFIG); //disable deinterlace\r
+                                       #endif\r
                                }\r
                                else\r
                                {\r
@@ -878,6 +882,7 @@ int ipp_blit(const struct rk29_ipp_req *req)
                ipp_write(ipp_read(IPP_CONFIG)&(~STORE_CLIP_MODE), IPP_CONFIG);\r
        }\r
 \r
+\r
        /* Start the operation */\r
        ipp_write(8, IPP_INT);//                \r
        dsb();\r
@@ -932,7 +937,6 @@ int ipp_blit_sync(const struct rk29_ipp_req *req)
 \r
        //printk("ipp_blit_sync -------------------\n");\r
 \r
-\r
        ////If IPP is busy now,wait until it becomes idle\r
        mutex_lock(&drvdata->mutex);\r
        {\r
@@ -1026,7 +1030,17 @@ static int stretch_blit(/*struct ipp_context *ctx,*/  unsigned long arg ,unsigne
                goto err_noput;\r
        }\r
        \r
-       \r
+       if(req.deinterlace_enable==2)\r
+       {\r
+               #ifdef  CONFIG_DEINTERLACE\r
+                       printk("ipp support deinterlacing\n");\r
+               return 0;\r
+               #else\r
+                       printk("ipp dose not support deinterlacing\n");\r
+                       return -EPERM;\r
+               #endif\r
+       }\r
+\r
        if(cmd == IPP_BLIT_SYNC)\r
        {\r
                ret = ipp_blit_sync(&req);\r