On Thursday, November 16, 2017 2:10:54 AM JST, Gustavo Padovan wrote:
From: Javier Martinez Canillas <javier@xxxxxxxxxxxxxxx>
Add a videobuf2-fence.h header file that contains different helpers
for DMA buffer sharing explicit fence support in videobuf2.
v2: - use fence context provided by the caller in vb2_fence_alloc()
Signed-off-by: Javier Martinez Canillas <javier@xxxxxxxxxxxxxxx> ...
It is probably not a good idea to define that struct here since it will be
deduplicated for every source file that includes it.
Maybe change it to a simple declaration, and move the definition to
videobuf2-core.c or a dedicated videobuf2-fence.c file?
+
+static inline struct dma_fence *vb2_fence_alloc(u64 context)
+{
+ struct dma_fence *vb2_fence = kzalloc(sizeof(*vb2_fence), GFP_KERNEL);
+ ...
Not sure we gain a lot by having this function static inline, but your call.