/* Add exactly b to the set guarded by meta. */ int meta_alloc(void* meta, size_t size, ubb_p up, size_t index, db_t db, struct xn_m_vec *mv, int n) { /* ensure that {old_set U b} == new_set */ static inline int add(Set old, Set new, db_t db) { return set_eq(set_union(old, set_single((T){db})), new); } return meta_transaction(add, meta, size, up, index, db, mv, n); }
std::vector < std::string > human_getset::set_vector(std::vector < std::string > names, int element, std::string replacement){ for(unsigned int i = 0; i < names.size(); i++){ names[i] = set_single(names[i], element, replacement); } return names; }
void ubb_add(db_t db, size_t n, int type) { int i; struct xn_update u; if(!db) return; u.nelem = n; u.type = type; for(i = 0; i < n; i++) { u.db = db + i; udf_access = set_union(udf_access, set_single(u)); } }
static void set_stereo_mode(struct connector *c) { int i, n; if (specified_mode_num != -1) n = 1; else n = c->connector->count_modes; for (i = 0; i < n; i++) { if (specified_mode_num == -1) c->mode = c->connector->modes[i]; if (!c->mode_valid) continue; if (!(c->mode.flags & DRM_MODE_FLAG_3D_MASK)) continue; igt_info("CRTC(%u): [%d]", c->crtc, i); kmstest_dump_mode(&c->mode); do_set_stereo_mode(c); if (qr_code) { set_single(); pause(); } else if (sleep_between_modes) sleep(sleep_between_modes); if (do_dpms) { kmstest_set_connector_dpms(drm_fd, c->connector, DRM_MODE_DPMS_OFF); sleep(sleep_between_modes); kmstest_set_connector_dpms(drm_fd, c->connector, DRM_MODE_DPMS_ON); } } drmModeFreeEncoder(c->encoder); drmModeFreeConnector(c->connector); }
static void set_mode(struct connector *c) { unsigned int fb_id = 0; struct igt_fb fb_info[2] = { }; int j, test_mode_num, current_fb = 0, old_fb = -1; test_mode_num = 1; if (force_mode){ memcpy( &c->mode, &force_timing, sizeof(force_timing)); c->mode.vrefresh =(force_timing.clock*1e3)/(force_timing.htotal*force_timing.vtotal); c->mode_valid = 1; sprintf(c->mode.name, "%dx%d", force_timing.hdisplay, force_timing.vdisplay); } else if (test_all_modes) test_mode_num = c->connector->count_modes; for (j = 0; j < test_mode_num; j++) { if (test_all_modes) c->mode = c->connector->modes[j]; /* set_mode() only tests 2D modes */ if (c->mode.flags & DRM_MODE_FLAG_3D_MASK) continue; if (!c->mode_valid) continue; width = c->mode.hdisplay; height = c->mode.vdisplay; fb_id = igt_create_pattern_fb(drm_fd, width, height, igt_bpp_depth_to_drm_format(bpp, depth), tiling, &fb_info[current_fb]); paint_output_info(c, &fb_info[current_fb]); paint_color_key(&fb_info[current_fb]); igt_info("CRTC(%u):[%d]", c->crtc, j); kmstest_dump_mode(&c->mode); if (drmModeSetCrtc(drm_fd, c->crtc, fb_id, 0, 0, &c->id, 1, &c->mode)) { igt_warn("failed to set mode (%dx%d@%dHz): %s\n", width, height, c->mode.vrefresh, strerror(errno)); igt_remove_fb(drm_fd, &fb_info[current_fb]); continue; } if (old_fb != -1) igt_remove_fb(drm_fd, &fb_info[old_fb]); old_fb = current_fb; current_fb = 1 - current_fb; if (sleep_between_modes && test_all_modes && !qr_code) sleep(sleep_between_modes); if (do_dpms) { kmstest_set_connector_dpms(drm_fd, c->connector, do_dpms); sleep(sleep_between_modes); kmstest_set_connector_dpms(drm_fd, c->connector, DRM_MODE_DPMS_ON); } if (qr_code){ set_single(); pause(); } } if (test_all_modes && old_fb != -1) igt_remove_fb(drm_fd, &fb_info[old_fb]); drmModeFreeEncoder(c->encoder); drmModeFreeConnector(c->connector); }