diff options
author | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2020-02-25 18:57:18 +0200 |
---|---|---|
committer | Arkadiusz Hiler <arkadiusz.hiler@intel.com> | 2020-03-23 15:47:34 +0200 |
commit | 027e1bc7b76e8d6eb0a83f42b40bb0e863c42a27 (patch) | |
tree | be784181dfaf87e64fbadcf4e0cd485ec23fded4 /tests/kms_chamelium.c | |
parent | 77805a0acc7961b00222915615e34d0358212946 (diff) |
lib/kms: Try to plug all Chamelium ports, abort if it fails
Using chamelium as a display for non-chamelium-aware test is
challenging. The board can be left in multiple different states after
kms_chamelium tests even though we have atexit() handlers and other
measures which try to assure that all ports are plugged in. Sadly this
is not 100% reliable. We also had a few boards hard hanging (happens
very seldom) and requiring manual intervention.
This leads to changes in the testing configuration - we may end up with
any number of connectors plugged in which makes a lot of kms_ tests to
flip between skip and pass depending on a run.
In an attempt to make connectors state less random this patch makes
igt_display_require() chamelium-aware. If chamelium is configured for
given machine we try to reach it and make sure everything is plugged in.
If we fail to do so we abort the execution because the testing
configuration is an unknown.
For machines without a configured chamelium this boils down to a nop.
I have run a bunch of tests and measured how much time we spend in the
Chamelium section of igt_display_require() (n = 1000) with chamelium
configured:
Min: 0.0030s Max: 0.0113s
Avg: 0.0089s Median: 0.0089s
With ~1000 of KMS subtests in a run it's only a mere 9s.
This will however add a bit of extra execution time to test skips
because of doing kmstest_set_vt_graphics_mode() and
igt_display_require() before even checking whether Chamelium is
configured.
v2: do kmstest_set_vt_graphics_mode() before requiring display (Petri)
Fixes: https://gitlab.freedesktop.org/drm/igt-gpu-tools/issues/20
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Petri Latvala <petri.latvala@intel.com>
Diffstat (limited to 'tests/kms_chamelium.c')
-rw-r--r-- | tests/kms_chamelium.c | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c index 07f1559e..614c7c5a 100644 --- a/tests/kms_chamelium.c +++ b/tests/kms_chamelium.c @@ -2486,7 +2486,14 @@ igt_main size_t i; igt_fixture { + /* So fbcon doesn't try to reprobe things itself */ + kmstest_set_vt_graphics_mode(); + data.drm_fd = drm_open_driver_master(DRIVER_ANY); + igt_display_require(&data.display, data.drm_fd); + igt_require(data.display.is_atomic); + + /* we need to initalize chamelium after igt_display_require */ data.chamelium = chamelium_init(data.drm_fd); igt_require(data.chamelium); @@ -2497,12 +2504,6 @@ igt_main data.edids[i] = chamelium_new_edid(data.chamelium, get_edid(i)); } - - /* So fbcon doesn't try to reprobe things itself */ - kmstest_set_vt_graphics_mode(); - - igt_display_require(&data.display, data.drm_fd); - igt_require(data.display.is_atomic); } igt_describe("DisplayPort tests"); |