rk29-ipp:Add the support of two cases of up-scaling:
authorchenli <chenli@rock-chips.com>
Wed, 17 Aug 2011 06:46:06 +0000 (14:46 +0800)
committerchenli <chenli@rock-chips.com>
Wed, 17 Aug 2011 06:51:13 +0000 (14:51 +0800)
1. 128*128->480*800, YUV420
2. 176*144->480*800, YUV420

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

index f5bd523318aec1db20edf7a7c7a025d8e23dffbe..a6fea1250ab609ca0ec5f7cf22a1fa8c21ac6df9 100755 (executable)
@@ -794,9 +794,15 @@ int ipp_blit(const struct rk29_ipp_req *req)
 \r
                }\r
 \r
-               if(!((req->src0.fmt != IPP_Y_CBCR_H2V1)&&(req->src0.w == 176)&&(req->src0.h == 144)&&(req->dst0.w == 480)&&(req->dst0.h == 800)))\r
+               /*only support 1/2 to 4 times scaling,but two cases can pass\r
+               1.176*144->480*800, YUV420 \r
+               2.128*128->480*800, YUV420\r
+               */\r
+               if(!((req->src0.fmt == IPP_Y_CBCR_H2V2)&&\r
+                       (((req->src0.w == 176)&&(req->src0.h == 144))||((req->src0.w == 128)&&(req->src0.h == 128)))&&\r
+                       ((req->dst0.w == 480)&&(req->dst0.h == 800))))  \r
                {       \r
-                       //only support 1/2 to 4 times scaling,but 176*144->480*800 can pass\r
+                       \r
                        if(post_scale_w<0x3ff || post_scale_w>0x1fff || post_scale_h<0x400 || post_scale_h>0x2000 )\r
                        {\r
                                printk("invalid post_scale para!\n");\r
@@ -1269,21 +1275,21 @@ uint32_t size = 8*1024*1024;
                \r
                ipp_req.src0.YrgbMst = src_addr;\r
                ipp_req.src0.CbrMst = src_addr + size;\r
-               ipp_req.src0.w = 480;\r
-               ipp_req.src0.h = 320;\r
+               ipp_req.src0.w = 128;\r
+               ipp_req.src0.h = 128;\r
                ipp_req.src0.fmt = IPP_Y_CBCR_H2V2;\r
                \r
                ipp_req.dst0.YrgbMst = dst_addr;\r
                ipp_req.dst0.CbrMst = dst_addr + size;\r
-               ipp_req.dst0.w = 240;\r
-               ipp_req.dst0.h = 160;\r
+               ipp_req.dst0.w = 480;\r
+               ipp_req.dst0.h = 800;\r
        \r
-               ipp_req.src_vir_w = 480;\r
-               ipp_req.dst_vir_w = 240;\r
+               ipp_req.src_vir_w = 128;\r
+               ipp_req.dst_vir_w = 480;\r
                ipp_req.timeout = 100;\r
                ipp_req.flag = IPP_ROT_0;\r
                \r
-               ipp_req.deinterlace_enable =1;\r
+               ipp_req.deinterlace_enable =0;\r
                ipp_req.deinterlace_para0 = 16;\r
                ipp_req.deinterlace_para1 = 16;\r
                ipp_req.deinterlace_para2 = 0;\r
@@ -1291,11 +1297,13 @@ uint32_t size = 8*1024*1024;
                ipp_req.complete = ipp_test_complete;\r
 \r
                /*0 test whether IPP_CONFIG is set correctly*/\r
+               /*\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
                \r
                /*1 test ipp_blit_sync*/\r
                /*\r
@@ -1407,6 +1415,45 @@ uint32_t size = 8*1024*1024;
                while(ret>0);\r
 */\r
 \r
+               /*8 test special up scaling*/\r
+               ipp_req.src0.fmt = IPP_Y_CBCR_H2V2;\r
+               ipp_req.src0.w = 128;\r
+               ipp_req.src0.h = 128;\r
+               ipp_req.dst0.w = 480;\r
+               ipp_req.dst0.h = 800;\r
+               ipp_req.src_vir_w = 128;\r
+               ipp_req.dst_vir_w = 480;\r
+               ret = -1;\r
+               ret = ipp_blit_sync(&ipp_req);\r
+               printk("128x128->480x800: %d \n",ret);\r
+\r
+               ipp_req.src0.w = 160;\r
+               ipp_req.src0.h = 160;\r
+               ipp_req.src_vir_w = 160;\r
+               ret = -1;\r
+               ret = ipp_blit_sync(&ipp_req);\r
+               printk("160x160->480x800: %d \n",ret);\r
+\r
+               ipp_req.src0.w = 176;\r
+               ipp_req.src0.h = 144;\r
+               ipp_req.src_vir_w = 176;\r
+               ret = -1;\r
+               ret = ipp_blit_sync(&ipp_req);\r
+               printk("176x144->480x800: %d \n",ret);\r
+\r
+               ipp_req.src0.fmt = IPP_Y_CBCR_H2V1;\r
+               ret = -1;\r
+               ret = ipp_blit_sync(&ipp_req);\r
+               printk("fmt:422 176x144->480x800 : %d \n",ret);\r
+\r
+               ipp_req.src0.fmt = IPP_Y_CBCR_H2V2;\r
+               ipp_req.dst0.w = 800;\r
+               ipp_req.dst0.h = 480;\r
+               ipp_req.dst_vir_w = 800;\r
+               ret = -1;\r
+               ret = ipp_blit_sync(&ipp_req);\r
+               printk("176x144->800x480: %d \n",ret);\r
+\r
                \r
                free_pages(srcY, 9);\r
 //test deinterlace\r