aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-01-22 11:05:56 -0800
committerEric Anholt <[email protected]>2019-01-27 08:30:03 -0800
commitedb1fcd9637a3a590d7eb436349855d009e62a98 (patch)
tree5a2a51f4592fc9ac25c66e6fc0ffd04bf824ade8 /src/gallium/drivers
parentac333ffa59344a4448d6d6cd44aa1ffa4c1285f7 (diff)
v3d: Flush blit jobs immediately after generating them.
Fixes OOMs in the CTS's packed_pixels.varied_rectangle.* tests -- the series of texture uploads at the start before texturing occurred would end up all sitting around as cached jobs for reuse. By flushing immediately, peak active BO usage goes from 150M to 40M. We could maybe put some limits on how many jobs we keep around, but blits seem particularly unlikely to get reused for other drawing.
Diffstat (limited to 'src/gallium/drivers')
-rw-r--r--src/gallium/drivers/v3d/v3d_blit.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/gallium/drivers/v3d/v3d_blit.c b/src/gallium/drivers/v3d/v3d_blit.c
index 7662c63d8fe..2f36bdd46e3 100644
--- a/src/gallium/drivers/v3d/v3d_blit.c
+++ b/src/gallium/drivers/v3d/v3d_blit.c
@@ -517,6 +517,7 @@ v3d_tfu_blit(struct pipe_context *pctx, const struct pipe_blit_info *info)
void
v3d_blit(struct pipe_context *pctx, const struct pipe_blit_info *blit_info)
{
+ struct v3d_context *v3d = v3d_context(pctx);
struct pipe_blit_info info = *blit_info;
if (info.mask & PIPE_MASK_S) {
@@ -529,4 +530,11 @@ v3d_blit(struct pipe_context *pctx, const struct pipe_blit_info *blit_info)
if (info.mask)
v3d_render_blit(pctx, &info);
+
+ /* Flush our blit jobs immediately. They're unlikely to get reused by
+ * normal drawing or other blits, and without flushing we can easily
+ * run into unexpected OOMs when blits are used for a large series of
+ * texture uploads before using the textures.
+ */
+ v3d_flush_jobs_writing_resource(v3d, info.dst.resource);
}