diff options
author | Eric Anholt <[email protected]> | 2017-11-07 11:05:16 -0800 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2017-11-07 12:58:03 -0800 |
commit | 3bfcd31e9816813dad0ef7ec82b0fb62dd0271a0 (patch) | |
tree | f2233511f9f31a312e4079abb143922ef349b2e5 /src/gallium/drivers/vc5/vc5_draw.c | |
parent | 50906e4583357920b49c78c25787403c5b4836d0 (diff) |
braodcom/vc5: Flush the job when it grows over 1GB.
Fixes GL_OUT_OF_MEMORY from streaming-texture-leak (and will hopefully
keep piglit from ooming on my no-swap platform, as well).
Diffstat (limited to 'src/gallium/drivers/vc5/vc5_draw.c')
-rw-r--r-- | src/gallium/drivers/vc5/vc5_draw.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gallium/drivers/vc5/vc5_draw.c b/src/gallium/drivers/vc5/vc5_draw.c index 6f45b634055..f834207863d 100644 --- a/src/gallium/drivers/vc5/vc5_draw.c +++ b/src/gallium/drivers/vc5/vc5_draw.c @@ -479,6 +479,12 @@ vc5_draw_vbo(struct pipe_context *pctx, const struct pipe_draw_info *info) vc5_job_add_bo(job, rsc->bo); } + if (job->referenced_size > 768 * 1024 * 1024) { + perf_debug("Flushing job with %dkb to try to free up memory\n", + job->referenced_size / 1024); + vc5_flush(pctx); + } + if (V3D_DEBUG & V3D_DEBUG_ALWAYS_FLUSH) vc5_flush(pctx); } |