/** * searches the modes obstack for the given mode and returns * a pointer on an equal mode already in the array, NULL if * none found */ static ir_mode *find_mode(const ir_mode *m) { for (size_t i = 0, n_modes = ARR_LEN(mode_list); i < n_modes; ++i) { ir_mode *n = mode_list[i]; if (modes_are_equal(n, m)) return n; } return NULL; }
static int find_index_of_mode (ply_renderer_backend_t *backend, drmModeConnector *connector, drmModeModeInfo *mode) { int i; for (i = 0; i < connector->count_modes; i++) { if (modes_are_equal (&connector->modes[i], mode)) { ply_trace ("Found connector mode index %d for mode %dx%d", i, mode->hdisplay, mode->vdisplay); return i; } } return -1; }