[PATCH i-g-t v5 2/4] tests/intel/kms_dp_linktrain_fallback: Reset traversed MST output count
Sowmiya S <[email protected]>
| Newsgroups | org.freedesktop.lists.igt-dev |
|---|---|
| Message-ID | <[email protected]> |
run_lt_fallback_test() tracks which MST outputs it has already
traversed in a file-static counter that is never cleared. Today it
has a single caller so the counter is implicitly zero, but a second
caller would silently inherit the first run's state and skip every
MST sibling as "already visited".
Reset the counter on entry so the function is safe to call more than
once per binary. The DSC path never reaches setup_mst_outputs(), so
run_dsc_sst_fallaback_test() does not need the same treatment.
v4: reworded commit message to explain this is a no-op prep patch
until run_lt_fallback_test() gains a second caller (Kunal)
Signed-off-by: Sowmiya S <[email protected]>
---
tests/intel/kms_dp_linktrain_fallback.c | 7 +++++++
1 file changed, 7 insertions(+)
diff --git a/tests/intel/kms_dp_linktrain_fallback.c b/tests/intel/kms_dp_linktrain_fallback.c
index 115183d2d..44b875ab9 100644
--- a/tests/intel/kms_dp_linktrain_fallback.c
+++ b/tests/intel/kms_dp_linktrain_fallback.c
@@ -431,6 +431,13 @@ static bool run_lt_fallback_test(data_t *data)
bool ran = false;
igt_output_t *output;
+ /*
+ * Reset per invocation so MST traversal state from a previous subtest
+ * (e.g. dp-fallback followed by dsc-fallback) doesn't leak and cause
+ * MST siblings to be silently skipped as "already visited".
+ */
+ traversed_mst_output_count = 0;
+
for_each_connected_output(&data->display, output) {
data->output = output;
--
2.43.0