video/rockchip: rga2: retry 10 times when timeout
authorMark Yao <mark.yao@rock-chips.com>
Thu, 30 Mar 2017 12:17:35 +0000 (20:17 +0800)
committerMark Yao <mark.yao@rock-chips.com>
Fri, 31 Mar 2017 01:09:26 +0000 (09:09 +0800)
Change-Id: I06b55f282c73735e4a0a5fa4e96f042f8b017646
Signed-off-by: Mark Yao <mark.yao@rock-chips.com>
drivers/video/rockchip/rga2/rga2_drv.c

index 83bec1058fa4ade8cd8df8beda7928de5c44676a..8b3b176263ee78ebb26425057c0979d3ae3f9967 100644 (file)
@@ -913,9 +913,14 @@ static int rga2_blit_async(rga2_session *session, struct rga2_req *req)
 
 static int rga2_blit_sync(rga2_session *session, struct rga2_req *req)
 {
+       struct rga2_req req_bak;
+       int try = 10;
        int ret = -1;
        int ret_timeout = 0;
 
+       memcpy(&req_bak, req, sizeof(req_bak));
+retry:
+
 #if RGA2_TEST_MSG
        if (1) {//req->bitblt_mode == 0x2) {
                print_info(req);
@@ -957,6 +962,10 @@ static int rga2_blit_sync(rga2_session *session, struct rga2_req *req)
        rga2_end = ktime_sub(rga2_end, rga2_start);
        printk("sync one cmd end time %d\n", (int)ktime_to_us(rga2_end));
 #endif
+       if (ret == -ETIMEDOUT && try--) {
+               memcpy(req, &req_bak, sizeof(req_bak));
+               goto retry;
+       }
 
        return ret;
        }