Bug 94294 - [BAT ILK HSW] basic-flip-vs-wf_vblank timestamp vs. seq counter difference
Summary: [BAT ILK HSW] basic-flip-vs-wf_vblank timestamp vs. seq counter difference
Status: CLOSED FIXED
Alias: None
Product: DRI
Classification: Unclassified
Component: DRM/Intel (show other bugs)
Version: DRI git
Hardware: x86-64 (AMD64) Linux (All)
: highest critical
Assignee: mwa
QA Contact: Intel GFX Bugs mailing list
URL:
Whiteboard:
Keywords:
: 94347 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-02-25 18:13 UTC by Ville Syrjala
Modified: 2016-09-16 08:30 UTC (History)
3 users (show)

See Also:
i915 platform: HSW, ILK
i915 features: display/Other


Attachments

Description Ville Syrjala 2016-02-25 18:13:18 UTC
We appear to sometimes inconsistent vblank timestamps vs. seq numbers. This could be due to the race in the vblank code I tried to fix [1] long time ago, but the patch got held hostage due to Daniel's desire to use seqlocks. But since no one volunteered to do the work, here we are.

[1] https://lists.freedesktop.org/archives/dri-devel/2015-September/090288.html

/archive/results/CI_IGT_test/CI_DRM_1072/bsw-nuc-2/html/bsw-nuc-2@CI_DRM_1072@1/igt@kms_flip@basic-flip-vs-wf_vblank.html
/archive/results/CI_IGT_test/CI_DRM_1084/snb-x220t/html/snb-x220t@CI_DRM_1084@1/igt@kms_flip@basic-flip-vs-wf_vblank.html
Comment 1 Imre Deak 2016-03-01 11:28:24 UTC
*** Bug 94347 has been marked as a duplicate of this bug. ***
Comment 2 Ville Syrjala 2016-03-07 15:02:38 UTC
Potentially related; sometimes [1] we get the same off by one seq vs .ts issue, except with seq_step==1. Not sure if there's some bug in the test or maybe seq_step doesn't always indicate the length of the wait?

(kms_flip:6763) DEBUG: name = flip
last_ts = 333.745977 usec
last_received_ts = 333.745522 usec
last_seq = 1706
current_ts = 333.929216 usec
current_received_ts = 333.929426 usec
current_seq = 1716
count = 51
seq_step = 1
(kms_flip:6763) CRITICAL: Test assertion failure function check_state,
file kms_flip.c:692:
(kms_flip:6763) CRITICAL: Failed assertion: fabs((((double)
diff.tv_usec) - usec_interflip) / usec_interflip) <= 0.005
(kms_flip:6763) CRITICAL: Last errno: 25, Inappropriate ioctl for device
(kms_flip:6763) CRITICAL: inter-flip ts jitter: 0s, 183239usec
****  END  ****

[1] /archive/results/CI_IGT_test/Patchwork_1530/
Comment 6 yann 2016-04-25 10:05:11 UTC
Kimmo, do we have someone who can proceed on further investigation ?
Comment 7 mwa 2016-05-13 12:05:06 UTC
Should be fixed by [1] once merged.

[1] https://patchwork.freedesktop.org/patch/86354/
Comment 8 Jairo Miramontes 2016-05-25 21:51:06 UTC
Tested this on a BSW platform and Passed.

The output is the following:


./kms_flip --run-subtest basic-flip-vs-wf_vblank
IGT-Version: 1.14-g5cc3175 (x86_64) (Linux: 4.6.0-drm-intel-nightly-ww22-commit-3a7ef25+ x86_64)
Using monotonic timestamps
Beginning basic-flip-vs-wf_vblank on pipe A, connector eDP-1
  1366x768 60 1366 1414 1446 1610 768 771 776 790 0x9 0x48 76320
...............................
basic-flip-vs-wf_vblank on pipe A, connector eDP-1: PASSED

Beginning basic-flip-vs-wf_vblank on pipe B, connector eDP-1
  1366x768 60 1366 1414 1446 1610 768 771 776 790 0x9 0x48 76320
...............................
basic-flip-vs-wf_vblank on pipe B, connector eDP-1: PASSED



Using the following Kernel
-------------------Kernel-------------------------------------------------
commit 3a7ef25d3113e570e14d8f78606047f86f1bc4a4
Author: Jani Nikula <jani.nikula@intel.com>
Date:   Tue May 24 15:44:17 2016 +0300

    drm-intel-nightly: 2016y-05m-24d-12h-43m-51s UTC integration manifest
--------------------------------------------------------------------------
This kernel already includes the patches proposed.
Comment 9 Ville Syrjala 2016-06-22 17:00:16 UTC
Haven't seen this one in a while. Assuming the fix worked.

commit d4055a9b207966ab4058550d818532b979d8bf78
Author: Matthew Auld <matthew.auld@intel.com>
Date:   Tue May 10 15:21:28 2016 +0100

    drm: use seqlock for vblank time/count
Comment 10 cprigent 2016-09-07 11:25:44 UTC
Pass on SNB.
SNB removed from title and "i915 platform"

Platform: HP Z210 Workstation
CPU: Intel(R) Core(TM) i5-2400 CPU @ 3.10GHz (family 6, model 42, stepping 7)
Motherboard version: DQ67SW
GPU: Intel® HD Graphics 2000 - Intel Corporation 2nd Generation Core Processor Family Integrated Graphics Controller (rev 09)

Software
Bios: SWQ6710H.86A.0060.2011.1220.1805
Linux distribution: Ubuntu 16.04 64 bits
Kernel: 4.8.0-rc4 9baa666 from http://cgit.freedesktop.org/drm-intel/
  commit 9baa666b3e48f71b46c5f63541f57d2a95a1b1c0
  Author: Chris Wilson <chris@chris-wilson.co.uk>
  Date:   Sat Sep 3 13:12:38 2016 +0100
  drm-intel-nightly: 2016y-09m-03d-12h-12m-15s UTC integration manifest
libdrm-2.4.70-6 4462303 from git://anongit.freedesktop.org/mesa/drm
mesa: mesa-11.2.2 3a9f628from git://anongit.freedesktop.org/mesa/mesa
cairo 1.15.2 db8a7f1 from git://anongit.freedesktop.org/cairo
xorg-server-1.18.0-546 deae9c7 from git://git.freedesktop.org/git/xorg/xserver
2.99.917-701 205146b from git://git.freedesktop.org/git/xorg/driver/xf86-video-intel
libva-1.7.0-47 2ebf897 from git://git.freedesktop.org/git/vaapi/libva 
vaapi-intel-driver: 1.7.0-95 1817bee from git://git.freedesktop.org/git/vaapi/intel-driver
Intel-Gpu-Tools 1.16 6bd4208 from http://anongit.freedesktop.org/git/xorg/app/intel-gpu-tools.git
Comment 11 cprigent 2016-09-09 08:26:35 UTC
Let's confirm on HSW and ILK before closing it
Comment 12 Jari Tahvanainen 2016-09-16 08:30:32 UTC
Based on the last two week executions on fi-hsw-4770k, fi-hsw-4770r, fi-ilk-650 and fi-ilk-m540 the basic-flip-vs-wf_vblank has SUCCESS/PASSED. E.g on the latest CI_DRM_1640/fi-hsw-4770k

IGT-Version: 1.16-g237cb89 (x86_64) (Linux: 4.8.0-rc5-CI-CI_DRM_1640+ x86_64)
Using monotonic timestamps
Beginning basic-flip-vs-wf_vblank on pipe A, connector VGA-1
  1024x768 60 1024 1048 1184 1344 768 771 777 806 0xa 0x40 65000

basic-flip-vs-wf_vblank on pipe A, connector VGA-1: PASSED

Beginning basic-flip-vs-wf_vblank on pipe B, connector VGA-1
  1024x768 60 1024 1048 1184 1344 768 771 777 806 0xa 0x40 65000

basic-flip-vs-wf_vblank on pipe B, connector VGA-1: PASSED

Beginning basic-flip-vs-wf_vblank on pipe C, connector VGA-1
  1024x768 60 1024 1048 1184 1344 768 771 777 806 0xa 0x40 65000

basic-flip-vs-wf_vblank on pipe C, connector VGA-1: PASSED

Beginning basic-flip-vs-wf_vblank on pipe A, connector HDMI-A-2
  1920x1080 60 1920 2008 2052 2200 1080 1084 1089 1125 0x5 0x48 148500

basic-flip-vs-wf_vblank on pipe A, connector HDMI-A-2: PASSED

Beginning basic-flip-vs-wf_vblank on pipe B, connector HDMI-A-2
  1920x1080 60 1920 2008 2052 2200 1080 1084 1089 1125 0x5 0x48 148500

basic-flip-vs-wf_vblank on pipe B, connector HDMI-A-2: PASSED

Beginning basic-flip-vs-wf_vblank on pipe C, connector HDMI-A-2
  1920x1080 60 1920 2008 2052 2200 1080 1084 1089 1125 0x5 0x48 148500

basic-flip-vs-wf_vblank on pipe C, connector HDMI-A-2: PASSED

Subtest basic-flip-vs-wf_vblank: SUCCESS (16.595s)


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.