summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/v3d/v3dx_draw.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2019-03-29 15:38:15 -0700
committerEric Anholt <[email protected]>2019-04-04 17:30:35 -0700
commit62360e92ec97d59389330a5aeb070416523da774 (patch)
tree975d270e62517ea2c67cae69620580672219a6c3 /src/gallium/drivers/v3d/v3dx_draw.c
parente3063a8b2fd7364c9beeb059599a7d4e62c9b4c5 (diff)
v3d: Bump the maximum texture size to 4k for V3D 4.x.
4.1 and 4.2 both have the same 16k limit, but it I'm seeing GPU hangs in the CTS at 8k and 16k. 4k at least lets us get one 4k display working. Cc: [email protected]
Diffstat (limited to 'src/gallium/drivers/v3d/v3dx_draw.c')
-rw-r--r--src/gallium/drivers/v3d/v3dx_draw.c23
1 files changed, 22 insertions, 1 deletions
diff --git a/src/gallium/drivers/v3d/v3dx_draw.c b/src/gallium/drivers/v3d/v3dx_draw.c
index ebdc436318d..14e85e78485 100644
--- a/src/gallium/drivers/v3d/v3dx_draw.c
+++ b/src/gallium/drivers/v3d/v3dx_draw.c
@@ -55,7 +55,28 @@ v3d_start_draw(struct v3d_context *v3d)
job->submit.bcl_start = job->bcl.bo->offset;
v3d_job_add_bo(job, job->bcl.bo);
- job->tile_alloc = v3d_bo_alloc(v3d->screen, 1024 * 1024, "tile_alloc");
+ /* The PTB will request the tile alloc initial size per tile at start
+ * of tile binning.
+ */
+ uint32_t tile_alloc_size = (job->draw_tiles_x *
+ job->draw_tiles_y) * 64;
+ /* The PTB allocates in aligned 4k chunks after the initial setup. */
+ tile_alloc_size = align(tile_alloc_size, 4096);
+
+ /* Include the first two chunk allocations that the PTB does so that
+ * we definitely clear the OOM condition before triggering one (the HW
+ * won't trigger OOM during the first allocations).
+ */
+ tile_alloc_size += 8192;
+
+ /* For performance, allocate some extra initial memory after the PTB's
+ * minimal allocations, so that we hopefully don't have to block the
+ * GPU on the kernel handling an OOM signal.
+ */
+ tile_alloc_size += 512 * 1024;
+
+ job->tile_alloc = v3d_bo_alloc(v3d->screen, tile_alloc_size,
+ "tile_alloc");
uint32_t tsda_per_tile_size = v3d->screen->devinfo.ver >= 40 ? 256 : 64;
job->tile_state = v3d_bo_alloc(v3d->screen,
job->draw_tiles_y *