Skip to content

Commit fb97bc2

Browse files
committed
drm/tests: hdmi: Fix WW_MUTEX_SLOWPATH failures
The light_up_connector helper function in the HDMI infrastructure unit tests uses drm_atomic_set_crtc_for_connector(), but fails when it returns an error. This function can return EDEADLK though if the sequence needs to be restarted, and WW_MUTEX_SLOWPATH is meant to test that we handle it properly. Let's handle EDEADLK and restart the sequence in our tests as well. Fixes: eb66d34 ("drm/tests: Add output bpc tests") Reported-by: Dave Airlie <[email protected]> Closes: https://lore.kernel.org/r/CAPM=9tzJ4-ERDxvuwrCyUPY0=+P44orhp1kLWVGL7MCfpQjMEQ@mail.gmail.com/ Link: https://lore.kernel.org/r/[email protected] Reviewed-by: Simona Vetter <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected] Signed-off-by: Maxime Ripard <[email protected]>
1 parent 2c1ed90 commit fb97bc2

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/gpu/drm/tests/drm_hdmi_state_helper_test.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,17 @@ static int light_up_connector(struct kunit *test,
7070
state = drm_kunit_helper_atomic_state_alloc(test, drm, ctx);
7171
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, state);
7272

73+
retry:
7374
conn_state = drm_atomic_get_connector_state(state, connector);
7475
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, conn_state);
7576

7677
ret = drm_atomic_set_crtc_for_connector(conn_state, crtc);
78+
if (ret == -EDEADLK) {
79+
drm_atomic_state_clear(state);
80+
ret = drm_modeset_backoff(ctx);
81+
if (!ret)
82+
goto retry;
83+
}
7784
KUNIT_EXPECT_EQ(test, ret, 0);
7885

7986
crtc_state = drm_atomic_get_crtc_state(state, crtc);

0 commit comments

Comments
 (0)