vc4: Flush the job early if we're referencing too many BOs.
authorEric Anholt <eric@anholt.net>
Wed, 4 Jan 2017 19:24:31 +0000 (11:24 -0800)
committerEric Anholt <eric@anholt.net>
Fri, 6 Jan 2017 00:23:32 +0000 (16:23 -0800)
commitebf33e577aee00cf888c79e11a3b62c181b46510
tree142adc22f4a46af254f8a2a38101ef90f844b38c
parent076ab157ff2ed7a98b09363bce355247f4ed71e6
vc4: Flush the job early if we're referencing too many BOs.

If we get up toward 256MB (or whatever the CMA area size is),
VC4_GEM_CREATE will start throwing errors.  Even if we don't trigger
that, when we flush the kernel's BO allocation for the CLs or bin
memory may end up throwing an error, at which point our job won't get
rendered at all.

Just flush early (half of maximum CMA size) so that hopefully we never
get to that point.
src/gallium/drivers/vc4/vc4_cl.c
src/gallium/drivers/vc4/vc4_context.h
src/gallium/drivers/vc4/vc4_draw.c