diff options
author | Sean Callanan <spyffe@google.com> | 2020-04-30 18:41:15 -0700 |
---|---|---|
committer | Sean Callanan <spyffe@google.com> | 2020-05-01 19:17:43 -0700 |
commit | 29168897a2650df6b8d9bff766abd47969a07324 (patch) | |
tree | 161bf5252e1981f7912f5024eb805e1696feb33f /benchmarks/kms_throughput.c | |
parent | 2606106bcac7bc6c726b55c5e9a502005b31c072 (diff) | |
download | igt-gpu-tools-29168897a2650df6b8d9bff766abd47969a07324.tar.gz |
igt-gpu-tools: don't wait for vblank in core loop
kms_throughput currently does a commit and then waits for vblank.
The explicit wait isn't needed since we're not using non-blocking
commits. Eliminate the redundant wait.
Bug: 143118270
Test: atest kms_throughput
Change-Id: I4f098cfb6949e2733bec3fe5d8b694d69359accc
Diffstat (limited to 'benchmarks/kms_throughput.c')
-rw-r--r-- | benchmarks/kms_throughput.c | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/benchmarks/kms_throughput.c b/benchmarks/kms_throughput.c index 4a3adb5a0..dfed11a9e 100644 --- a/benchmarks/kms_throughput.c +++ b/benchmarks/kms_throughput.c @@ -156,6 +156,13 @@ struct tuning size_t fb_width; }; +static void info_timestamp(const char *text) +{ + struct timeval ts; + gettimeofday(&ts, NULL); + igt_debug("%ld: %s\n", ts.tv_usec, text); +} + static void flip_overlays(igt_pipe_t *p, struct igt_fb **fb_sets, const struct tuning *tuning, size_t iter) @@ -163,8 +170,6 @@ static void flip_overlays(igt_pipe_t *p, struct igt_fb **fb_sets, size_t fb_set = iter % tuning->num_fb_sets; struct igt_fb *fbs = fb_sets[fb_set]; - igt_debug("About to configure fbs\n"); - for (size_t i = 0; i < tuning->num_fbs; ++i) { igt_plane_t *plane = plane_for_index(p, i); @@ -172,11 +177,11 @@ static void flip_overlays(igt_pipe_t *p, struct igt_fb **fb_sets, igt_plane_set_fb(plane, &fbs[i]); } - igt_debug("About to flip with all fbs\n"); - igt_pipe_obj_set_prop_value(p, IGT_CRTC_ACTIVE, 1); + + info_timestamp("start commit"); igt_display_commit2(p->display, COMMIT_ATOMIC); - igt_wait_for_vblank(p->display->drm_fd, p->pipe); + info_timestamp("end commit"); } static void repeat_flip(igt_pipe_t *p, struct igt_fb **fb_sets, @@ -185,6 +190,7 @@ static void repeat_flip(igt_pipe_t *p, struct igt_fb **fb_sets, struct histogram h; histogram_init(&h); + for (size_t iter = 0; iter < tuning->num_iterations; ++iter) { igt_debug("Iteration %zu\n", iter); @@ -306,7 +312,7 @@ void get_tuning(struct tuning *tuning, mode->hdisplay; } -int main(int argc, char **argv) +igt_main { igt_display_t display = {}; make_display(&display); |