IPP fix bugs:
authorchenli <chenli@ubuntu.(none)>
Tue, 19 Jul 2011 01:44:37 +0000 (09:44 +0800)
committerchenli <chenli@ubuntu.(none)>
Tue, 19 Jul 2011 01:44:37 +0000 (09:44 +0800)
1.Disable pre_scaling or deinterlacing when there is no request to do
2.Store clip mode always set to 1 now

arch/arm/mach-rk29/include/mach/rk29-ipp.h
drivers/staging/rk29/ipp/rk29-ipp.c

index 7cedaa01d63a3c01adff3d497c954d8aa0c1164d..cb468d66760c3f092dda217aed2090ab1898f88d 100755 (executable)
@@ -105,6 +105,7 @@ typedef enum
 #define IPP_PROCESS_ST                 (0x50)\r
 \r
 /*ipp config*/\r
+#define DEINTERLACE_ENABLE             (1<<24)\r
 #define ROT_ENABLE                             (1<<8)\r
 #define PRE_SCALE                              (1<<4)\r
 #define POST_SCALE                             (1<<3)\r
index e823974ab1f8f799c4a492e5a0a7a0f316388966..5c30ada5bed31732791525700bc607d3c30a60a0 100755 (executable)
@@ -328,7 +328,8 @@ int ipp_blit(const struct rk29_ipp_req *req)
 \r
        ret = ipp_check_param(req);\r
        if(ret ==  -EINVAL)\r
-       {\r
+       {       \r
+               printk("IPP invalid input!\n");\r
                goto erorr_input;\r
        }\r
        \r
@@ -667,6 +668,7 @@ int ipp_blit(const struct rk29_ipp_req *req)
        }\r
        else//no pre_scale\r
        {\r
+               ipp_write(ipp_read(IPP_CONFIG)&(~PRE_SCALE), IPP_CONFIG); //disable pre_scale\r
                ipp_write(0,IPP_PRE_SCL_PARA);\r
                ipp_write((req->src0.h<<16)|req->src0.w, IPP_PRE_IMG_INFO);\r
        }\r
@@ -851,13 +853,17 @@ int ipp_blit(const struct rk29_ipp_req *req)
                        ERR("only support YUV format!\n");\r
                }\r
        }\r
+       else\r
+       {\r
+               ipp_write(ipp_read(IPP_CONFIG)&(~DEINTERLACE_ENABLE), IPP_CONFIG); //disable deinterlace\r
+       }\r
 \r
        /*Configure other*/\r
        ipp_write((req->dst_vir_w<<16)|req->src_vir_w, IPP_IMG_VIR);\r
 \r
-       if((req->src0.w%4) !=0)\r
+       //store clip mode always set to 1 now\r
        ipp_write(ipp_read(IPP_CONFIG)|(1<<26), IPP_CONFIG);//store clip mode\r
-\r
+       \r
        /* Start the operation */\r
        ipp_write(8, IPP_INT);//\r
        \r
@@ -1256,11 +1262,11 @@ uint32_t size = 8*1024*1024;
                \r
                ipp_req.dst0.YrgbMst = dst_addr;\r
                ipp_req.dst0.CbrMst = dst_addr + size;\r
-               ipp_req.dst0.w = 800;\r
-               ipp_req.dst0.h = 480;\r
+               ipp_req.dst0.w = 240;\r
+               ipp_req.dst0.h = 160;\r
        \r
                ipp_req.src_vir_w = 480;\r
-               ipp_req.dst_vir_w = 800;\r
+               ipp_req.dst_vir_w = 240;\r
                ipp_req.timeout = 100;\r
                ipp_req.flag = IPP_ROT_0;\r
                \r
@@ -1270,6 +1276,13 @@ uint32_t size = 8*1024*1024;
                ipp_req.deinterlace_para2 = 0;\r
 \r
                ipp_req.complete = ipp_test_complete;\r
+\r
+               /*0 test whether IPP_CONFIG is set correctly*/\r
+               ipp_blit_sync(&ipp_req);\r
+               ipp_req.dst0.w = 480;\r
+               ipp_req.dst0.h = 320;\r
+               ipp_req.dst_vir_w = 480;\r
+               ipp_blit_sync(&ipp_req);\r
                \r
                /*1 test ipp_blit_sync*/\r
                /*\r
@@ -1341,6 +1354,7 @@ uint32_t size = 8*1024*1024;
                */\r
 \r
                /*6.call IPP driver in the kernel space and the user space at the same time*/\r
+               /*\r
                        ipp_req.src_vir_w = 280;\r
                ipp_req.dst_vir_w = 800;\r
                do\r
@@ -1356,6 +1370,8 @@ uint32_t size = 8*1024*1024;
                ipp_req.dst_vir_w = 600;\r
 \r
                ipp_blit_sync(&ipp_req);\r
+               */\r
+               \r
                /*7.suspand and resume*/\r
                /*\r
                //do\r
@@ -1633,7 +1649,7 @@ static int __init ipp_drv_probe(struct platform_device *pdev)
 \r
 #ifdef IPP_TEST\r
        INIT_DELAYED_WORK(&d_work, ipp_test_work_handler);\r
-       schedule_delayed_work(&d_work, msecs_to_jiffies(35000));\r
+       schedule_delayed_work(&d_work, msecs_to_jiffies(15000));\r
 #endif\r
 \r
        return 0;\r