[PATCH i-g-t 3/8] tests/kms_setmode: drop redundant drmModeGetCrtc() call

Jani Nikula
2026-01-27T11:56:29Z

In setup_crtcs(), drmModeRes *resources is the result from
drmModeGetResources(). The resources->crtcs[] array already contains
CRTC IDs. There is no point in the drmModeGetCrtc() call to get from
CRTC ID to the same CRTC ID. Remove it.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
---
tests/kms_setmode.c | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c
index 108e713610fd..e17edb0d0dd0 100644
--- a/tests/kms_setmode.c
+++ b/tests/kms_setmode.c
@@ -343,17 +343,13 @@ static void setup_crtcs(const struct test_config *tconf,
config_valid = true;

while (i < connector_count) {
- drmModeCrtc *drm_crtc;
unsigned long encoder_mask;
int j;

igt_assert_lt(crtc_count, MAX_CRTCS);

crtc->crtc_idx = cconf[i].crtc_idx;
- drm_crtc = drmModeGetCrtc(drm_fd,
- resources->crtcs[crtc->crtc_idx]);
- crtc->crtc_id = drm_crtc->crtc_id;
- drmModeFreeCrtc(drm_crtc);
+ crtc->crtc_id = resources->crtcs[crtc->crtc_idx];
crtc->pipe_id = kmstest_get_pipe_from_crtc_id(drm_fd,
crtc->crtc_id);

--
2.47.3