mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-06-22 15:26:21 +00:00
benchmarks/gem_exec_trace: Clear all new bo handles
When reallocing the bo array, remember to set the new entries to 0. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
4c74a683c1
commit
d9462e61f9
@ -103,9 +103,11 @@ static void *add_bo(void *ptr)
|
|||||||
struct trace_add_bo *t = ptr;
|
struct trace_add_bo *t = ptr;
|
||||||
uint32_t bb = 0xa << 23;
|
uint32_t bb = 0xa << 23;
|
||||||
|
|
||||||
if (t->handle > num_bo) {
|
if (t->handle >= num_bo) {
|
||||||
num_bo = (t->handle + 4095) & -4096;
|
int new_bo = (t->handle + 4096) & -4096;
|
||||||
bo = realloc(bo, sizeof(*bo)*num_bo);
|
bo = realloc(bo, sizeof(*bo)*new_bo);
|
||||||
|
memset(bo + num_bo, 0, sizeof(*bo)*(new_bo - num_bo));
|
||||||
|
num_bo = new_bo;
|
||||||
}
|
}
|
||||||
|
|
||||||
bo[t->handle].handle = gem_create(fd, t->size);
|
bo[t->handle].handle = gem_create(fd, t->size);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user