summaryrefslogtreecommitdiff
path: root/tests/kms_fbcon_fbt.c
AgeCommit message (Collapse)Author
2019-04-15tests/fbcon_fbt: Do not keep opening debugfs_fd at every setup_drm() callJosé Roberto de Souza
As debugfs_fd is used even after the teardown_drm(), it is not closed in this function or in any other place. And then it gets worse as every call to setup_drm() will open another file descriptor to debugfs dir. So lets move the opening of debugfs_fd to setup_environment() and only open it once and close it before leave the test. Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-04-15tests/fbcon_fbt: Do not try to open the same driver twice as masterJosé Roberto de Souza
If a subtest fail before the teardown_drm() call it will keep the driver open as master causing the test to fail when trying to open the driver again as master, so lets share the drm_info struct and check if driver is already open. Starting subtest: psr (kms_fbcon_fbt:5270) CRITICAL: Test assertion failure function subtest, file ../tests/kms_fbcon_fbt.c:259: (kms_fbcon_fbt:5270) CRITICAL: Failed assertion: feature->wait_until_update(drm.debugfs_fd) Stack trace: #0 ../lib/igt_core.c:1474 __igt_fail_assert() #1 ../tests/kms_fbcon_fbt.c:261 subtest() #2 ../tests/kms_fbcon_fbt.c:316 __real_main309() #3 ../tests/kms_fbcon_fbt.c:309 main() #4 ../csu/libc-start.c:325 __libc_start_main() #5 [_start+0x29] #6 [<unknown>+0x0] Subtest psr failed. **** DEBUG **** (kms_fbcon_fbt:5270) drmtest-DEBUG: Test requirement passed: !(fd<0) (kms_fbcon_fbt:5270) igt_debugfs-DEBUG: Opening debugfs directory '/sys/kernel/debug/dri/1' (kms_fbcon_fbt:5270) DEBUG: Test requirement passed: drm->res (kms_fbcon_fbt:5270) igt_kms-DEBUG: VT: graphics mode set (mode was 0x0) (kms_fbcon_fbt:5270) DEBUG: Test requirement passed: feature->supported_on_chipset(drm.debugfs_fd) (kms_fbcon_fbt:5270) CRITICAL: Test assertion failure function subtest, file ../tests/kms_fbcon_fbt.c:259: (kms_fbcon_fbt:5270) CRITICAL: Failed assertion: feature->wait_until_update(drm.debugfs_fd) (kms_fbcon_fbt:5270) igt_core-INFO: Stack trace: (kms_fbcon_fbt:5270) igt_core-INFO: #0 ../lib/igt_core.c:1474 __igt_fail_assert() (kms_fbcon_fbt:5270) igt_core-INFO: #1 ../tests/kms_fbcon_fbt.c:261 subtest() (kms_fbcon_fbt:5270) igt_core-INFO: #2 ../tests/kms_fbcon_fbt.c:316 __real_main309() (kms_fbcon_fbt:5270) igt_core-INFO: #3 ../tests/kms_fbcon_fbt.c:309 main() (kms_fbcon_fbt:5270) igt_core-INFO: #4 ../csu/libc-start.c:325 __libc_start_main() (kms_fbcon_fbt:5270) igt_core-INFO: #5 [_start+0x29] (kms_fbcon_fbt:5270) igt_core-INFO: #6 [<unknown>+0x0] **** END **** Subtest psr: FAIL (0.845s) Starting subtest: fbc-suspend Test requirement not met in function igt_device_set_master, file ../lib/igt_device.c:55: Test requirement: __igt_device_set_master(fd) == 0 Can't become DRM master, please check if no other DRM client is running. Subtest fbc-suspend: SKIP (0.001s) Starting subtest: psr-suspend Test requirement not met in function igt_device_set_master, file ../lib/igt_device.c:55: Test requirement: __igt_device_set_master(fd) == 0 Can't become DRM master, please check if no other DRM client is running. Subtest psr-suspend: SKIP (0.000s) Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-04-15tests/fbcon_fbt: Add and user psr_long_wait_update()José Roberto de Souza
When fbcon is enabled, PSR will be active between cursor blinks so what it should really use to test PSR is psr_wait_entry(), so a new feature callback was added. But the fbcon cursor blinks at 5hz what give us 200ms between each screen update what make psr_wait_update() prone to fail the test because it timed out before a blink could happen, so here adding and using psr_long_wait_update() that have a longer timeout. v3: - 3 previous patches squashed in this one (Maarten) - Back to !feature->wait_until_enabled() to test feature state when all CRTCS are disabled(Dhinakaran) Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Dhinkaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-04-15tests/fbcon_fbt: Enable cursor blinkingJosé Roberto de Souza
If cursor blinking is disabled no screen updates will happen and fbcon_fbt subtests will fail, so lets enable cursor blink while running this test and restore to the previous value when exiting it. v4: - renaming restore fd (Dhinakaran) - saving previous value as char (Dhinakaran) - skipping test if not able to open cursor blink file (Dhinakaran) Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-04-15tests/fbcon_fbt: Allow fbcon to bind when running this testJosé Roberto de Souza
9c4114ec5d87 (lib: Always unbind the fbcon around igt) broke fbcon_fbt test as fbcon is not allowed to bind when executing any IGT test, so lets allow it again just for this test. Cc: Paulo Zanoni <paulo.r.zanoni@intel.com> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-04-15tests/fbcon_fbt: Use psr_wait_entry() to wait PSR be enabledJosé Roberto de Souza
kms_fbcon_fbt was doing its own handling to wait for PSR to get enabled while it is already available in lib. v2: splitted previous patch into this one and the previous one(Dhinakaran) Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-01-22lib/psr: Add PSR2 support to the remaning psr functionsJosé Roberto de Souza
Add the mode parameter to psr_enable() and psr_sink_support() so PSR1 and PSR2 can be tested separated. For now all PSR tests will run only with PSR1 and the tests for PSR2 will come in the future. Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-01-14tests/psr: Share the code check if sink supports PSRJosé Roberto de Souza
The same code checking if sink supports PSR was spread into 3 tests, better move it to lib and reuse. v2: splitted previous patch into this one and the next one(Dhinakaran) Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
2019-01-14lib/psr: Add a macro with the maximum lenght of i915_edp_psr_status and use itJosé Roberto de Souza
So every function reading i915_edp_psr_status can allocate a buffer long enough. Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
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-09-20test/kms_fbcon_fbt: Give a explicit parameter name to functions that expect ↵José Roberto de Souza
debugfs fd Let's rename to debugfs_fd all the parameters of the functions that expect debugfs fd to avoid call one those functions with the wrong file descriptor. v2: - Fixing code style - Renaming fbc_wait_until_enabled() too Reviewed-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Signed-off-by: José Roberto de Souza <jose.souza@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/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-03-20tests/kms_frontbuffer_tracking: Update check for PSR statusPandiyan, Dhinakaran
Kernel does not expose the "Active: " flag in edp_psr_status anymore. So test for "HW Enabled & Active bit: yes", although this isn't completely accurate either for frontbuffer tests. Let's go with this for now until the kernel exposes HW PSR status. Cc: Rodrigo Vivi <rodrigo.vivi@intel.com> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105519 Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Marta Lofstedt <marta.lofstedt@intel.com>
2018-02-22igt/kms_fbcon_fbt: Handle ENODEV when checking i915_edp_psr_status for ↵Lofstedt, Marta
chipset support If the machine doesn't support PSR, it will return -ENODEV from i915_edp_psr_status, which we want to interpret as unsupported. This is in line with what Chris just fixed for FBC. V2: Copy-pasted to the correct position. Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
2018-02-21igt/kms_fbcon_fbt: Handle ENODEV when checking i915_fbc_info for chipset supportChris Wilson
If the machine doesn't support FBC, it will return -ENODEV from i915_fbc_info, which we want to interpret as unsupported. Reported-by: Marta Lofstedt<marta.lofstedt@intel.com> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Marta Lofstedt<marta.lofstedt@intel.com>
2017-11-06tests/kms_fbcon_fbt: Report fbc_status on errorGabriel Krisman Bertazi
knowing the assertion triggered on wait_until_enabled() is not that useful without knowing what exactly caused the failure. It might be an user error, like too little stolen memory by the bios, or an actual issue in the kernel. So, let's make life easier, particularly for the CI, by printing the status before failing out. Case in point: Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101718 v2: Small typo. Signed-off-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk> Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
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-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>
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-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-05lib: add igt_debugfs_read()Paulo Zanoni
A helpful function for when you want to read a whole debugfs file to a string and don't want to worry about opening and closing file descriptors and asserting buffer sizes. We've been using this already for kms_frontbuffer_tracking and kms_fbcon_fbt, so the only test with new code here is kms_fbc_crc. Also notice that for kms_fbc_crc we had to increase the buffer size since the file can sometimes be bigger than 64 bytes - depending on the reason why FBC is disabled. Of course, there are probably many other programs we can patch, but I'm not doing this now. v2: Add the macro to wrap sizeof() (Daniel). v3: Add documentation for the macro too (Daniel). Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
2015-07-14tests: add kms_fbcon_fbtPaulo Zanoni
This test should test the interactions between fbcon and the frontbuffer tracking infrastructure. Right now the PSR test fails, but as soon as we merge the following kernel patches, the test wills tart passing: - drm/i915: PSR: Flush means invalidate + flush - drm/i915: fbdev restore mode needs to invalidate frontbuffer - drm/i915: fbdev_set_par reliably invalidating frontbuffer I didn't want to make this a subtest of kms_frontbuffer_tracking just because when I wrote it, I really didn't have in mind the fact that someone might just close the DRM fd in the middle of a subtest. After this commit we'll have a little bit of duplicated code among tests. I'll clean this up later. v2: - Refactor the code a little bit. - Add the suspend subtests. Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>