Revert "fdmem: always map dmabuf with PROT_WRITE"
Will be replaced with a similar change.
BUG: 148221549
This reverts commit 221717a7f60b4793007077e3aa7fe29bc1dc11eb.
Change-Id: I52f3ecaafcd58fe95318f6229f1c81508fdd0c8c
diff --git a/gst-libs/gst/allocators/gstdmabuf.c b/gst-libs/gst/allocators/gstdmabuf.c
index c2175c0..a9a0775 100644
--- a/gst-libs/gst/allocators/gstdmabuf.c
+++ b/gst-libs/gst/allocators/gstdmabuf.c
@@ -100,8 +100,7 @@
{
g_return_val_if_fail (GST_IS_DMABUF_ALLOCATOR (allocator), NULL);
- return gst_fd_allocator_alloc (allocator, fd, size,
- GST_FD_MEMORY_FLAG_KEEP_MAPPED | GST_FD_MEMORY_FLAG_PROT_WRITE);
+ return gst_fd_allocator_alloc (allocator, fd, size, GST_FD_MEMORY_FLAG_KEEP_MAPPED);
}
/**
diff --git a/gst-libs/gst/allocators/gstfdmemory.c b/gst-libs/gst/allocators/gstfdmemory.c
index 6b1632c..ee2b945 100644
--- a/gst-libs/gst/allocators/gstfdmemory.c
+++ b/gst-libs/gst/allocators/gstfdmemory.c
@@ -88,7 +88,6 @@
prot = flags & GST_MAP_READ ? PROT_READ : 0;
prot |= flags & GST_MAP_WRITE ? PROT_WRITE : 0;
- prot |= mem->flags & GST_FD_MEMORY_FLAG_PROT_WRITE ? PROT_WRITE : 0;
g_mutex_lock (&mem->lock);
/* do not mmap twice the buffer */
diff --git a/gst-libs/gst/allocators/gstfdmemory.h b/gst-libs/gst/allocators/gstfdmemory.h
index 6cdc605..6693593 100644
--- a/gst-libs/gst/allocators/gstfdmemory.h
+++ b/gst-libs/gst/allocators/gstfdmemory.h
@@ -58,7 +58,6 @@
GST_FD_MEMORY_FLAG_KEEP_MAPPED = (1 << 0),
GST_FD_MEMORY_FLAG_MAP_PRIVATE = (1 << 1),
GST_FD_MEMORY_FLAG_DONT_CLOSE = (1 << 2),
- GST_FD_MEMORY_FLAG_PROT_WRITE = (1 << 31),
} GstFdMemoryFlags;
/**