summaryrefslogtreecommitdiff
path: root/tests/kms_vblank.c
AgeCommit message (Collapse)Author
2019-04-10igt: tests: kms_vblank: Stop using magic valueStanislav Lisovskiy
Lot of tests fail, when assertion checking how many vblanks should have passed during suspend/resume is compared to magic value 150. At the same time even for failed cases, sometimes it is clearly visible that there were no issue - simply suspend took longer on that machine. If suspend took around 10 s and we get roughly 60 vblanks per second the value then should be around 600 and not 150. This change removes 150 magic value and starts to use calculation of what it is expected to be instead of being hardcoded. v2: Add possible error delta interval, where expected vblanks must lie, i.e: [estimated_vblanks - err, estimated_vblanks + err] v3: Made an error range for estimated vblanks a bit less strict. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104894 Signed-off-by: Stanislav Lisovskiy <stanislav.lisovskiy@intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-10-01igt: Require a display (KMS enabled) for KMS testsChris Wilson
Simple rule of thumb, if a kms_* test calls igt_display_init() in its global fixture, skip the entire test if the driver has disabled KMS. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Antonio Argenziano <antonio.argenziano@intel.com>
2018-09-05igt/kms_vblank: Exercise some EINVALChris Wilson
Feed some impossible garbage into drmWaitVblank and expect the kernel to report EINVAL. v2: Cancel the double negative of ~invalid_flags Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-08-31tests/kms_vblank: Test if we have functional rpm before testingChris Wilson
We want to test that provoking a vblank interrupt works correctly after waking up from runtime-pm. First though, we must wait for the device to enter runtime-suspend. If the device cannot, e.g. we haven't enabled the DMC firmware, the test should skip because our external requirements are not met. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107768 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Imre Deak <imre.deak@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com>
2018-07-17igt/kms_vblank: Check if hangs are allowedChris Wilson
Before running a hang test, check if we can inject a hang and expect recover to work. If we can't control a hang, skip the subtest. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-02-05tests/kms_vblank: Fix spurious test failure.Maarten Lankhorst
igt_system_suspend_autoresume() calls igt_require(), which isn't allowed to be called from a forked child. Run subtests directly from the test body, except when a forked test is requested. Changes since v1: - Fixed to actually compile.. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104783 Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-01-24kms_vblank: Remove teardown code from cleanup_crtcMaarten Lankhorst
New way of doing things is calling igt_display_reset() before any setup code. This way if the configuration stays the same, the initial modeset will be a noop. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-01-24kms_vblank: Add tests implemented in kms_flipMaarten Lankhorst
In kms_flip there are some tests for testing whether the vblank counter is monotonically increasing. Add these subtests to kms_vblank, where they belong. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-01-24tests/kms_flip: Move kms_flip.vblank-vs-hang to kms_vblank, v4.Maarten Lankhorst
There's no need to test this more than once. Add a NOHANG flag which can be used to specify that a subtest can not be run when hanging. If it's set on either the subtest or the mode, the -hang test for this combination will not be generated. Changes since v1: - Merge the patch that renamed HANG to NOHANG. - Rebase after 'reorganize subtests by type'. - Allow subtests to specify NOHANG too. Changes since v2: - Mark accuracy test with NOHANG, gpu reset disables interrupts, causing the test to fail. Changes since v3: - Rebase on top of subtest split changes. - Add nohang comment to accuracy test. (Daniel) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-01-24kms_vblank: Reorganize subtests by pipe, v2.Maarten Lankhorst
Changes since v1: - Move per-pipe subtests to its own function and fix indent. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-12-11igt/kms_vblank: To set a mode requires DRM_MASTERChris Wilson
Fixes: ba86514759c6 ("kms_vblank: Switch from using crtc0 statically to explicitly setting mode.") Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104208 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
2017-12-08tests/kms_vblank: Add test to ensure DRM_CAP_CRTC_IN_VBLANK_EVENT works ↵Maarten Lankhorst
correctly This was implemented correctly only on the atomic ioctl before, but it should really be working on all 3 ioctl's involved, so ensure we always set crtc_id correctly with a testcase. The following events are tested: - Pageflip with event. - Atomic commit with event. - wait_vblank ioctl with event. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-03-19igt/kms_vblank: Exercise contention of drmWaitVblankChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-01-31tests/kms_vblank: Add support for dynamic number of planesRobert Foss
Add changes reflecting the new support for dynamic number of planes per pipe. Signed-off-by: Robert Foss <robert.foss@collabora.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2017-01-05kms_vblank: Stop looking at output->valid.Maarten Lankhorst
Use the proper iterator macros to prevent ever having an invalid config. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-07-04kms_vblank: Switch from using crtc0 statically to explicitly setting mode.Robert Foss
Previously crtc0 was statically used for VBLANK tests, but that assumption is not valid for the VC4 platform. Instead we're now explicitly setting the mode. Also add support for testing all connected connectors during the same test. Signed-off-by: Robert Foss <robert.foss@collabora.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-14tests: Open any driverTomeu Vizoso
For those tests that now pass on drivers other than i915, call drm_open_driver_master with DRIVER_ANY. Also do so from igt_enable_connectors. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Daniel Stone <daniels@collabora.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-09-11convert drm_open_any*() calls to drm_open_driver*(DRIVER_INTEL) calls with cocciMicah Fedke
Apply the new API to all call sites within the test suite using the following semantic patch: // Semantic patch for replacing drm_open_any* with arch-specific drm_open_driver* calls @@ identifier i =~ "\bdrm_open_any\b"; @@ - i() + drm_open_driver(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_master\b"; @@ - i() + drm_open_driver_master(DRIVER_INTEL) @@ identifier i =~ "\bdrm_open_any_render\b"; @@ - i() + drm_open_driver_render(DRIVER_INTEL) @@ identifier i =~ "\b__drm_open_any\b"; @@ - i() + __drm_open_driver(DRIVER_INTEL) Signed-off-by: Micah Fedke <micah.fedke@collabora.co.uk> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-08-21lib: add a single include headerThomas Wood
Add a header that includes all the headers for the library. This allows reorganisation of the library without affecting programs using it and also simplifies the headers that need to be included to use the library. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-04-06igt/kms_vblank: Simple accuracy testChris Wilson
Queue 60 event to arrive at the same vblank from different points in time and make sure it just works. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-04-02igt/kms_vblank: Include a test for comparing blocking drmWaitVblankChris Wilson
The other aspect of the spinlock/interrupt on-off overhead is that when we wait for vblank it immediately turns off, and then we immediately turn it back on for the next wait. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-03-26igt.cocci: check the return values of various functionsThomas Wood
Add rules to fix unused-result warnings when compiling with _FORTIFY_SOURCE defined and apply them to the library and tests. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-03-19igt/kms_vblank: Simple harness for measuring speed of drmWaitVBlankChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>