Lines Matching +full:check +full:- +full:api +full:- +full:rate
59 return ts->tv_sec * NSECS_PER_SEC + ts->tv_nsec; in timespec_to_ns()
71 igt_assert_eq(read(data->drm_fd, &ev, sizeof(ev)), sizeof(ev)); in get_vblank_event_ns()
80 * CLOCK_MONOTONIC_RAW - which isn't what the kernel uses for its timestamps.
92 igt_fail(-errno); in get_time_ns()
97 /* Returns the rate duration in nanoseconds for the given refresh rate. */
111 fd = igt_debugfs_connector_dir(data->drm_fd, output->name, O_RDONLY); in get_vrr_range()
141 igt_require(mode->vrefresh > range.min); in get_test_rate_ns()
143 vtest = (mode->vrefresh - range.min) / 2 + range.min; in get_test_rate_ns()
144 igt_require(vtest < mode->vrefresh); in get_test_rate_ns()
156 /* Toggles variable refresh rate on the pipe. */
159 igt_pipe_set_prop_value(&data->display, pipe, IGT_CRTC_VRR_ENABLED, in set_vrr_on_pipe()
161 igt_display_commit_atomic(&data->display, 0, NULL); in set_vrr_on_pipe()
172 igt_display_reset(&data->display); in prepare_test()
176 igt_create_color_fb(data->drm_fd, mode.hdisplay, mode.vdisplay, in prepare_test()
178 0.50, 0.50, 0.50, &data->fb0); in prepare_test()
180 igt_create_color_fb(data->drm_fd, mode.hdisplay, mode.vdisplay, in prepare_test()
182 0.50, 0.50, 0.50, &data->fb1); in prepare_test()
184 cr = igt_get_cairo_ctx(data->drm_fd, &data->fb0); in prepare_test()
189 igt_put_cairo_ctx(data->drm_fd, &data->fb0, cr); in prepare_test()
193 igt_plane_set_fb(primary, &data->fb0); in prepare_test()
195 igt_display_commit_atomic(&data->display, in prepare_test()
208 drmWaitVBlank(data->drm_fd, &vbl); in wait_for_vblank()
213 /* Performs an asynchronous non-blocking page-flip on a pipe. */
217 igt_pipe_t *pipe = &data->display.pipes[pipe_id]; in do_flip()
224 * It's also non-blocking, but returns -EBUSY if flipping too fast. in do_flip()
225 * 2x monitor tests will need async flips in the atomic API. in do_flip()
228 ret = drmModePageFlip(data->drm_fd, pipe->crtc_id, in do_flip()
229 fb->fb_id, in do_flip()
233 } while (ret == -EBUSY); in do_flip()
242 * Flips at the given rate and measures against the expected value.
243 * Returns the pass rate as a percentage from 0 - 100.
245 * The VRR API is quite flexible in terms of definition - the driver
248 * to prevent stuttering or to match a source content rate.
250 * The only way to "present" at a fixed rate like userspace in a vendor
253 * desired rate.
272 do_flip(data, pipe, front ? &data->fb1 : &data->fb0); in flip_and_measure()
275 diff_ns = rate_ns - (vblank_ns - last_vblank_ns); in flip_and_measure()
281 * Check if the difference between the two flip timestamps in flip_and_measure()
282 * was within the required threshold from the expected rate. in flip_and_measure()
292 if (now_ns - start_ns > duration_ns) in flip_and_measure()
300 diff_ns = now_ns - start_ns; in flip_and_measure()
301 wait_ns = ((diff_ns + rate_ns - 1) / rate_ns) * rate_ns; in flip_and_measure()
302 target_ns = start_ns + wait_ns - 10; in flip_and_measure()
313 /* Basic VRR flip functionality test - enable, measure, disable, measure */
317 uint64_t rate; in test_basic() local
320 rate = get_test_rate_ns(data, output); in test_basic()
327 * Do a short run with VRR, but don't check the result. in test_basic()
331 flip_and_measure(data, output, pipe, rate, 250000000ull); in test_basic()
334 kmstest_set_connector_dpms(output->display->drm_fd, in test_basic()
335 output->config.connector, in test_basic()
337 kmstest_set_connector_dpms(output->display->drm_fd, in test_basic()
338 output->config.connector, in test_basic()
346 result = flip_and_measure(data, output, pipe, rate, TEST_DURATION_NS); in test_basic()
350 /* This check is delayed until after VRR is disabled so it isn't in test_basic()
356 result = flip_and_measure(data, output, pipe, rate, TEST_DURATION_NS); in test_basic()
362 igt_remove_fb(data->drm_fd, &data->fb1); in test_basic()
363 igt_remove_fb(data->drm_fd, &data->fb0); in test_basic()
373 for_each_connected_output(&data->display, output) { in run_vrr_test()
379 for_each_pipe(&data->display, pipe) in run_vrr_test()
407 igt_subtest("flip-basic")
410 igt_subtest("flip-dpms")
413 igt_subtest("flip-suspend")