summaryrefslogtreecommitdiff
path: root/tests/kms_flip.c
AgeCommit message (Collapse)Author
2018-10-04igt: Check drmModeGetResources()Chris Wilson
If KMS is not supported on the device, drmModeGetResources() will return NULL, often this is an indication that we should not attempt to run the test. Although it would be preferred to use something like igt_require_display() as the canonical check and assert that drmModeGetResources() did not hit an error, it is not always practical as the tests do not utilize the common igt_display abstraction. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2018-10-03lib/kms: Handle no connectors for igt_enable_connectors()Chris Wilson
Take the device fd from the caller as to which card we should try and enable connectors for (or else we may not enable the right connectors for the test!) and fail gracefully if there is no kms support on the device. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2018-09-27lib/igt_fb: Pass around igt_fb internallyVille Syrjälä
Instead of passing around a boatload of integers everywhere let's just pass around the igt_fb struct. That obviously means we have to populate it first sufficiently, to which end we'll add a small helper. Later on the stride/size calculations will consult the already pre-populated igt_fb and fill in the rest as needed. This makes the whole thing a lot less error prone as it's impossible to accidentally pass the arguments in the wrong order when there's just the one of them, and it's a pointer. v2: Rebase due to uint64_t size Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2018-07-13tests/kms_flip: Print timevals as floatVille Syrjälä
Time intervals as produced by timersub() are normalized to have the tv_usec in the range 0-999999. That leads to very confusing looking debug output for negative interval. Eg. an interval of -0.1 seconds would be represented as tv_sec=-1, tv_usec=900000. Let's just convert the thing to a float seconds value and print that so that we'll get less confusing debug output. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-02-12tests: Always call igt_remove_fb without checking.Maarten Lankhorst
This cleans up the tests slightly. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com> Tested-by: Vidya Srinivas <vidya.srinivas@intel.com>
2018-02-01lib/igt_fb: Add igt_put_cairo_ctx as counter to igt_get_cairo_ctxMaarten Lankhorst
This will allow support for NV12 in the future, where igt_get_cairo_ctx will return a RGB image to draw with, which will be converted in igt_put_cairo_ctx so tests don't have to add special support for NV12. This is the same as cairo_destroy + checking for errors, but not all tests use this correctly so it's better to have a single handler for it. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-01-24kms_flip: Remove redundant vblank tests.Maarten Lankhorst
wf_vblank is redundant with wf_vblank-ts-check, which also performs a check but runs in the same way. The -EINVAL vblank tests are reproduced in kms_vblank, as are the vblank-vs-* tests. 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-24tests/kms_flip: Remove blt/rcs flip tests.Maarten Lankhorst
With the removal of mmio flips, blt and rcs flips are no longer different from doing busy testing in kms_busy. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-01-04igt/kms_flip: Do igt_require_gem() just onceChris Wilson
Since igt_spin_batch_new() will do a stalling GEM check, it is not advisable to use it within loops. Perform the igt_require_gem() upfront and then use __igt_spin_batch_new() inside the test loop. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
2017-12-12igt/kms_flip: Allow very large bo to fail pageflips with E2BIGChris Wilson
We tried to allow very large buffers (larger than the mappable aperture) to be flippable by allowing them to be bound into the unmappable region. Sadly, not all of our hw is capable of utilising the unmappable region for scanout (and on some older hw, there is only mappable). As such, we have to allow the very large bo to either succeed in being flipped, or fail with the expected E2BIG. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100917 References: 9d5e393da3f5 ("igt/kms_flip: There's no such thing as bo-too-big") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2017-11-15Revert "tests/kms_flip: Make flip-vs-panning-vs-hang change DSPSURF"Maarten Lankhorst
This reverts commit 7296e09ee7f17e6d564e52cf64ee900670849429. This commit was accidentally applied twice, the first time in commit e4ba3b75e6de35483b2edea21ceda145ef0b3311. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> CC: Daniel Vetter <daniel.vetter@ffwll.ch> #irc
2017-10-18tests: Clean up igt_skip_on_simulation() usesArkadiusz Hiler
General update to reflect current state of things. Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2017-09-08build: Nuke #ifdef HAVE_CONFIG_H cargo-cultDaniel Vetter
We have it. Daniel Stone said the #ifdef HAVE_CONFIG_H comes from the X11 transition to the modular build, where in the imake -> modular build transition config.h wasn't universally available. Now we just make this a requirement (so yeah Android better generate one too). v2: Improve commit message a bit. Reviewed-by: Eric Anholt <eric@anholt.net> Acked-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com> Acked-by: Daniel Stone <daniels@collabora.com> Acked-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-09-07igt/gem_exec_schedule: Basic tests for preemptionChris Wilson
We queue N low priority hanging batches across the engines and check that our high priority write over takes them. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Michał Winiarski <michal.winiarski@intel.com>
2017-08-15tests/kms_flip: fix spin_batch conversionDaniel Vetter
The goal of these subtests was just to delay a kms operation a little bit. The goal wasn't to - spin until the operation was completed. That results in a gpu hang, and gpu hangs need igt_hang for safety. - complete it before the operation. That's just pointless. Fix it by using the timeout support. This was all broken in the initial conversation: commit 96ec8cb3b5ec1fc2927d6cff8e09930082301d7e Author: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Date: Sat Oct 29 01:01:05 2016 +0300 igt/kms_flip: Use new igt_spin_batch Note that part of the damage was removed already in commit b0081ea9cb7d39234fd0fcc64dd56ed4f5d50b05 Author: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Date: Wed Aug 9 11:11:52 2017 +0200 tests/kms_flip: Remove $engine-flip-vs-dpms/modeset But this patch also made things worse, because it remove code that wasn't dead yet (because it didn't remove all the dpms vs spinning batch tests). v2: Augment commit message and use macro for 1s-in-ns. Cc: Tomeu Vizoso <tomeu.vizoso@collabora.com> Cc: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-08-14tests/kms_flip: Remove $engine-flip-vs-dpms/modesetMaarten Lankhorst
This is already tested in kms_busy, and without cs flips there's no point in doing those tests any more. The removed tests were broken and caused GPU hangs because the spin batch was not unblocked correctly. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-07-07tests/kms_flip: Make panning tests actually pan all the timeVille Syrjälä
Currently the panning tests actually stop panning when they hit the right edge fo the framebuffer. Let's make them ping-pong across the fb to make it clear that they are indeed trying to pan around all the time. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2017-06-20tests/kms_flip: degrade warn to debugMaarten Lankhorst
This is explicitly tested in kms_setmode.basic Suggested-by: Chris Wilson <chris@chris-wilson.co.uk> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2017-04-07tests/kms_*: Use correct DRM context versionDaniel Stone
DRM_EVENT_CONTEXT_VERSION is the latest context version supported by whatever version of libdrm is present. igt was blindly asserting it supported whatever version that may be, even if it actually didn't. With libdrm 2.4.78, setting a higher context version than 2 will attempt to call the page_flip_handler2 vfunc if it was non-NULL, which being a random chunk of stack memory, it might well have been. Set the version as 2, which should be bumped only with the appropriate version checks. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2017-02-08kms_flip: Handle EINTR in poll call for -interruptible tests.Maarten Lankhorst
This fixes the following failure in kms_flip: (kms_flip:12099) CRITICAL: Test assertion failure function calibrate_ts, file kms_flip.c:1190: (kms_flip:12099) CRITICAL: Failed assertion: poll(&(struct pollfd){drm_fd, POLLIN}, 1, -1) == 1 (kms_flip:12099) CRITICAL: Last errno: 4, Interrupted system call Stack trace: #0 [__igt_fail_assert+0xf1] #1 [run_test_on_crtc_set.constprop.13+0x18f3] #2 [run_pair+0x31f] #3 [main+0x463] #4 [__libc_start_main+0xf0] #5 [_start+0x29] #6 [<unknown>+0x29] Subtest 2x-plain-flip-ts-check-interruptible failed. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99651 Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
2016-12-06igt/kms_flip: Poll before reading from nonblocking drm_fdChris Wilson
If we run the full testsuite, the drm_fd is set to nonblocking - so we have to explicitly wait using poll rather than rely on a blocking read for the vblank event. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-12-06igt/kms_flip.c: Fix timings checkDorota Czaplejewicz
Adjust the description and constants in the timing check to match each other. Relax the timing constraint to prevent false positives in vblank interval checking.
2016-12-01igt/kms_flip: Fix set_dpms called with an idle boAbdiel Janulgue
Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-29igt/kms_flip: Use new igt_spin_batchAbdiel Janulgue
v7: Reuse NSEC_PER_SEC defines v8: Don't wait on the fb, it must be busy. Exit the spin batch when flip is queued (Chris Wilson) v10: Adapt to api rename Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Signed-off-by: Abdiel Janulgue <abdiel.janulgue@linux.intel.com>
2016-11-10lib: Pass tiling constant where that's expectedTomeu Vizoso
We were passing in two places a framebuffer modifier constant instead of a tiling constant. Also adds igt_fb_mod_to_tiling so tests can do that by themselves. Cc: Tvrtko Ursulin <tursulin@ursulin.net> Fixes: 8a1a38661f56 ("lib: Add igt_create_bo_with_dimensions") Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2016-11-02igt/kms_flip: Use the computed vblank interval for TS checkingChris Wilson
Since the modeline may differ from actual hardware timings, do not rely upon it but instead measure the actual and verify that it does not change across the various flip/vblank configurations. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-11-02igt/kms_flip: Mark frame_time() as coming from the modeChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-24igt/kms_flip: Calibrate timestamp errorsChris Wilson
We assert that the interval between a vblank and a flip corresponds with the computed frametime derived from the modeline. However, historically the dotclock is unreliable (in error of about 1%) for VBT supplied data about LVDS panels - the situation looks to be much improved with eDP at least. The simple fact that we cannot rely on the manufacturer's supplied modeline causes us to fail the test. So before we claim a driver failure, do a calibration pass and check for inconsistencies with the modeline. v2: Refine the failure message when skipping Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-22igt/kms_flip: Print more information to debug for flip timing checksChris Wilson
We have a cantiga that doesn't pass igt@kms_flip@basic-flip-vs-wf_vblank, and so knowing why is off the upmost priority! Before the assertions print the values we are about to test in greater detail. References: https://bugs.freedesktop.org/show_bug.cgi?id=98352 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-10-13lib/igt_aux: Add support for various system suspend/resume optionsImre Deak
To have a more accurate idea about any suspend/resume issues we can perform the s/r until various phases in the s/r sequence. This way we can isolate the given problem as being a device driver, kernel core or BIOS related issue. Actual subtests using these new s/r phases will be added as follow-up. While at it also add the freeze suspend target, it's something we also would need to test. Signed-off-by: Imre Deak <imre.deak@intel.com>
2016-09-13igt/gem_busy: Prevent banning when running multiple hang testsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-08-26igt/kms_flip: There's no such thing as bo-too-bigChris Wilson
Since we can now use the entire global GTT for display, we can handle framebuffers that no longer fit into the mappable aperture. Update the kms_flip/bo-too-big expectations. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=97502 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-07-04kms_flip: Change __wait_for_vblank to use helper function.Robert Foss
Change __wait_for_vblank() to use kmstest_get_vbl_flag() helper function. Signed-off-by: Robert Foss <robert.foss@collabora.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
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>