vblank: correct the client request time 48/144248/1
authorBoram Park <boram1288.park@samsung.com>
Wed, 16 Aug 2017 05:06:44 +0000 (14:06 +0900)
committerBoram Park <boram1288.park@samsung.com>
Wed, 16 Aug 2017 05:06:44 +0000 (14:06 +0900)
The client request time SHOULD be bigger than the last vblank time. To make
sure it, we forcely set the last vblank time to the client request time when
the req_time is smaller than the last_time.

Change-Id: Ib1dbec907fa04693d6df05b8260e300f6032563e

src/tdm_vblank.c

index 88a5084960196301d0d529192dde541ff0a36666..0cff134032ad2424aad68cfafcfde7bceafcdcf0 100644 (file)
@@ -818,6 +818,10 @@ _tdm_vblank_wait_HW(tdm_vblank_wait_info *wait_info)
                last = private_vblank->last_time;
                req = wait_info->req_time;
 
+               /* make sure that req time is bigger than last. */
+               if (req < last)
+                       req = last;
+
                skip = (unsigned int)((req - last) / private_vblank->vblank_gap + TDM_TIME_MARGIN);
                prev = last + private_vblank->vblank_gap * skip;
 
@@ -965,6 +969,10 @@ _tdm_vblank_wait_SW(tdm_vblank_wait_info *wait_info)
                last = private_vblank->last_time;
                req = wait_info->req_time;
 
+               /* make sure that req time is bigger than last. */
+               if (req < last)
+                       req = last;
+
                skip = (unsigned int)((req - last) / private_vblank->vblank_gap + TDM_TIME_MARGIN);
                prev = last + private_vblank->vblank_gap * skip;