[PATCH i-g-t] tests/kms_plane: Optimize modifier check for unsupported platforms

Pranay Samala
2026-02-17T05:45:29Z

Optimize the modifier check by moving it outside the CRTC/Output loop.
This avoids redundancy and ensures the test is cleanly skipped.

Fixes: a4805b36cf23 ("tests/kms_plane: Skip unsupported modifiers")
Signed-off-by: Pranay Samala <pranay.samala@intel.com>
---
tests/kms_plane.c | 18 +++++++-----------
1 file changed, 7 insertions(+), 11 deletions(-)

diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 362748cdb..f37b019d1 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -1489,18 +1489,14 @@ static void run_test(data_t *data, void (*test)(data_t *, enum pipe))
igt_crtc_t *crtc;
int count = 0;

+ igt_skip_on_f(((data->flags & TEST_PIXEL_FORMAT) &&
+ !igt_display_has_format_mod(&data->display,
+ DRM_FORMAT_XBGR8888, data->mod)),
+ "Skipping: Modifier " IGT_MODIFIER_FMT
+ " is not supported on this platform\n",
+ IGT_MODIFIER_ARGS(data->mod));
+
for_each_crtc_with_single_output(&data->display, crtc, data->output) {
- if ((data->flags & TEST_PIXEL_FORMAT) &&
- !igt_display_has_format_mod(&data->display,
- DRM_FORMAT_XBGR8888,
- data->mod)) {
- igt_info("Skipping: Modifier " IGT_MODIFIER_FMT
- " is not supported on pipe %s, output %s\n",
- IGT_MODIFIER_ARGS(data->mod),
- kmstest_pipe_name(crtc->pipe),
- igt_output_name(data->output));
- continue;
- }

igt_display_reset(&data->display);

--
2.34.1