summaryrefslogtreecommitdiffstats
path: root/src/gallium
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2015-10-06 16:12:50 -0700
committerEric Anholt <[email protected]>2015-10-06 16:29:14 -0700
commit922e0680f9152aaacde12636d91b97346b05d61c (patch)
tree7ea1b3195d3f3f52867a8b80c33529616866cea1 /src/gallium
parent38610102137d546afc3f543604414f061f1aec88 (diff)
vc4: Fix a memory leak in the simulator case.
We validate per draw call, and need to free the shader per draw call, too.
Diffstat (limited to 'src/gallium')
-rw-r--r--src/gallium/drivers/vc4/vc4_simulator.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc4/vc4_simulator.c b/src/gallium/drivers/vc4/vc4_simulator.c
index 7cfd236349d..76980ca32af 100644
--- a/src/gallium/drivers/vc4/vc4_simulator.c
+++ b/src/gallium/drivers/vc4/vc4_simulator.c
@@ -106,10 +106,15 @@ vc4_simulator_unpin_bos(struct vc4_exec_info *exec)
{
for (int i = 0; i < exec->bo_count; i++) {
struct drm_gem_cma_object *obj = exec->bo[i];
- struct vc4_bo *bo = to_vc4_bo(&obj->base)->bo;
+ struct drm_vc4_bo *drm_bo = to_vc4_bo(&obj->base);
+ struct vc4_bo *bo = drm_bo->bo;
memcpy(bo->map, obj->vaddr, bo->size);
+ if (drm_bo->validated_shader) {
+ free(drm_bo->validated_shader->texture_samples);
+ free(drm_bo->validated_shader);
+ }
free(obj);
}