summaryrefslogtreecommitdiff
path: root/tests/kms_flip.c
AgeCommit message (Collapse)Author
2016-06-22tests/kms_flip: Check that the last vs. current seq/ts are consistentVille Syrjälä
Let's make sure the ts vs. seq difference between the current and last events match. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-06-22tests/kms_flip: Print the expected diff between two eventsVille Syrjälä
To aid in diagnosing failures, print out the expected time difference between the two events. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-06-22tests/kms_flip: Account for diff.tv_secs in jitter checkVille Syrjälä
Include diff.tv_secs in the jitter comparison. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-06-22tests/kms_flip: Use USEC_PER_SECVille Syrjälä
Replace some opencoded numbers with USEC_PER_SEC, and print the usec_diff with 6 decimal digits to make things more consistent. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-06-22tests/kms_flip: Constify some function argumentsVille Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-06-22tests/kms_flip: Print timestamps in a consistent formVille Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-05-16tests/kms_flip: Adjust tolerance when counting framesFeceoru, Gabriel
basic-flip-vs-wf_vblank subtest sometimes fails asserting counted frames to be aproximately equal with the estimated number. This is a false negative, one of the reasons being the precision lost when truncating a fractional number. Fixed this by using floating point arithmetic. Cc: Jani Nikula <jani.nikula@intel.com> Cc: Daniel Vetter <daniel.vetter@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95380 [mvlad] Signed-off-by: Gabriel Feceoru <gabriel.feceoru@intel.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-25tests/kms_flip: Open DRM device with DRIVER_ANYTomeu Vizoso
So that this test can be run in drivers other than i915. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-04-25tests/kms_flip: Move bufmgr requirement into subtestsTomeu Vizoso
Because bufmgr is currently a i915-only thing and it's only needed in a subset of the subtests, require it only in the subtests that actually need it so that the other subtests aren't skipped without a reason. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-04-25tests/kms_flip: Create tiled BOs only when neededTomeu Vizoso
Because attempts to create a tiled BO will cause a igt_require call to fail on drivers that don't support tiling, do so in the subtest that actually needs it so that other subtests aren't skipped without reason. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-04-25kms_flip: Shorten basic tests a bitTvrtko Ursulin
Seems like an overkill for a basic test to keep flipping for a full minute. Dial it down a bit. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-04-09igt/kms_flip: Convert over to real hang injectionChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-01-08tests/kms_flip: Increase TEST_TS_CONT max seq difference to 150Ville Syrjälä
During suspend tests we can exceed the current 100 frame difference in sequence numbers. Bump the limit to 150 frames. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2016-01-08Fix a bunch of printf typesVille Syrjälä
igt_kms.c: In function ‘igt_crtc_set_background’: igt_kms.c:1940:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 5 has type ‘uint64_t’ [-Wformat=] LOG(display, "%s.%d: crtc_set_background(%lu)\n", ^ intel_firmware_decode.c: In function ‘csr_open’: intel_firmware_decode.c:169:2: warning: format ‘%zd’ expects argument of type ‘signed size_t’, but argument 3 has type ‘__off_t’ [-Wformat=] printf("Firmware: %s (%zd bytes)\n", filename, st.st_size); ^ intel_gpu_top.c: In function ‘main’: intel_gpu_top.c:683:10: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 3 has type ‘uint64_t’ [-Wformat=] stats[i] - last_stats[i]); ^ hsw_compute_wrpll.c: In function ‘main’: hsw_compute_wrpll.c:644:3: warning: format ‘%li’ expects argument of type ‘long int’, but argument 7 has type ‘long long int’ [-Wformat=] igt_fail_on_f(ref->r2 != r2 || ref->n2 != n2 || ref->p != p, ^ gem_gtt_hog.c: In function ‘__real_main155’: gem_gtt_hog.c:177:2: warning: format ‘%lu’ expects argument of type ‘long unsigned int’, but argument 4 has type ‘unsigned int’ [-Wformat=] igt_info("Time to execute %lu children: %7.3fms\n", ^ kms_flip.c: In function ‘run_test_step’: kms_flip.c:985:3: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 10 has type ‘__time_t’ [-Wformat=] igt_assert_f(end - start > 0.9 * frame_time(o) && ^ kms_flip.c:985:3: warning: format ‘%u’ expects argument of type ‘unsigned int’, but argument 11 has type ‘__suseconds_t’ [-Wformat=] kms_frontbuffer_tracking.c: In function ‘setup_sink_crc’: kms_frontbuffer_tracking.c:1364:3: warning: format ‘%ld’ expects argument of type ‘long int’, but argument 4 has type ‘ssize_t’ [-Wformat=] igt_info("Unexpected sink CRC error, rc=:%ld errno:%d %s\n", ^ Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-12-04lib/kms+tests: Use cached connector stateDaniel Vetter
Speeds up testcases except for those where we want to exercise the probing itself. The only exceptions left where we do a full probe are - pm_rpm: We use it to make sure the kernel doesn't get things wrong with power domains, so we really want to exercise the full probe paths. And there the only place really is the specific validation done with the data gathered by get_drm_info. - kmstest_force_ functions: Newer kernels should be better at re-probing state when the force sysfs fields change, but better safe than sorry. v2: I also consolidated the start_n_modes and start_connectors while at it - move one of the fixup hunks to this patch that accidentally got misplaced (Thomas). Cc: Thomas Wood <thomas.wood@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-11-27lib/igt_fb: also pass the stride to igt_create_fb_with_bo_size()Paulo Zanoni
If the caller is going to specify a custom size, it's likely that he will also specify a custom stride. The automatic stride picked by create_bo_for_fb() is too huge for tiled buffers, so if the caller wants smaller buffers, then he'll need a smaller stride too, otherwise the Kernel will reject the addfb IOCTL due to stride * height being bigger than the size. I want to make tests/kms_frontbuffer_tracking use igt_create_fb_with_bo_size() so I can provide smaller buffers that will fit into the CFB. I'm also planning to make all frontbuffers with the same width/height/format have the same stride and size regardless of tiling method so I can exercise specific code paths. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-11-16tests/kms_flip: Add a note that the test was skipped when modeset failsVille Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16tests/kms_flip: Modeset pipes in reverse orderVille Syrjälä
To make more multi-pipe tests run on IVB, do the modesets in the reverse order (ie. pipe C first, pipe A last). This way pipe B can't reserve the 2 shared FDI lanes before pipe C is set up. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16tests/kms_flip: Disable all pipes before each testVille Syrjälä
Currently kms_flip leaks the state of the pipes from one subtest to the next. Meaning a single pipe test can actually have two or more pipes actually up and running, and similarly a two pipe test can have three pipes running. This is particularly nasty on IVB since one of the pipes still running but not actually part of the test maybe have reserved the shared FDI lanes, thus preventing one of the pipes taking part in the test from being enabled. To avoid such problems explicitly disable all pipes before each subtests. v2: Use kmstest_unset_all_crtcs() (Paulo) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-11-16tests/kms_flip: Use human readable pipe and connector namesVille Syrjälä
Print the pipes and connectors in a human readable form instead of using the integer IDs. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-10-23tests/kms_flip: Dump the timestamps, counters, etc. with higher debug levelsVille Syrjälä
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2015-10-23tests/kms_flip: Improve the accuracy of out frame time calculationVille Syrjälä
Don't use the rounded vrefresh info to predict the frame duration. Instead calculate if from the clock. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
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-08-14tests/kms_flip: add basic tests for flip, flip vs dpms, and flip modeset v2Jesse Barnes
Simple variants that don't do multiple output or interruptible testing. v2: add vblank variant, remove duplication (Daniel) Reviewed-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-08-12lib/core: Add igt_reset_timeoutDaniel Vetter
Convenience wrapper suggested by Chris for igt_set_timeout(0, NULL). v2: While at it add an empty line in kms_flip to make set/reset_timeout a visual block. Cc: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-08-12lib/core: Add optional reason for timeout failureDaniel Vetter
"Timed out" isn't a terribly informative message, allow users to set something more informative. Inspired by a request from Jesse. Cc: Jesse Barnes <jbarnes@virtuousgeek.org> Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-03-12tiling: Convert framebuffer helpers to use fb modifiersTvrtko Ursulin
This converts the IGT API only, underneath legacy set_tiling is still used. v2: One got away in kms_flip. Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-03-06igt.cocci: Replace igt_assert() with igt_assert_CMP() where possibleMatt Roper
The integer comparison macros give us better error output by including the actual values that failed the comparison. Signed-off-by: Matt Roper <matthew.d.roper@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-27lib/igt_kms.c: igt_require -> igt_require_f("two displays required\n")Marc Herbert
The bare "Test requirement: modes" message is too cryptic, I had to go and read the source code to understand the missing requirement. Signed-off-by: Marc Herbert <marc.herbert@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13lib/igt_gt: Document and consolidateDaniel Vetter
Also move forcewake and stop_rings code from igt_debugfs to igt_gt since it fits better. And move the hang injection fork helpers from igt_aux to igt_gt, too. Also push the intel_gen call into igt_hang_ring while at it. Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-02-13lib/igt_aux: s/swap/igt_swap/Daniel Vetter
It collides with the subtest naming convention glossary entry for swap. Which makes the docbook xml stuff unhappy. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-02-13tests: Align subtest with naming conventionDaniel Vetter
Yeah, historically grown but we should try to be somewhat consistent. It helps with filtering testcases. Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2015-01-06Solaris needs to #include <sys/kd.h> instead of <linux/kd.h>Alan Coopersmith
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-12-08tests/kms_flip: Target the back buffer with the dummy loadVille Syrjälä
Aim the dummy load to the current back buffer instead if the front buffer. Assuming the idea is to get the next flip to be stuck behind the dummy load? Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-12-08tests/kms_flip: Calibrate the dummy load delay in kms_flipVille Syrjälä
Try to tune the dummy load to ~1 second. The calibration happens the first time dummy load is generated. v2: Actually do the number of ops intended and calibrate to 1 second and not 2 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-12-08tests/kms_flip: Use fixed size (2kx2k) buffers for dummy loadVille Syrjälä
Make the dummy load independent of the display resolution by using a two fixed size dummy bos to generate the load. As a final step do another copy from one of the dummy bos to the fb to make sure there's a dependency between the dummy load and any subsequent operation on the fb. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-12-08tests/kms_flip: Refactor blit codeVille Syrjälä
Pull the code to emit a single blit to a separate function. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-12-08tests: Run lib/igt.cocciVille Syrjälä
Found some open coded min()/max()/swap() macros. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-12-01tests/kms_flip: Fix assert about vblank wait durationVille Syrjälä
If we wait for one vblank, we may end up returning almost immediately, so trying to assert anything but >0 about the minimum duration is bogus. Instead wait for two vblanks and then we can assert that we should have be blocked for at least one frame. And move the upper bound to a little over two frames to match. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79050 Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2014-11-13tests/kms_flip: add a timeout for the nonblocking-read testThomas Wood
kms_flip/nonblocking-read will block indefinitely if it fails, so introduce a timeout to indicate test failure. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=85718 Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-06tests: use igt_debugfs where possibleThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-24tests/kms_flip: Make flip-vs-panning-vs-hang change DSPSURFVille Syrjälä
Make sure DSPSURF will change during the panning operation in flip-vs-panning-vs-hang. This will now test agains bugs between the kernel's mmio vs. CS flip race handling and GPU resets. If the kernel is buggy if will fail to notice that the panning operation changed the base address before the GPU reset had a chance to deal with the pending page flips, and so the flip would never complete due to DSPSURFLIVE not matching the expected value. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-10-17lib: add common min and max macrosThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-10-08igt/kms_flip/nonblocking_read: Demonstrate that O_NONBLOCK is a mythChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-09-30lib: add a function to indicate activityThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-09-30test/kms, pm: use drm_open_any_masterImre Deak
These tests require DRM master right, so make sure they have it from the beginning. This gives an early indication if another DRM master is running and makes the given test skip (with a proper explanation of the reason) instead of exiting with error. Signed-off-by: Imre Deak <imre.deak@intel.com>
2014-08-30batch: Specify number of relocations to accommodateChris Wilson
Since relocations are variable size, depending upon generation, it is easier to handle the resizing of the batch request inside the BEGIN_BATCH macro. This still leaves us with having to resize commands in a few places - which still need adaption for gen8+. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-29Prepare for 64bit relocation addressesChris Wilson
This reveal that quite a few locations were writing relocation offsets but only allowing for 32 bit addresses. To reveal such places in active tests, we also now double check that we do not use more batch space than declared. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-08-21kms_flip: Adjust to the new igt_create_fb*() APIDamien Lespiau
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>