summaryrefslogtreecommitdiff
path: root/tests
AgeCommit message (Collapse)Author
2018-09-11lib: Add roundup_power_of_two()Ville Syrjälä
Add a helper to round a value to the next power of two size. And since we need fls() to implement that, reuse that elsewhere as well. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-09-11lib/igt_fb: Make fb size 64bitVille Syrjälä
Switch all fb size handling to 64bits to accomodate >4GiB framebuffers. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-09-11Fix 32bit gcc warningsVille Syrjälä
../tests/eviction_common.c:158:13: warning: format ‘%llu’ expects argument of type ‘long long unsigned int’, but argument 4 has type ‘size_t’ {aka ‘unsigned int’} [-Wformat=] etc. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-09-10igt/gem_exec_capture: Fix command emission for gen3Chris Wilson
A missing no-op causing us to emit the wrong address when relocation was required for BB_START. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106028 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106078 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
2018-09-07igt/pm_backlight: Make the actual_brightness test readableChris Wilson
Previous horror (pm_backlight:2947) CRITICAL: Test assertion failure function test_and_verify, file ../tests/pm_backlight.c:112: (pm_backlight:2947) CRITICAL: Failed assertion: ({ typeof(0) _a = (0); typeof(val - tolerance) _b = (val - tolerance); _a > _b ? _a : _b; }) <= result (pm_backlight:2947) CRITICAL: error: 7125 > 0 References: https://bugs.freedesktop.org/show_bug.cgi?id=107847 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-09-06tests/gem_ctx_isoation: Add warn for newer gens.Antonio Argenziano
Add a warning to update test if GEN version is not recognized. Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-09-06igt/kms_addfb_basic: Exercise legacy interface to addfb2Chris Wilson
The legacy interface passes in a single handle, and instead of providing the pixel_format fourcc, passes in a bpp/depth combination that the kernel translates into a fourcc. If that is an illegal combination, the kernel should be reporting EINVAL rather than pass an unknown framebuffer to the drivers. As the number of possible permutations of bpp/depth (both are strictly u32 parameters) is huge, we simply fuzz the interface for 1s. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-09-06tests/kms_rotation_crc: Fix bad-pixel-format not to be run on gen11 and laterJuha-Pekka Heikkila
gen11 enables 90/270 rotation for RGB565 mode. IGT would need support for C8 mode to enable running this subtest on gen11 and later. v2 (Mika Kahola): Combine gen checks into one comparison. Update comment on why bad-pixel-format is disabled beyond gen11. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2018-09-06tests/kms_plane_scaling: Allow DRM_FORMAT_RGB565 rotation on gen>=11Juha-Pekka Heikkila
Test DRM_FORMAT_RGB565 rotation when gen is 11 or higher. Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com> Reviewed-by: Mika Kahola <mika.kahola@intel.com>
2018-09-05tests/fbcon_fbt: Enable PSR1 via debugfsDhinakaran Pandiyan
Test only PSR1 on PSR2 panels by making use of the debugfs toggle. Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2018-09-05tests/psr: Test PSR1 in kms_psrDhinakaran Pandiyan
The tests we have work only with PSR1, but setting the module parameter enable_psr enables PSR2 if the panel supports it. Make use of the newly added debugfs toggle to enable only PSR1 when testing. Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2018-09-05tests/fbcon_fbt: Avoid opening debugfs dir repeatedlyDhinakaran Pandiyan
Make use of igt_debugfs_simple_read() to open debugfs dir just once. v2: Renamed function parameters s/fd/debugfs_fd (Jose) Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2018-09-05tests/psr: Avoid opening of already open debugfs dirDhinakaran Pandiyan
The tests calls igt_debugfs_dir() to open the debugfs dir and further along calls igt_debugfs_read() each time i915_edp_psr_status needs to be read. As igt_debugfs_read() opens the directory unnecessarily, switch to using the newly added igt_debugfs_simple_read() v2: Commit message typo (Jose) Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2018-09-05lib/debugfs: Function to read debugfs with the directory already openDhinakaran Pandiyan
tests/kms_frontbuffer_tracking and tests/kms_psr read debugfs nodes several times after opening the directory once. There is already an implementation of this in the kms_frontbuffer_tracking, moving that functionality to the library will allow us to share the code with kms_psr and kms_fbcon_fbt Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
2018-09-05igt/pm_backlight: Skip if pm is not supportedChris Wilson
If we cannot do runtime suspend, testing it's impact on the backlight is moot. Simply skip on systems that cannot runtime suspend. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107789 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107790 Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107794 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-09-05igt/pm_backlight: Require a connected output for the backlightChris Wilson
We cannot control the backlight if its attached output is not connected. Don't assert, but require. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@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-09-04igt/pm_rpm: Reload the module with full mmio debuggingChris Wilson
Our unclaimed mmio access debugging is lazy, doing cheap checks periodically and only if they fail do a full check around every mmio access. When testing for runtime pm, enable the full mmio debugging from the initial load. 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-09-04igt/pm_rps: Clear previous high load on high->low transitionChris Wilson
Make sure we do flush out the previous spinner and delay signaling transition completion until we do. References: https://bugs.freedesktop.org/show_bug.cgi?id=102250 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Katarzyna Dec <katarzyna.dec@intel.com> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
2018-09-04igt/pm_rps: Wait for the load-helper to signal receipt of commandChris Wilson
Actually wait for the load-helper to complete it switch over to the new load by using a pipe(22) between the two. References: https://bugs.freedesktop.org/show_bug.cgi?id=102250 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Katarzyna Dec <katarzyna.dec@intel.com>
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-08-31tests/pm_backlight.c : Brightness test with DPMS and System suspend.Jyoti
BIOS programs few of PWM related registers during initial boot. But during System suspend those registers are cleared. This test aim to check whether display programs those registers properly after system resume. Also checks brightness programming during DPMS ON/OFF cycle to check backlight programming is done properly from display side. v2 : Optimize the code to avoid code redundancy. (Rodrigo) Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
2018-08-31igt/perf_pmu: Improve the presentation of the accuracy calibrationChris Wilson
Normalize the variance to stddev, and remove some redundant steps in computing the time from itself. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-08-31igt/perf_pmu: Aim for a fixed number of iterations for calibrating accuracyChris Wilson
Our observation is that the systematic error is proportional to the number of iterations we perform; the suspicion is that it directly correlates with the number of sleeps. Reduce the number of iterations, to try and keep the error in check. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
2018-08-30tests/kms_frontbuffer_tracking: Don't unset mode after reading CRCMaarten Lankhorst
Until the previous commit we had to disable the mode after reading CRC because otherwise we might not have been enable features correctly. Now we can just stage the disable without applying it, so each subtest can set its desired mode and igt_display will update the state as required. Behavior with legacy PSR: - Modeset enable, read CRC, enable legacy PSR switch, disable CRTC if using legacy PSR by calling igt_display_commit. Next enable CRTC will enable PSR. Behavior with debugfs PSR: - Modeset enable - Read CRC - Enable debugfs PSR switch. PSR enabled. - Next commit will be done by test, which can disable the mode or set a mode. The latter case will be a compatible mode, in which case we avoid the modeset. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
2018-08-30tests/kms_frontbuffer_tracking: Remove redundant modesets for toggling ↵Maarten Lankhorst
features, v5. Disabling PSR and FBC used to require a commit, but now that changes to FBC take effect after the next commit, and PSR is toggled through debugfs we can skip those modesets. Changes since v1: - Try to avoid modesets for PSR if the kernel supports it, but otherwise force a modeset for the changes to take effect. Changes since v2: - Rebase on top of previous PSR changes. Changes since v3: - Rebase on move to lib/igt_psr. Changes since v4: - Split out related changes. (dhnkrn) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
2018-08-30tests/kms_frontbuffer_tracking: Attempt to enable both screens simultaneously.Maarten Lankhorst
This might save a modeset when the second screen is disabled in the first step, and re-enabled when enabling the secondary screen. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
2018-08-30lib/psr: Add support for toggling edp psr through debugfs, v5.Maarten Lankhorst
It's harmful to write to enable_psr at runtime, and the patch that allows us to change i915_edp_psr_debug with the panel running will require us to abandon the module parameter. Hence the userspace change needs to be put in IGT first before we can change it at kernel time. Toggling it to debugfs will mean we can skip a modeset when changing our feature set. Changes since v1: - Rebase with the previous patches dropped. Changes since v2: - Rebase on top of new api in i915_edp_psr_debug. Changes since v3: - Enable IRQ debugging for extra logging. - Force PSR1 mode. (dhnkrn) - Move PSR enable/disable functions to lib/igt_psr. (dhnkrn) Changes since v4: - Redisable irqs right away when debugfs api doesn't work. (dhnkrn) - Use hex everywhere. (dhnkrn) Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> [mlankhorst: Fix -ENODEV explanation in has_psr_debugfs (dhnkrn)] Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
2018-08-28tests/gem_render_copy: Fix clipped heightVille Syrjälä
Assign the clipped height to 'h', not 'w'. This didn't cause any problems so far because we use square buffers. Also get rid of the gcc variable shadowing warnings by not nesting the min()/max(). Fixes: aaa23eff21a1 ("tests/gem_render_copy: Use a more elaborate pattern of pixels") Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
2018-08-23gem_storedw_loop: Remove unused variableAntonio Argenziano
'long-*' subtests didn't make any sense now so removed those as well. Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-08-21tests/kms_cursor_crc: Open DRM device with DRIVER_ANYHaneen Mohammed
So that this test can be run in drivers other than i915. Remove devid and only check it if the driver is i915. Signed-off-by: Haneen Mohammed <hamohammed.sa@gmail.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2018-08-20pm_rpm: Require DMC loaded before testing runtime_pm for gen9+Rodrigo Vivi
Since we block runtime PM if DMC is not loaded, let's skip the test. v2: Use i915_dmc_info presence to detect dmc requirement instead of gen check as Chris suggested. v3: Add missing \0 before using buf. (Chris) v4: read only 14 bytes [0:13] so buf[len] is the 15th position. Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Imre Deak <imre.deak@intel.com> Cc: Anusha Srivatsa <anusha.srivatsa@intel.com> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-08-16igt/pm_rpm: Skip counting modes if modprobed with disable_displayChris Wilson
If we've explicitly disabled the display, we will never find any connected outputs or modes. Checking for them will fail and report the missing requirement instead. v2: Sigh, avoid more comparisons against enabled displays v3: Try occasionally compiling patches 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-08-16igt/pm_rpm: Include igt_device.hChris Wilson
../tests/pm_rpm.c: In function ‘setup_environment’: ../tests/pm_rpm.c:702:2: warning: implicit declaration of function ‘igt_device_set_master’; did you mean ‘pci_device_cfg_write’? [-Wimplicit-function-declaration] igt_device_set_master(drm_fd); Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Imre Deak <imre.deak@intel.com>
2018-08-16intel-ci: Exclude pm_rpm module-reload from full testingChris Wilson
The pm_rpm module-reload exists to exercise a rpm wakeref leak, and affects the random selection of tests run after it. Similar to the normal module-reload tests, care must be taken in its execution to avoid causing spurious failures elsewhere. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Petri Latvala <petri.latvala@intel.com>
2018-08-16igt/pm_rpm: Avoid at_exit_drm_fdChris Wilson
Keep the drm_fd owned by pm_rpm as we need to relinquish all ownership of the device in order to unload the module. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Imre Deak <imre.deak@intel.com>
2018-08-16igt/pm_rpm: Close local fd before trying to unload moduleChris Wilson
Make sure everything we open in setup_environment() is paired to teardown_environment(). Fixes: d8e78990aa2b ("igt/pm_rpm: Test reaquisition of runtime-pm after module reload") Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Imre Deak <imre.deak@intel.com>
2018-08-15igt/gem_ctx_switch: Show the combined ctx-switch latencyChris Wilson
Since we submit from several processes to the same engine for the forked tests, the total number of context switches is the sum of each process and needs to be combined together to compute the individual cs latency. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-08-14igt/pm_rpm: Test reaquisition of runtime-pm after module reloadChris Wilson
It doesn't work right now and desperately needs to be fixed... Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Imre Deak <imre.deak@intel.com>
2018-08-14igt/pm_rpm: Test incomplete(debug) suspends vs rpmChris Wilson
Check that we restore runtime pm around debug suspends and hibernates. v2: Differentiate between external test setup failure and one of interest v3: Keep basic-rte failing instead of skipping. 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-08-14tests: Replace calls to igt_pipe_crc_drain + get_single with ↵Maarten Lankhorst
igt_pipe_crc_get_current() This is a more race free of accomplishing the same. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2018-08-13meson: Define all the rpath_dirs in one placeArkadiusz Hiler
So they are located close to the definitions of the corresponding install_dirs and can be reused easily. Cc: Petri Latvala <petri.latvala@intel.com> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Petri Latvala <petri.latvala@intel.com>
2018-08-10intel-ci: Skip module reloadsChris Wilson
Reloading the module may impact subsequent tests by destabilising the system. As we do for BAT, if we want to test reloads, it should be handled explicitly at the end of the run, rather than placed at random in the middle of the test list. v2: Commentary References: https://bugs.freedesktop.org/show_bug.cgi?id=106539 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tomi Sarvela <tomi.p.sarvela@intel.com> Acked-by: Petri Latvala <petri.latvala@intel.com>
2018-08-10intel-ci: Comment on kernel selftest exclusionChris Wilson
The kernel selftests are excluded from the shard lists as those lists are compiled separately. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Petri Latvala <petri.latvala@intel.com>
2018-08-10tests/kms_force_connector_basic: Verify planes are restored after load ↵Maarten Lankhorst
detection, v2. There's a bug in our load detection in which we don't correctly restore planes to their previous states. Strictly verify this is the case by setting a fb on all planes. Changes since v1: - Remove igt_assert(found) in verification, would always fail. Cc: Ville Syrjala <ville.syrjala@linux.intel.com> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
2018-08-08igt/amd_prime: Link an amdgpu bo into i915 and try to shrink itChris Wilson
Create and export an amdgpu bo into i915 so that we can try and invalidate the i915_bo->pages from inside the shrinker, teaching lockdep about that linkage. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Daniel Vetter <daniel@ffwll.ch> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
2018-08-08igt/prime_vgem: Ask the shrinker to purge a vgem bo from inside i915Chris Wilson
Link a vgem dmabuf into an i915 bo and then ask the i915 shrinker to purge/invalidate its pages. This should establish the lockdep link from the fs_reclaim shrinker section to whatever locks are used to acquire/release dmabuf mappings; if any are required ofc. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Cc: Daniel Vetter <daniel@ffwll.ch> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
2018-08-08igt/gem_eio: Preserve batch between reset-stress iterationsChris Wilson
We can keep the original batch around and avoid recreating it between reset iterations to focus on the impact of resets. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
2018-08-08igt/gem_eio: Apply reset-stress to each engineChris Wilson
A simple question as to whether the error only occurs on rcs/hsw, or all. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Mika Kuoppala <mika.kuoppala@intel.com> Reviewed-by: Mika Kuoppala <mika.kuoppala@intel.com>
2018-08-03igt/gem_eio: Measure reset delay from threadChris Wilson
We assert that we complete a wedge within 250ms. However, when we use a thread to delay the wedging until after we start waiting, that thread itself is delayed longer than our wait timeout. This results in a false positive error where we fail the test before we even trigger the reset. Reorder the test so that we only ever measure the delay from triggering the reset until we wakeup, and assert that is in a timely fashion (less than 250ms). Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105954 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>