• Home
  • Raw
  • Download

Lines Matching refs:drm

59 static void setup_drm(struct drm_info *drm)  in setup_drm()  argument
63 if (drm->fd >= 0) in setup_drm()
66 drm->fd = drm_open_driver_master(DRIVER_INTEL); in setup_drm()
68 drm->res = drmModeGetResources(drm->fd); in setup_drm()
69 igt_require(drm->res); in setup_drm()
70 igt_assert(drm->res->count_connectors <= MAX_CONNECTORS); in setup_drm()
72 for (i = 0; i < drm->res->count_connectors; i++) in setup_drm()
73 drm->connectors[i] = drmModeGetConnectorCurrent(drm->fd, in setup_drm()
74 drm->res->connectors[i]); in setup_drm()
79 static void teardown_drm(struct drm_info *drm) in teardown_drm() argument
85 for (i = 0; i < drm->res->count_connectors; i++) in teardown_drm()
86 drmModeFreeConnector(drm->connectors[i]); in teardown_drm()
88 drmModeFreeResources(drm->res); in teardown_drm()
89 igt_assert(close(drm->fd) == 0); in teardown_drm()
90 drm->fd = -1; in teardown_drm()
153 static void set_mode_for_one_screen(struct drm_info *drm, struct igt_fb *fb, in set_mode_for_one_screen() argument
162 for (i = 0; i < drm->res->count_connectors; i++) { in set_mode_for_one_screen()
163 c = drm->connectors[i]; in set_mode_for_one_screen()
171 igt_require_f(i < drm->res->count_connectors, in set_mode_for_one_screen()
174 crtc_id = kmstest_find_crtc_for_connector(drm->fd, drm->res, c, 0); in set_mode_for_one_screen()
176 buffer_id = igt_create_fb(drm->fd, mode->hdisplay, mode->vdisplay, in set_mode_for_one_screen()
179 igt_draw_fill_fb(drm->fd, fb, 0xFF); in set_mode_for_one_screen()
185 rc = drmModeSetCrtc(drm->fd, crtc_id, buffer_id, 0, 0, in set_mode_for_one_screen()
258 static void subtest(struct drm_info *drm, struct feature *feature, bool suspend) in subtest() argument
262 setup_drm(drm); in subtest()
264 igt_require(feature->supported_on_chipset(drm->debugfs_fd)); in subtest()
266 disable_features(drm->debugfs_fd); in subtest()
267 feature->enable(drm->debugfs_fd); in subtest()
269 kmstest_unset_all_crtcs(drm->fd, drm->res); in subtest()
271 igt_assert(!feature->wait_until_enabled(drm->debugfs_fd)); in subtest()
273 set_mode_for_one_screen(drm, &fb, feature->connector_possible_fn); in subtest()
275 igt_assert(feature->wait_until_enabled(drm->debugfs_fd)); in subtest()
281 igt_assert(feature->wait_until_enabled(drm->debugfs_fd)); in subtest()
284 igt_remove_fb(drm->fd, &fb); in subtest()
285 teardown_drm(drm); in subtest()
291 igt_assert(feature->wait_until_update(drm->debugfs_fd)); in subtest()
297 igt_assert(feature->wait_until_update(drm->debugfs_fd)); in subtest()
301 static void setup_environment(struct drm_info *drm) in setup_environment() argument
307 drm->debugfs_fd = igt_debugfs_dir(drm_fd); in setup_environment()
308 igt_require(drm->debugfs_fd >= 0); in setup_environment()
319 static void teardown_environment(struct drm_info *drm) in teardown_environment() argument
321 if (drm->fd >= 0) in teardown_environment()
322 teardown_drm(drm); in teardown_environment()
324 close(drm->debugfs_fd); in teardown_environment()
329 struct drm_info drm = { .fd = -1 }; variable
332 setup_environment(&drm);
335 subtest(&drm, &fbc, false);
337 subtest(&drm, &psr, false);
339 subtest(&drm, &fbc, true);
341 subtest(&drm, &psr, true);
344 teardown_environment(&drm);