anv: fix uninitialized variable access
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Thu, 9 Jul 2020 15:12:17 +0000 (18:12 +0300)
committerMarge Bot <eric+marge@anholt.net>
Fri, 10 Jul 2020 17:54:35 +0000 (17:54 +0000)
commit40a6de176d0f4ffa9fcad8f2c8ab30a7e8cfe807
tree221c9b3b88cf1c7c0d696537111b938b8b958b94
parente3ddba73241901a75844b39e6e3b12eaf15f9b26
anv: fix uninitialized variable access

Found with valgrind :

  ==415016== Conditional jump or move depends on uninitialised value(s)
  ==415016==    at 0x513C22B: anv_cache_lock (anv_pipeline_cache.c:346)
  ==415016==    by 0x513C2A0: anv_pipeline_cache_search (anv_pipeline_cache.c:364)
  ==415016==    by 0x50E7C88: lookup_blorp_shader (anv_blorp.c:38)
  ==415016==    by 0x5D20A98: blorp_params_get_clear_kernel (blorp_clear.c:60)
  ==415016==    by 0x5D23EFD: blorp_ccs_ambiguate (blorp_clear.c:1358)
  ==415016==    by 0x50EDE25: anv_image_ccs_op (anv_blorp.c:1882)
  ==415016==    by 0x555D92F: transition_color_buffer (genX_cmd_buffer.c:1179)
  ==415016==    by 0x5598B71: cmd_buffer_begin_subpass (genX_cmd_buffer.c:5060)
  ==415016==    by 0x559AB00: gen9_CmdBeginRenderPass (genX_cmd_buffer.c:5772)
  ==415016==    by 0x11DACE: begin_render_pass (vr-test.c:375)
  ==415016==    by 0x11DF55: set_state (vr-test.c:529)
  ==415016==    by 0x11F7A1: clear (vr-test.c:1228)

v2: Don't break external sync feature

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5823>
src/intel/vulkan/anv_device.c
src/intel/vulkan/anv_pipeline_cache.c
src/intel/vulkan/anv_private.h