summaryrefslogtreecommitdiffstats
path: root/src/gallium/drivers/vc4/vc4_cl.c
diff options
context:
space:
mode:
authorEric Anholt <[email protected]>2014-12-14 20:41:25 -0800
committerEric Anholt <[email protected]>2014-12-14 23:12:11 -0800
commit667719fcb2296d73e1897d4071da6dd30b2cc6ac (patch)
tree9d91ae2a577fa89b52baf67be0dcaf2cfa8d3e00 /src/gallium/drivers/vc4/vc4_cl.c
parent1f1ca8b2ea80f6b538b7f7c0de2ebe8eba862edc (diff)
vc4: Fix leaks of the CL contents.
Diffstat (limited to 'src/gallium/drivers/vc4/vc4_cl.c')
-rw-r--r--src/gallium/drivers/vc4/vc4_cl.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/gallium/drivers/vc4/vc4_cl.c b/src/gallium/drivers/vc4/vc4_cl.c
index 29b956e6e9a..36dd28c48c0 100644
--- a/src/gallium/drivers/vc4/vc4_cl.c
+++ b/src/gallium/drivers/vc4/vc4_cl.c
@@ -22,11 +22,14 @@
*/
#include "util/u_math.h"
+#include "util/ralloc.h"
#include "vc4_context.h"
void
vc4_init_cl(struct vc4_context *vc4, struct vc4_cl *cl)
{
+ cl->base = ralloc_size(vc4, 1);
+ cl->end = cl->next = cl->base;
}
void
@@ -35,7 +38,7 @@ vc4_grow_cl(struct vc4_cl *cl)
uint32_t size = MAX2((cl->end - cl->base) * 2, 4096);
uint32_t offset = cl->next -cl->base;
- cl->base = realloc(cl->base, size);
+ cl->base = reralloc(ralloc_parent(cl->base), cl->base, uint8_t, size);
cl->end = cl->base + size;
cl->next = cl->base + offset;
}