summaryrefslogtreecommitdiff
path: root/sys/va
diff options
context:
space:
mode:
authorMatthew Waters <matthew@centricular.com>2021-03-22 14:34:36 +1100
committerTim-Philipp Müller <tim@centricular.com>2021-04-13 02:10:38 +0100
commit68858358544dd3b7e20663f731db22fd74a78a45 (patch)
tree838c387a26bc48a8ab97f4548fc70c85699cdaa6 /sys/va
parent9bdd40f43170aec317c5a6c2f98a4b4a99a9c138 (diff)
gst: don't use volatile to mean atomic
volatile is not sufficient to provide atomic guarantees and real atomics should be used instead. GCC 11 has started warning about using volatile with atomic operations. https://gitlab.gnome.org/GNOME/glib/-/merge_requests/1719 Discovered in https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/issues/868 Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-bad/-/merge_requests/2155>
Diffstat (limited to 'sys/va')
-rw-r--r--sys/va/gstvaallocator.c6
-rw-r--r--sys/va/gstvautils.c2
2 files changed, 4 insertions, 4 deletions
diff --git a/sys/va/gstvaallocator.c b/sys/va/gstvaallocator.c
index cd42ffb53..f003b1fba 100644
--- a/sys/va/gstvaallocator.c
+++ b/sys/va/gstvaallocator.c
@@ -56,14 +56,14 @@ struct _GstVaBufferSurface
{
GstVideoInfo info;
VASurfaceID surface;
- volatile gint ref_count;
+ gint ref_count;
};
static void
_init_debug_category (void)
{
#ifndef GST_DISABLE_GST_DEBUG
- static volatile gsize _init = 0;
+ static gsize _init = 0;
if (g_once_init_enter (&_init)) {
GST_DEBUG_CATEGORY_INIT (gst_va_memory_debug, "vamemory", 0, "VA memory");
@@ -573,7 +573,7 @@ struct _GstVaMemory
gpointer mapped_data;
GstMapFlags prev_mapflags;
- volatile gint map_count;
+ gint map_count;
gboolean is_derived;
gboolean is_dirty;
diff --git a/sys/va/gstvautils.c b/sys/va/gstvautils.c
index 95bfaee44..ad2ad22fc 100644
--- a/sys/va/gstvautils.c
+++ b/sys/va/gstvautils.c
@@ -32,7 +32,7 @@ static void
_init_context_debug (void)
{
#ifndef GST_DISABLE_GST_DEBUG
- static volatile gsize _init = 0;
+ static gsize _init = 0;
if (g_once_init_enter (&_init)) {
GST_DEBUG_CATEGORY_GET (GST_CAT_CONTEXT, "GST_CONTEXT");