summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2018-08-24 15:45:37 -0700
committerEric Anholt <[email protected]>2018-09-07 08:11:38 -0700
commita91b158bd9e1b6bc08f1d5ac350cd8b68e372042 (patch)
tree037f5db2dcd704de69895912de71e9fb56a21eef
parentf73f748323ef5a421ffd8fa0f02afd9627e31023 (diff)
v3d: Fix setup of the VCM cache size.
There were two bugs working together to make things mostly work: I wasn't dividing the VPM output size available by the size of a batch (vertex), but I also had the size of the VPM reduced by a factor of 8. Fixes dEQP-GLES3.functional.vertex_array_objects.all_attributes and it seems also my intermittent varying failures. Fixes: 1561e4984eb0 ("v3d: Emit the VCM_CACHE_SIZE packet.")
-rw-r--r--src/broadcom/compiler/vir.c3
-rw-r--r--src/gallium/drivers/v3d/v3d_screen.c2
2 files changed, 3 insertions, 2 deletions
diff --git a/src/broadcom/compiler/vir.c b/src/broadcom/compiler/vir.c
index 1c8223165c6..6b55b0e03bc 100644
--- a/src/broadcom/compiler/vir.c
+++ b/src/broadcom/compiler/vir.c
@@ -774,7 +774,8 @@ uint64_t *v3d_compile_vs(const struct v3d_compiler *compiler,
int sector_size = 16 * sizeof(uint32_t) * 8;
int vpm_size_in_sectors = c->devinfo->vpm_size / sector_size;
int half_vpm = vpm_size_in_sectors / 2;
- int vpm_output_batches = half_vpm - prog_data->vpm_input_size;
+ int vpm_output_sectors = half_vpm - prog_data->vpm_input_size;
+ int vpm_output_batches = vpm_output_sectors / prog_data->vpm_output_size;
assert(vpm_output_batches >= 2);
prog_data->vcm_cache_size = CLAMP(vpm_output_batches - 1, 2, 4);
diff --git a/src/gallium/drivers/v3d/v3d_screen.c b/src/gallium/drivers/v3d/v3d_screen.c
index 252ebb379f8..efde220c891 100644
--- a/src/gallium/drivers/v3d/v3d_screen.c
+++ b/src/gallium/drivers/v3d/v3d_screen.c
@@ -438,7 +438,7 @@ v3d_get_device_info(struct v3d_screen *screen)
uint32_t minor = (ident1.value >> 0) & 0xf;
screen->devinfo.ver = major * 10 + minor;
- screen->devinfo.vpm_size = (ident1.value >> 28 & 0xf) * 1024;
+ screen->devinfo.vpm_size = (ident1.value >> 28 & 0xf) * 8192;
switch (screen->devinfo.ver) {
case 33: