fix the setting bug of pre_scale and post_scale
authorchenli <chenli@rock-chips.com>
Mon, 26 Dec 2011 07:32:08 +0000 (15:32 +0800)
committerchenli <chenli@rock-chips.com>
Mon, 26 Dec 2011 07:32:08 +0000 (15:32 +0800)
drivers/staging/rk29/ipp/rk29-ipp.c

index 5537824910be69ba433db8c5d48420060a2dad24..85313855808876abca9dff1e51ad9998e6812235 100755 (executable)
@@ -575,11 +575,11 @@ int ipp_blit(const struct rk29_ipp_req *req)
        /*Configure Pre_scale*/\r
        if((IPP_ROT_90 == rotate) || (IPP_ROT_270 == rotate))\r
        {\r
-               pre_scale = ((req->dst0.w < req->src0.h) ? 1 : 0)||((req->dst0.h < req->src0.w) ? 1 : 0);\r
+               pre_scale = ((req->dst0.w <= req->src0.h/2) ? 1 : 0)||((req->dst0.h <= req->src0.w/2) ? 1 : 0);\r
        }\r
        else //other degree\r
        {\r
-               pre_scale = ((req->dst0.w < req->src0.w) ? 1 : 0)||((req->dst0.h < req->src0.h) ? 1 : 0);\r
+               pre_scale = ((req->dst0.w <= req->src0.w/2) ? 1 : 0)||((req->dst0.h <= req->src0.h/2) ? 1 : 0);\r
        }\r
 \r
        if(pre_scale)\r
@@ -704,7 +704,7 @@ int ipp_blit(const struct rk29_ipp_req *req)
        if((IPP_ROT_90 == rotate) || (IPP_ROT_270 == rotate))\r
        {\r
                if (( (req->src0.h%req->dst0.w)!=0)||( (req->src0.w%req->dst0.h)!= 0)//non-interger down-scaling \r
-                       ||((req->src0.h/req->dst0.w)>8)||((req->src0.h%req->dst0.w)>8)   //down-scaling ratio > 8\r
+                       ||((req->src0.h/req->dst0.w)>8)||((req->src0.h/req->dst0.w)>8)   //down-scaling ratio > 8\r
                        ||(req->dst0.w > req->src0.h)  ||(req->dst0.h > req->src0.w))    //up-scaling\r
                                                        \r
                {\r
@@ -718,7 +718,7 @@ int ipp_blit(const struct rk29_ipp_req *req)
        else  //0 180 x-flip y-flip\r
        {\r
                if (( (req->src0.w%req->dst0.w)!=0)||( (req->src0.h%req->dst0.h)!= 0)//non-interger down-scaling \r
-                       ||((req->src0.w/req->dst0.w)>8)||((req->src0.h%req->dst0.h)>8)   //down-scaling ratio > 8\r
+                       ||((req->src0.w/req->dst0.w)>8)||((req->src0.h/req->dst0.h)>8)   //down-scaling ratio > 8\r
                        ||(req->dst0.w > req->src0.w)  ||(req->dst0.h > req->src0.h))    //up-scaling\r
                {\r
                        post_scale = 1;\r