summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlejandro Piñeiro <[email protected]>2019-07-04 14:11:27 +0200
committerAlejandro Piñeiro <[email protected]>2019-07-09 08:40:35 +0200
commit71446bf8e303089cf927412385e992fc70156261 (patch)
treecb34c81d52d0e00f1fba3e65efecf7a9481bcb51
parentb031dd901064c5c560e1fce17139b34e45579a60 (diff)
v3d: Early return with handle 0 when getting a bo on the simulator
Until now we were just asking entries on the bo hash table, and don't worry if the handle was NULL, as we were just expecting to get a NULL in return. It seems that now the hash table assert with some reserverd pointers, included NULL. This commit just early returns with handle 0. This change fixes several crashes on vk-gl-cts GLES tests when using the v3d simulator, like: KHR-GLES3.core.internalformat.copy_tex_image.* Reviewed-by: Eric Anholt <[email protected]>
-rw-r--r--src/gallium/drivers/v3d/v3d_simulator.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/gallium/drivers/v3d/v3d_simulator.c b/src/gallium/drivers/v3d/v3d_simulator.c
index 6e2d25e9448..039672d9ca2 100644
--- a/src/gallium/drivers/v3d/v3d_simulator.c
+++ b/src/gallium/drivers/v3d/v3d_simulator.c
@@ -289,6 +289,9 @@ v3d_free_simulator_bo(struct v3d_simulator_bo *sim_bo)
static struct v3d_simulator_bo *
v3d_get_simulator_bo(struct v3d_simulator_file *file, int gem_handle)
{
+ if (gem_handle == 0)
+ return NULL;
+
mtx_lock(&sim_state.mutex);
struct hash_entry *entry =
_mesa_hash_table_search(file->bo_map, int_to_key(gem_handle));