Mesa (master): v3d: Clear the GMP on initialization of the simulator.
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Tue Feb 19 05:43:10 UTC 2019
Module: Mesa
Branch: master
Commit: 32f16b0b1e1ddaa7b7ab318d9b8323a941887384
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=32f16b0b1e1ddaa7b7ab318d9b8323a941887384
Author: Eric Anholt <eric at anholt.net>
Date: Wed Jan 30 16:22:02 2019 -0800
v3d: Clear the GMP on initialization of the simulator.
Otherwise, we might have pages accessible that shouldn't be and miss out
on errors. This is unlikely for most tests since v3d_hw_get_mem() is big
enough that it'll be a freshly zeroed mmap, but if screens are destroyed
and recreated then we'd be reusing the old v3d_hw_get_mem() contents.
---
src/gallium/drivers/v3d/v3d_simulator.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/src/gallium/drivers/v3d/v3d_simulator.c b/src/gallium/drivers/v3d/v3d_simulator.c
index b0b4c103623..c5ddaa03103 100644
--- a/src/gallium/drivers/v3d/v3d_simulator.c
+++ b/src/gallium/drivers/v3d/v3d_simulator.c
@@ -580,6 +580,7 @@ v3d_simulator_init(struct v3d_screen *screen)
sim_file->gmp = u_mmAllocMem(sim_state.heap, 8096, GMP_ALIGN2, 0);
sim_file->gmp_vaddr = (sim_state.mem + sim_file->gmp->ofs -
sim_state.mem_base);
+ memset(sim_file->gmp_vaddr, 0, 8096);
}
void
More information about the mesa-commit
mailing list