summaryrefslogtreecommitdiff
path: root/tests/pm_rpm.c
AgeCommit message (Collapse)Author
2018-03-12tests/pm_rpm: Don't try to create an X-tiled ARGB8888 framebufferVille Syrjälä
On most platforms ARGB8888 is only supported by the cursor plane, which doesn't support tiled buffers. Hence the kernel is under no obligation to accept the request to create a tiled ARGB888 framebuffer. Apparently we've been letting this slip through so far, but that is about to change. Fortunately the resulting fb was neer actually used (in fact the kernel would have rejected the setplane/atomic ioctl with such a framebuffer). All we're really interested here is the gem BO which we feed to the kernel via the setcursor ioctl after changing the tiling to linear. To avoid changing the test drastically we can simply change the fb to XRGB8888, which combined with X-tiling is supported on all platforms. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-02-23igt: Use lib gem_execbuf where possibleAntonio Argenziano
Replace custom execbuf ioctl wrapper with the ones in lib. v2: - Lib execbuf wrapper is not signal handling friendly. (Chris) v3: - EXECBUFFER2_WR != EXECBUFFER2. (Chris) v4: Drop gem_exec_fence.c changes Signed-off-by: Antonio Argenziano <antonio.argenziano@intel.com> Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Cc: Petri Latvala <petri.latvala@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-12-15lib: Provide a library function to test nop executionChris Wilson
Sometimes a test wants to verify that an engine, or all of them, are functional by executing a nop batch. Provide a common routine to submit an empty batch then test whether the driver is wedged. Reported-by: Antonio Argenziano <antonio.argenziano@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Cc: Antonio Argenziano <antonio.argenziano@intel.com> Reviewed-by: Antonio Argenziano <antonio.argenziano@intel.com>
2017-09-06igt/pm_rpm: Use libc 'ftw' rather than opencoding our own filetree walkChris Wilson
By using ftw, we avoid the issue of having to handle directory recursion ourselves and can focus on the test of checking the reading a sysfs/debugfs does not break runtime suspend. In the process, disregard errors when opening the individual files as they may fail for other reasons. v2: Bracket the file open/close with the wait_for_suspended() tests. Whilst the fd is open, it may be keeping the device awake, e.g. i915_forcewake_user. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Tested-by: Jari Tahvanainen <jari.tahvanainen@intel.com>
2017-09-05Use PATH_MAX to fix some sprintf-into-short-buffers warnings.Eric Anholt
Signed-off-by: Eric Anholt <eric@anholt.net> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2017-08-03tests/pm_rpm: Use the quick mode by defaultDaniel Vetter
pm_rpm is one of the main offenders for long runtime in our full igt run. And hey, there's a quick option already, so make it the default. This means there's yet another way to enable stress tests, we really need to standardize this somehow. Or shred the stress-tests we really don't want/need anymore. v2: Fixup the entire help text (David). v3: Switch shortopt from 'q' to 'l', only used internal, so just for clarity (Arkadiusz). Cc: David Weinehall <david.weinehall@linux.intel.com> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Cc: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2017-04-08igt/pm_rpm: Use directory fd to track and read entire directoriesChris Wilson
Rather than compute the temporary full path name, remember it via the dir fd we already have. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-25Replace more system("modprobe")Chris Wilson
As we have libkmod available, it is faster and safer than calling system(). Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-21Restore "lib: Open debugfs files for the given DRM device"Chris Wilson
This reverts commit 25fbae15262cf570e207e62f50e7c5233e06bc67, restoring commit 301ad44cdf1b868b1ab89096721da91fa8541fdc Author: Tomeu Vizoso <tomeu.vizoso@collabora.com> Date: Thu Mar 2 10:37:11 2017 +0100 lib: Open debugfs files for the given DRM device with fixes. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2017-03-21Revert "lib: Open debugfs files for the given DRM device"Tomeu Vizoso
This reverts commit 301ad44cdf1b868b1ab89096721da91fa8541fdc. When a render-only device is opened and gem_quiescent_gpu is called, we need to use the debugfs dir for the master device instead. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
2017-03-21lib: Open debugfs files for the given DRM deviceTomeu Vizoso
When opening a DRM debugfs file, locate the right path based on the given DRM device FD. This is needed so, in setups with more than one DRM device, any operations on debugfs files affect the expected DRM device. v2: - rebased and fixed new API additions v3: - updated chamelium test, which was missed previously - use the minor of the device for the debugfs path, not the major - have a proper exit handler for calling igt_hpd_storm_reset with the right device fd. Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Robert Foss <robert.foss@collabora.com> Acked-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-07-09igt/pm_rpm: Fix requirement for external modulesChris Wilson
Don't just fail, skip gracefully if an external module is unavailable. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-07igt/pm_rpm: Wait for PCI D3Chris Wilson
The transition to PCI device state D3 is not instantaneous and only started when runtime suspended. Allow the driver/hardware a little bit of time to complete the transition before declaring a test failure. References: https://bugs.freedesktop.org/show_bug.cgi?id=93123 Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2016-03-03tests: fix CRTC assignment for a few testsPaulo Zanoni
All the tests I wrote always assumed that every connector supported CRTC 0. This is not the case for BSW and possibly others, so fix the tests before the CI reports more failures. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-03-03lib/igt_kms: add kmstest_get_crtc_idxPaulo Zanoni
Move it from pm_rpm.c to lib/igt_kms and remove the hardcoded version from kms_frontbuffer_tracking. I'm also planning to add other callers. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-03-03tests/pm_rpm: Fix CRASH on machines that lack LLCDavid Weinehall
On machines that lack an LLC the pm-caching subtest will terminate with sigbus and thus CRASH during the I915_CACHING_CACHED iteration. To work around this we reset the caching to I915_CACHING_NONE before doing memory access. v2: Various improvements based on feedback from Chris Wilson v3: Fix incorrect Signed-off-by: line v4: Further improvements based on feedback from Chris Wilson Signed-off-by: David Weinehall <david.weinehall@linux.intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-02-19lib/igt_pm: Lib for power managementDavid Weinehall
Move power management related code to a separate library. Initially this is done only for workarounds that apply to external components. Modify the users of such workarounds accordingly. This currently involves HD audio and SATA link power management. For SATA link PM there's also code to save the previous settings, to allow for resetting the values after we've finished testing. Signed-off-by: David Weinehall <david.weinehall@intel.com> Reviewed-by: Marius Vlad <marius.c.vlad@intel.com> Signed-off-by: Marius Vlad <marius.c.vlad@intel.com>
2016-01-29tests/pm_rpm: find an appropriate CRTC instead of hardcoding CRTC 0Paulo Zanoni
BSW does not allow CRTC 0 to be used on every connector, so we need to write code to actually find a suitable CRTC. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=93124 Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-29tests/pm_rpm: remove POWER_DIR definitionPaulo Zanoni
Unused ever since we moved some code from pm_rpm.c to lib/. This is currently defined inside igt_aux.c. Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2016-01-08lib: Extract some common fb create+fill methods into helpersVille Syrjälä
Several tests do one or more of the following: * igt_create_fb() + igt_paint_test_pattern() * igt_create_color_fb() + igt_paint_test_pattern() * igt_create_fb() + igt_paint_image() Extract them into new helpers: igt_create_pattern_fb(), igt_create_color_pattern_fb(), igt_create_image_fb(). v2: Fix typos, and improve API docs (Thomas) 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-12-01tests/pm_rpm: Don't compare edid blob IDsDaniel Vetter
The kernel is free to allocate blob ids however it wants to. And also to reallocate them whenever it sees fit. The only thing we are allowed to compare is the length and the actual date. Removing this bogus check makes drm-resources-equal on my snb. Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90546 Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
2015-11-27tests/pm_rpm tests for set_caching and set_tiling ioctl(s)Marius Vlad
v4: re-bind the gem objects each time before calling disable_all_screens_and_wait(). v3: Use smaller sizes when allocating gem objects for caching tests. v2: use mmap to gtt instead off cpu and various style-changes. Signed-off-by: Marius Vlad <marius.c.vlad@intel.com> Reviewed-by: Imre Deak <imre.deak@intel.com> Signed-off-by: Imre Deak <imre.deak@intel.com>
2015-11-11Add missing noreturn attribute to various functionsThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2015-10-12Replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with gem_mmap__{cpu,gtt,wc}()Ville Syrjälä
gem_mmap__{cpu,gtt,wc}() already has the assert built in, so replace __gem_mmap__{cpu,gtt,wc}() + igt_assert() with it. Mostly done with coccinelle, with some manual help: @@ identifier I; expression E1, E2, E3, E4, E5, E6; @@ ( - I = __gem_mmap__gtt(E1, E2, E3, E4); + I = gem_mmap__gtt(E1, E2, E3, E4); ... - igt_assert(I); | - I = __gem_mmap__cpu(E1, E2, E3, E4, E5); + I = gem_mmap__cpu(E1, E2, E3, E4, E5); ... - igt_assert(I); | - I = __gem_mmap__wc(E1, E2, E3, E4, E5); + I = gem_mmap__wc(E1, E2, E3, E4, E5); ... - igt_assert(I); ) Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09Make gem_mmap__{cpu,gtt,wc}() assert on failureVille Syrjälä
Rename the current gem_mmap__{cpu,gtt,wc}() functions into __gem_mmap__{cpu,gtt,wc}(), and add back wrappers with the original name that assert that the pointer is valid. Most callers will expect a valid pointer and shouldn't have to bother with failures. To avoid changing anything (yet), sed 's/gem_mmap__/__gem_mmap__/g' over the entire codebase. Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2015-10-09Sprinkle igt_assert(ptr) after gem_mmap__{cpu,gtt,wc}Ville Syrjälä
Do the following ptr = gem_mmap__{cpu,gtt,wc}() +igt_assert(ptr); whenever the code doesn't handle the NULL ptr in any kind of specific way. Makes it easier to move the assert into gem_mmap__{cpu,gtt,wc}() itself. Mostly done with coccinelle, with some manual cleanups: @@ identifier I; @@ <... when != igt_assert(I) when != igt_require(I) when != igt_require_f(I, ...) when != I != NULL when != I == NULL ( I = gem_mmap__gtt(...); + igt_assert(I); | I = gem_mmap__cpu(...); + igt_assert(I); | I = gem_mmap__wc(...); + igt_assert(I); ) ...> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com> Stochastically-reviwewed-by: Chris Wilson <chris@chris-wilson.co.uk>
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/pm_rpm: mark RTE and D3 tests as basicJesse Barnes
These always need to pass for basic PM functionality. Reviewed-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Jesse Barnes <jbarnes@virtuousgeek.org>
2015-07-14configure: require libdrm >= 2.4.55Paulo Zanoni
And drop the now unnecessary universal plane definitions. The 2.4.55 version is already quite old, so we should be fine. Thanks to Thomas Wood for quickly spotting this. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@>
2015-07-14pm_rpm: remove pm_status_fd declarationPaulo Zanoni
This was forgotten since we moved some code to igt_aux.c a long time ago. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-06-13pm_rpm: Update the debugfs filenameDamien Lespiau
v2: Try to open i915_pc8_status first to make the transition (or just running on older kernels) better. (Paulo) Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-15lib: Add a user data pointer to the argument parsing functionsDamien Lespiau
It can be useful to have one of those to carry state between the handler parsing the options and the rest of the test. Right now the only thing we can do is to use global variables for that. Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
2015-05-05lib: add igt_wait()Paulo Zanoni
Just a little helper for code that needs to wait for a certain condition to happen. It has the nice advantage that it can survive the signal helper. Despite the callers added in this patch, there is another that will go in a separate patch, and another in a new IGT test file that I plan to push later. v2: Check COND again before returning in case we hit the timeout. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@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-27tests/pm_rpm: I2C VGA detection is unreliablePaulo Zanoni
We fail to detect some VGA monitors using our I2C method, leading to bug reports from QA. If you look at the dmesg of these cases, you'll see the Kernel complaining about EDID reading mostly FFs and then disabling bit-mangling. Since we don't want to reimplement everything the Kernel does, let's just accept the fact that some VGA outputs won't be properly detected. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84273 Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-02-25lib: remove handled option arguments from argvThomas Wood
Remove options from argv that have been handled by getopt to allow additional non-option parameters to be processed in the test application. This fixes issues when using options such as --debug with tests that accept additional non-option parameters. Signed-off-by: Thomas Wood <thomas.wood@intel.com>
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>
2014-11-14tests/pm_rpm: add gem-evict-pwrite subtestImre Deak
This triggers a device suspended WARN in the kernel in gen6_ggtt_insert_entries() while calling the GEM pwrite ioctl. The sequence is suggested by Daniel. Signed-off-by: Imre Deak <imre.deak@intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
2014-11-06tests: use igt_debugfs where possibleThomas Wood
Signed-off-by: Thomas Wood <thomas.wood@intel.com>
2014-11-04ioctl_wrappers: Pass in offset to CPU mmapsChris Wilson
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
2014-10-27tests/pm_rpm: add system-suspend-{execbuf,modeset} subtestsPaulo Zanoni
We were having a problem where the system-suspend test was passing, but then the next test - gem-execbuf-stress - was failing because of bugs caused by the suspend subtest. So add a single test that emulates the same problem, and another test that just sets a mode after resume. This way, we should be reproducing the problem even if you don't run the tests in the order they are defined. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-10-22lib/igt_aux: move audio RPM code to igt_setup_runtime_pm()Paulo Zanoni
If we don't enable audio runtime PM, the audio driver won't release its reference, the refcount won't ever become zero, so we will never actually runtime suspend. So move this code from pm_rpm.c to igt_aux.c, so kms_flip - and any other IGT test case using RPM - can benefit from it. Previously, if you ran pm_rpm before running the other tests - or if you just didn't have snd_hda_intel loaded - you wouldn't notice this bug. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=78893 Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-10-14tests/pm_rpm: use igt_assert_eq() on COMPARE()Paulo Zanoni
A few weeks ago we were hitting this assertion, and the _eq macro is more useful when you're debugging. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-10-14tests/pm_rpm: fix some compilation warningsPaulo Zanoni
warning: ignoring return value of ‘write’, declared with attribute warn_unused_result [-Wunused-result] Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-10-14tests/pm_rpm: reduce the number of rounds on the stress testsPaulo Zanoni
With the current Kernel, it takes more than 10 minutes to run modeset-stress-extra-wait on BYT with eDP, and we don't really want IGT subtests that take more than 10 minutes to run: QA reports them as bugs. Since, as far as I remember, any of these RPM race condition bugs we had could always be triggered with just 4-5 rounds of testing, let's tune down the number of rounds we test: Before: rounds = (--quick option used) ? 10 : 50; After: rounds = (--quick option used) ? 10 : 40; rounds = (wait_flags & WAIT_EXTRA) ? rounds / 2 : rounds; This should make all subtests be way above the 10m limit. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=84897 Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2014-09-30tests/pm_rpm: factor out drm_open_any_masterImre Deak
Signed-off-by: Imre Deak <imre.deak@intel.com>