aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorDaniel Vetter <daniel.vetter@ffwll.ch>2012-10-02 14:10:37 -0400
committerDaniel Vetter <daniel.vetter@ffwll.ch>2012-10-04 04:33:43 -0400
commit95cb1b02b0f8e690cbcc479924573b4fb26c2e8f (patch)
tree0760adf92e308cc15e44d8abc51d1842cea59664 /drivers
parent74d44445afb9f50126eba052adeb89827cee88f3 (diff)
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>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/gpu/drm/i915/intel_display.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 57c1309733f6..67912febb322 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -6181,15 +6181,13 @@ static void do_intel_finish_page_flip(struct drm_device *dev,
6181 struct intel_unpin_work *work; 6181 struct intel_unpin_work *work;
6182 struct drm_i915_gem_object *obj; 6182 struct drm_i915_gem_object *obj;
6183 struct drm_pending_vblank_event *e; 6183 struct drm_pending_vblank_event *e;
6184 struct timeval tnow, tvbl; 6184 struct timeval tvbl;
6185 unsigned long flags; 6185 unsigned long flags;
6186 6186
6187 /* Ignore early vblank irqs */ 6187 /* Ignore early vblank irqs */
6188 if (intel_crtc == NULL) 6188 if (intel_crtc == NULL)
6189 return; 6189 return;
6190 6190
6191 do_gettimeofday(&tnow);
6192
6193 spin_lock_irqsave(&dev->event_lock, flags); 6191 spin_lock_irqsave(&dev->event_lock, flags);
6194 work = intel_crtc->unpin_work; 6192 work = intel_crtc->unpin_work;
6195 if (work == NULL || !work->pending) { 6193 if (work == NULL || !work->pending) {
@@ -6203,25 +6201,6 @@ static void do_intel_finish_page_flip(struct drm_device *dev,
6203 e = work->event; 6201 e = work->event;
6204 e->event.sequence = drm_vblank_count_and_time(dev, intel_crtc->pipe, &tvbl); 6202 e->event.sequence = drm_vblank_count_and_time(dev, intel_crtc->pipe, &tvbl);
6205 6203
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
6225 e->event.tv_sec = tvbl.tv_sec; 6204 e->event.tv_sec = tvbl.tv_sec;
6226 e->event.tv_usec = tvbl.tv_usec; 6205 e->event.tv_usec = tvbl.tv_usec;
6227 6206