diff options
author | Eric Anholt <[email protected]> | 2014-08-05 10:54:56 -0700 |
---|---|---|
committer | Eric Anholt <[email protected]> | 2014-08-11 14:45:32 -0700 |
commit | ed5cb5d7d5d3d3cfeafcf67b2020044da9825abe (patch) | |
tree | a221b11744919e69a64dfcb9162d795f3d1a96b1 | |
parent | f5f8dd29c30e727c10ff087321d87c40c064de04 (diff) |
vc4: Improve simulator memory allocation.
This should reduce a bunch of spurious failures in sim.
-rw-r--r-- | src/gallium/drivers/vc4/vc4_simulator.c | 24 |
1 files changed, 20 insertions, 4 deletions
diff --git a/src/gallium/drivers/vc4/vc4_simulator.c b/src/gallium/drivers/vc4/vc4_simulator.c index fc3d554a3ec..827d6179c86 100644 --- a/src/gallium/drivers/vc4/vc4_simulator.c +++ b/src/gallium/drivers/vc4/vc4_simulator.c @@ -32,6 +32,8 @@ #include "vc4_simulator_validate.h" #include "simpenrose/simpenrose.h" +#define OVERFLOW_SIZE (32 * 1024 * 1024) + static struct drm_gem_cma_object * vc4_wrap_bo_with_cma(struct drm_device *dev, struct vc4_bo *bo) { @@ -234,7 +236,7 @@ vc4_simulator_flush(struct vc4_context *vc4, struct drm_vc4_submit_cl *args, struct exec_info exec; struct drm_device local_dev = { .vc4 = vc4, - .simulator_mem_next = 0, + .simulator_mem_next = OVERFLOW_SIZE, }; struct drm_device *dev = &local_dev; int ret; @@ -290,9 +292,23 @@ vc4_simulator_flush(struct vc4_context *vc4, struct drm_vc4_submit_cl *args, void vc4_simulator_init(struct vc4_screen *screen) { - simpenrose_init_hardware(); - screen->simulator_mem_base = simpenrose_get_mem_start(); - screen->simulator_mem_size = simpenrose_get_mem_size(); + screen->simulator_mem_size = 256 * 1024 * 1024; + screen->simulator_mem_base = malloc(screen->simulator_mem_size); + + /* We supply our own memory so that we can have more aperture + * available (256MB instead of simpenrose's default 64MB). + */ + simpenrose_init_hardware_supply_mem(screen->simulator_mem_base, + screen->simulator_mem_size); + + /* Carve out low memory for tile allocation overflow. The kernel + * should be automatically handling overflow memory setup on real + * hardware, but for simulation we just get one shot to set up enough + * overflow memory before execution. This overflow mem will be used + * up over the whole lifetime of simpenrose (not reused on each + * flush), so it had better be big. + */ + simpenrose_supply_overflow_mem(0, OVERFLOW_SIZE); } #endif /* USE_VC4_SIMULATOR */ |