Skip to content

Commit 95cb1b0

Browse files
committed
drm/i915: don't frob the vblank ts in finish_page_flip
Now that we correctly generate it, this hack is no longer required (and might actually paper over a serious bug). pageflip timestamps are sanity check in the latest version of the flip-test in intel-gpu-tools. v2: Also remove the gettimeofday(&now) which is no longer used. Noticed by Mario Kleiner. Reviewed-by: mario.kleiner@tuebingen.mpg.de Tested-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
1 parent 74d4444 commit 95cb1b0

File tree

1 file changed

+1
-22
lines changed

1 file changed

+1
-22
lines changed

drivers/gpu/drm/i915/intel_display.c

Lines changed: 1 addition & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -6181,15 +6181,13 @@ static void do_intel_finish_page_flip(struct drm_device *dev,
61816181
struct intel_unpin_work *work;
61826182
struct drm_i915_gem_object *obj;
61836183
struct drm_pending_vblank_event *e;
6184-
struct timeval tnow, tvbl;
6184+
struct timeval tvbl;
61856185
unsigned long flags;
61866186

61876187
/* Ignore early vblank irqs */
61886188
if (intel_crtc == NULL)
61896189
return;
61906190

6191-
do_gettimeofday(&tnow);
6192-
61936191
spin_lock_irqsave(&dev->event_lock, flags);
61946192
work = intel_crtc->unpin_work;
61956193
if (work == NULL || !work->pending) {
@@ -6203,25 +6201,6 @@ static void do_intel_finish_page_flip(struct drm_device *dev,
62036201
e = work->event;
62046202
e->event.sequence = drm_vblank_count_and_time(dev, intel_crtc->pipe, &tvbl);
62056203

6206-
/* Called before vblank count and timestamps have
6207-
* been updated for the vblank interval of flip
6208-
* completion? Need to increment vblank count and
6209-
* add one videorefresh duration to returned timestamp
6210-
* to account for this. We assume this happened if we
6211-
* get called over 0.9 frame durations after the last
6212-
* timestamped vblank.
6213-
*
6214-
* This calculation can not be used with vrefresh rates
6215-
* below 5Hz (10Hz to be on the safe side) without
6216-
* promoting to 64 integers.
6217-
*/
6218-
if (10 * (timeval_to_ns(&tnow) - timeval_to_ns(&tvbl)) >
6219-
9 * crtc->framedur_ns) {
6220-
e->event.sequence++;
6221-
tvbl = ns_to_timeval(timeval_to_ns(&tvbl) +
6222-
crtc->framedur_ns);
6223-
}
6224-
62256204
e->event.tv_sec = tvbl.tv_sec;
62266205
e->event.tv_usec = tvbl.tv_usec;
62276206

0 commit comments

Comments
 (0)