aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_simulator.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-08-01 20:23:31 -0700
committerEric Anholt <[email protected]>2014-08-11 14:45:31 -0700
commitb6caa9556c7c1cf9206ac610fb57587ad119d3ab (patch)
treef3b1b7f452eaaa88dabd8278db0b3c0c0053fd0e /src/gallium/drivers/vc4/vc4_simulator.c
parentfa26d334cbebf51bcfea7c020057af9b1907b376 (diff)
vc4: Validate that the same BO doesn't get reused for different purposes.
We don't care if things like vertex data get smashed by render target data, but we do need to make sure that shader code doesn't get rendered to. v2: Fix overflowing read of gl_relocs[] that incorrect flagged of some VBOs as shader code.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_simulator.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_simulator.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/gallium/drivers/vc4/vc4_simulator.c b/src/gallium/drivers/vc4/vc4_simulator.c
index b2f2b669dc9..88eda4fe722 100644
--- a/src/gallium/drivers/vc4/vc4_simulator.c
+++ b/src/gallium/drivers/vc4/vc4_simulator.c
@@ -70,16 +70,15 @@ vc4_simulator_pin_bos(struct drm_device *dev, struct exec_info *exec)
struct vc4_bo **bos = vc4->bo_pointers.base;
exec->bo_count = args->bo_handle_count;
- exec->bo = calloc(exec->bo_count, sizeof(void *));
+ exec->bo = calloc(exec->bo_count, sizeof(struct vc4_bo_exec_state));
for (int i = 0; i < exec->bo_count; i++) {
struct vc4_bo *bo = bos[i];
struct drm_gem_cma_object *obj = vc4_wrap_bo_with_cma(dev, bo);
memcpy(obj->vaddr, bo->map, bo->size);
- exec->bo[i] = obj;
+ exec->bo[i].bo = obj;
}
-
return 0;
}
@@ -87,7 +86,7 @@ static int
vc4_simulator_unpin_bos(struct exec_info *exec)
{
for (int i = 0; i < exec->bo_count; i++) {
- struct drm_gem_cma_object *obj = exec->bo[i];
+ struct drm_gem_cma_object *obj = exec->bo[i].bo;
struct vc4_bo *bo = obj->bo;
memcpy(bo->map, obj->vaddr, bo->size);