static int run_test(const char *test_name, enum test_flags flags) { int i; resources = drmModeGetResources(drm_fd); igt_assert(resources); /* Find any connected displays */ for (i = 0; i < resources->count_connectors; i++) { uint32_t connector_id; int j; connector_id = resources->connectors[i]; for (j = 0; j < resources->count_crtcs; j++) { struct kmstest_connector_config cconf; if (!kmstest_get_connector_config(drm_fd, connector_id, 1 << j, &cconf)) continue; test_connector(test_name, &cconf, flags); kmstest_free_connector_config(&cconf); } } drmModeFreeResources(resources); return 1; }
static void connector_find_preferred_mode(uint32_t connector_id, unsigned long crtc_idx_mask, int mode_num, struct connector *c) { struct kmstest_connector_config config; if (!kmstest_get_connector_config(drm_fd, connector_id, crtc_idx_mask, &config)) { c->mode_valid = 0; return; } c->connector = config.connector; c->encoder = config.encoder; c->crtc = config.crtc->crtc_id; c->crtc_idx = config.crtc_idx; c->pipe = config.pipe; if (mode_num != -1) { igt_assert(mode_num < config.connector->count_modes); c->mode = config.connector->modes[mode_num]; } else { c->mode = config.default_mode; } c->mode_valid = 1; }