[Bug 789952] fbmemory: need unmap if mapping flags are not subset of previous

GStreamer (GNOME Bugzilla) bugzilla at gnome.org
Mon Nov 6 09:02:14 UTC 2017


https://bugzilla.gnome.org/show_bug.cgi?id=789952

--- Comment #3 from Haihua Hu <jared.hu at nxp.com> ---
(In reply to Matthew Waters (ystreet00) from comment #2)
> Review of attachment 363033 [details] [review]:
> 
> What's the exact sequence of events you're attempting to allow?
> 
> e.g.
> gst_memory_map(READ)
> gst_memory_map(WRITE)
> gst_memory_unmap(READ)
> gst_memory_unmap(WRITE)
> 
> or,
> 
> gst_memory_map(READ)
> gst_memory_unmap(READ)
> gst_memory_map(WRITE)
> gst_memory_unmap(WRITE)
> 
> The first is unsupported and should return NULL.  The second is valid usage
> though.

the second one actually. But dmabuf allocator set the keep mapped flag, so when
do gst_memory_unmap(READ) it just return and do nothing. Which will cause the
write map fail

> 
> ::: gst-libs/gst/allocators/gstfdmemory.c
> @@ +103,3 @@
> +      munmap ((void *) mem->data, gmem->maxsize);
> +      mem->data = NULL;
> +      mem->mmap_count = 0;;
> 
> And how do we know that this is safe?  i.e. another user does not have
> another mapping?

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.


More information about the gstreamer-bugs mailing list