XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Functions
dma-fence-unwrap.h File Reference

Go to the source code of this file.

Classes

struct  dma_fence_unwrap
 

Macros

#define dma_fence_unwrap_for_each(fence, cursor, head)
 
#define dma_fence_unwrap_merge(...)
 

Functions

struct dma_fence * dma_fence_unwrap_first (struct dma_fence *head, struct dma_fence_unwrap *cursor)
 
struct dma_fence * dma_fence_unwrap_next (struct dma_fence_unwrap *cursor)
 
struct dma_fence * __dma_fence_unwrap_merge (unsigned int num_fences, struct dma_fence **fences, struct dma_fence_unwrap *cursors)
 
int dma_fence_dedup_array (struct dma_fence **array, int num_fences)
 

Macro Definition Documentation

◆ dma_fence_unwrap_for_each

#define dma_fence_unwrap_for_each (   fence,
  cursor,
  head 
)
Value:
for (fence = dma_fence_unwrap_first(head, cursor); fence; \
struct dma_fence * dma_fence_unwrap_next(struct dma_fence_unwrap *cursor)
struct dma_fence * dma_fence_unwrap_first(struct dma_fence *head, struct dma_fence_unwrap *cursor)
struct drm_crtc struct drm_plane struct drm_plane * cursor
Definition drm_crtc.h:1240
int const struct list_head const struct list_head struct list_head * head
Definition list_sort.h:13

dma_fence_unwrap_for_each - iterate over all fences in containers @fence: current fence @cursor: current position inside the containers @head: starting point for the iterator

Unwrap dma_fence_chain and dma_fence_array containers and deep dive into all potential fences in them. If @head is just a normal fence only that one is returned.

◆ dma_fence_unwrap_merge

#define dma_fence_unwrap_merge (   ...)
Value:
({ \
struct dma_fence *__f[] = { __VA_ARGS__ }; \
struct dma_fence_unwrap __c[ARRAY_SIZE(__f)]; \
\
__dma_fence_unwrap_merge(ARRAY_SIZE(__f), __f, __c); \
})
#define ARRAY_SIZE(arr)
Definition bordoisila_bits.h:61
Definition dma-fence-unwrap.h:18
Definition dma-fence.h:70

dma_fence_unwrap_merge - unwrap and merge fences

All fences given as parameters are unwrapped and merged back together as flat dma_fence_array. Useful if multiple containers need to be merged together.

Implemented as a macro to allocate the necessary arrays on the stack and account the stack frame size to the caller.

Returns NULL on memory allocation failure, a dma_fence object representing all the given fences otherwise.

Function Documentation

◆ __dma_fence_unwrap_merge()

struct dma_fence * __dma_fence_unwrap_merge ( unsigned int  num_fences,
struct dma_fence **  fences,
struct dma_fence_unwrap *  cursors 
)

◆ dma_fence_dedup_array()

int dma_fence_dedup_array ( struct dma_fence **  array,
int  num_fences 
)

◆ dma_fence_unwrap_first()

struct dma_fence * dma_fence_unwrap_first ( struct dma_fence *  head,
struct dma_fence_unwrap *  cursor 
)

◆ dma_fence_unwrap_next()

struct dma_fence * dma_fence_unwrap_next ( struct dma_fence_unwrap *  cursor)