Since set_abm_level() commits without ALLOW_MODESET, the first commit
of every subtest fails with -EINVAL when the eDP runs in a mode other
than the one test_init() picks, for example when video= sets the
console mode. All five subtests then fail
Commit the test's mode and framebuffer with ALLOW_MODESET at the end of
test_init(), so the subtests start from the state they commit
Fixes: e63b2671fcdb ("tests/amdgpu/amd_abm: Remove the modeset for ABM level
setting")
Signed-off-by: Hugo Sales <[email protected]>
---
Tested on an ASUS ROG Flow X13 (DCN 2.1, eDP) booted with video= set to
a non-native mode, on IGT 2.3 with this change and a local fix for the
card index and backlight name that master now has as:
4e939e73adfd ("tests/amdgpu: Resolve DRM card index dynamically instead of
hardcoding card0")
055ffbee8325 ("tests/amdgpu: Discover amdgpu backlight device dynamically
instead of hardcoding amdgpu_bl0")
All five subtests failed with -EINVAL before and pass with this change
---
tests/amdgpu/amd_abm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/tests/amdgpu/amd_abm.c b/tests/amdgpu/amd_abm.c
index 7992dfd87..833d950eb 100644
--- a/tests/amdgpu/amd_abm.c
+++ b/tests/amdgpu/amd_abm.c
@@ -192,6 +192,9 @@ static void test_init(data_t *data)
fbmem_draw_smpte_pattern(data->fb_mem, data->w, data->h);
igt_create_color_fb(data->drm_fd, data->mode->hdisplay,
data->mode->vdisplay, DRM_FORMAT_XRGB8888, 0, 0.05, 0.05, 0.05,
&data->ref_fb2);
+
+ igt_plane_set_fb(data->primary, &data->ref_fb);
+ igt_display_commit_atomic(display, DRM_MODE_ATOMIC_ALLOW_MODESET, 0);
}
/* Common test cleanup. */
--
2.56.0