mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 03:08:05 +02:00
vulkan/wsi/x11: Use atomic_int with sent_image_count
Without this being atomically incremented and decremented, I observed
this assert triggering in debug builds:
src/vulkan/wsi/wsi_common_x11.c:x11_present_to_x11_dri3():
assert(chain->sent_image_count <= chain->base.image_count);
I think this was happening since,
src/vulkan/wsi/wsi_common_x11.c:x11_handle_dri3_present_event()
which decrements chain->sent_image_count may be run in a separate
thread.
Fixes: d0bc1ad377 ("vulkan/wsi/x11: add sent image counter")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15908>
This commit is contained in:
parent
b4bbf9d1ac
commit
212fb25b26
1 changed files with 2 additions and 1 deletions
|
|
@ -29,6 +29,7 @@
|
|||
#include <xcb/shm.h>
|
||||
|
||||
#include "util/macros.h"
|
||||
#include <stdatomic.h>
|
||||
#include <stdlib.h>
|
||||
#include <stdio.h>
|
||||
#include <unistd.h>
|
||||
|
|
@ -914,7 +915,7 @@ struct x11_swapchain {
|
|||
uint64_t send_sbc;
|
||||
uint64_t last_present_msc;
|
||||
uint32_t stamp;
|
||||
int sent_image_count;
|
||||
atomic_int sent_image_count;
|
||||
|
||||
bool has_present_queue;
|
||||
bool has_acquire_queue;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue