vc4: Throttle outstanding rendering after submission.
authorEric Anholt <eric@anholt.net>
Tue, 26 Jan 2016 18:34:42 +0000 (10:34 -0800)
committerEric Anholt <eric@anholt.net>
Thu, 28 Jan 2016 04:05:37 +0000 (20:05 -0800)
Just make sure that after we've submitted, we get to at least 5
(global) submits ago before we go on to do more.  Prevents up to
seconds of lag with window movement in X with xcompmgr -c.  There may
be useful tuning to do in the future, but for now this gets us
usability.

Cc: "11.0 11.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
src/gallium/drivers/vc4/vc4_job.c

index e7b52e319f4bac1f14984d9ad469ffc1b9dae799..41660f6ac4daffef78ecddb32dc2be651a7ab6ff 100644 (file)
@@ -250,6 +250,15 @@ vc4_job_submit(struct vc4_context *vc4)
                 }
         }
 
+        if (vc4->last_emit_seqno - vc4->screen->finished_seqno > 5) {
+                if (!vc4_wait_seqno(vc4->screen,
+                                    vc4->last_emit_seqno - 5,
+                                    PIPE_TIMEOUT_INFINITE,
+                                    "job throttling")) {
+                        fprintf(stderr, "Job throttling failed\n");
+                }
+        }
+
         if (vc4_debug & VC4_DEBUG_ALWAYS_SYNC) {
                 if (!vc4_wait_seqno(vc4->screen, vc4->last_emit_seqno,
                                     PIPE_TIMEOUT_INFINITE, "sync")) {