diff options
| author | Dylan Baker <dylan.c.baker@intel.com> | 2025-09-25 18:46:44 +0000 |
|---|---|---|
| committer | Marge Bot <marge-bot@fdo.invalid> | 2025-11-03 20:00:31 +0000 |
| commit | 74018f41ab469641091514767ea02e793e645601 (patch) | |
| tree | 44615e6a16f8bdd704b16ba1d280960cccac43f9 /src/intel/vulkan | |
| parent | aa28fcb6105d4504850cf649e483289a86f37605 (diff) | |
anv: try to help coverity understand we're not racing
Coverity notices that in this case part of the decision to go down the
locked path invovles reading a flag, which is turn set inside the
protected code. Additional threads can decide they need to go down the
locked path, and then wait on the lock, even though the first thread
willse the device_registered to true, which would have otherwise
prevented them from going down the locked path.
What Coverity doesn't know, is that it is a violation of the Vulkan API
contract to call this function from two different threads, so in
practice that cann't happen. We'll move the setting of the
image_device_registered out of the locked area to see if that pacifies
Coverity, and if not then we'll just ignore it.
CID: 1662067
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37582>
Diffstat (limited to 'src/intel/vulkan')
| -rw-r--r-- | src/intel/vulkan/anv_image.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/intel/vulkan/anv_image.c b/src/intel/vulkan/anv_image.c index 94d65611cee..48fc61f2de5 100644 --- a/src/intel/vulkan/anv_image.c +++ b/src/intel/vulkan/anv_image.c @@ -3151,8 +3151,8 @@ anv_bind_image_memory(struct anv_device *device, !image->device_registered) { pthread_mutex_lock(&device->mutex); list_addtail(&image->link, &device->image_private_objects); - image->device_registered = true; pthread_mutex_unlock(&device->mutex); + image->device_registered = true; } if (bind_status) |