XenevaOS
Loading...
Searching...
No Matches
Classes | Macros | Typedefs | Enumerations | Functions | Variables
dma-fence.h File Reference
#include <linux/err.h>
#include <linux/wait.h>
#include <linux/list.h>
#include <linux/bitops.h>
#include <linux/kref.h>
#include <linux/sched.h>
#include <linux/printk.h>
#include <linux/rcupdate.h>
#include <linux/timekeeping.h>
Include dependency graph for dma-fence.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  dma_fence
 
struct  dma_fence_cb
 
struct  dma_fence_ops
 

Macros

#define dma_fence_lock_irqsave(fence, flags)    spin_lock_irqsave(dma_fence_spinlock(fence), flags)
 
#define dma_fence_unlock_irqrestore(fence, flags)    spin_unlock_irqrestore(dma_fence_spinlock(fence), flags)
 
#define dma_fence_assert_held(fence)    lockdep_assert_held(dma_fence_spinlock(fence));
 

Typedefs

typedef void(* dma_fence_func_t) (struct dma_fence *fence, struct dma_fence_cb *cb)
 

Enumerations

enum  dma_fence_flag_bits {
  DMA_FENCE_FLAG_INITIALIZED_BIT , DMA_FENCE_FLAG_INLINE_LOCK_BIT , DMA_FENCE_FLAG_SEQNO64_BIT , DMA_FENCE_FLAG_SIGNALED_BIT ,
  DMA_FENCE_FLAG_TIMESTAMP_BIT , DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT , DMA_FENCE_FLAG_USER_BITS
}
 

Functions

void dma_fence_init (struct dma_fence *fence, const struct dma_fence_ops *ops, spinlock_t *lock, u64 context, u64 seqno)
 
void dma_fence_init64 (struct dma_fence *fence, const struct dma_fence_ops *ops, spinlock_t *lock, u64 context, u64 seqno)
 
void dma_fence_release (struct kref *kref)
 
void dma_fence_free (struct dma_fence *fence)
 
void dma_fence_describe (struct dma_fence *fence, struct seq_file *seq)
 
void dma_fence_signal (struct dma_fence *fence)
 
bool dma_fence_check_and_signal (struct dma_fence *fence)
 
bool dma_fence_check_and_signal_locked (struct dma_fence *fence)
 
void dma_fence_signal_locked (struct dma_fence *fence)
 
void dma_fence_signal_timestamp (struct dma_fence *fence, ktime_t timestamp)
 
void dma_fence_signal_timestamp_locked (struct dma_fence *fence, ktime_t timestamp)
 
signed long dma_fence_default_wait (struct dma_fence *fence, bool intr, signed long timeout)
 
int dma_fence_add_callback (struct dma_fence *fence, struct dma_fence_cb *cb, dma_fence_func_t func)
 
bool dma_fence_remove_callback (struct dma_fence *fence, struct dma_fence_cb *cb)
 
void dma_fence_enable_sw_signaling (struct dma_fence *fence)
 
const char __rcu * dma_fence_driver_name (struct dma_fence *fence)
 
const char __rcu * dma_fence_timeline_name (struct dma_fence *fence)
 
int dma_fence_get_status (struct dma_fence *fence)
 
signed long dma_fence_wait_timeout (struct dma_fence *, bool intr, signed long timeout)
 
signed long dma_fence_wait_any_timeout (struct dma_fence **fences, uint32_t count, bool intr, signed long timeout, uint32_t *idx)
 
void dma_fence_set_deadline (struct dma_fence *fence, ktime_t deadline)
 
struct dma_fence * dma_fence_get_stub (void)
 
struct dma_fence * dma_fence_allocate_private_stub (ktime_t timestamp)
 
u64 dma_fence_context_alloc (unsigned num)
 

Variables

const struct dma_fence_ops dma_fence_array_ops
 
const struct dma_fence_ops dma_fence_chain_ops
 

Macro Definition Documentation

◆ dma_fence_assert_held

#define dma_fence_assert_held (   fence)     lockdep_assert_held(dma_fence_spinlock(fence));

dma_fence_assert_held - lockdep assertion that fence is locked @fence: the fence which should be locked

◆ dma_fence_lock_irqsave

#define dma_fence_lock_irqsave (   fence,
  flags 
)     spin_lock_irqsave(dma_fence_spinlock(fence), flags)

dma_fence_lock_irqsave - irqsave lock the fence @fence: the fence to lock @flags: where to store the CPU flags.

Lock the fence, preventing it from changing to the signaled state.

◆ dma_fence_unlock_irqrestore

#define dma_fence_unlock_irqrestore (   fence,
  flags 
)     spin_unlock_irqrestore(dma_fence_spinlock(fence), flags)

dma_fence_unlock_irqrestore - unlock the fence and irqrestore @fence: the fence to unlock @flags: the CPU flags to restore

Unlock the fence, allowing it to change its state to signaled again.

Typedef Documentation

◆ dma_fence_func_t

typedef void(* dma_fence_func_t) (struct dma_fence *fence, struct dma_fence_cb *cb)

Enumeration Type Documentation

◆ dma_fence_flag_bits

Enumerator
DMA_FENCE_FLAG_INITIALIZED_BIT 
DMA_FENCE_FLAG_INLINE_LOCK_BIT 
DMA_FENCE_FLAG_SEQNO64_BIT 
DMA_FENCE_FLAG_SIGNALED_BIT 
DMA_FENCE_FLAG_TIMESTAMP_BIT 
DMA_FENCE_FLAG_ENABLE_SIGNAL_BIT 
DMA_FENCE_FLAG_USER_BITS 

Function Documentation

◆ dma_fence_add_callback()

int dma_fence_add_callback ( struct dma_fence *  fence,
struct dma_fence_cb *  cb,
dma_fence_func_t  func 
)

◆ dma_fence_allocate_private_stub()

struct dma_fence * dma_fence_allocate_private_stub ( ktime_t  timestamp)

◆ dma_fence_check_and_signal()

bool dma_fence_check_and_signal ( struct dma_fence *  fence)

◆ dma_fence_check_and_signal_locked()

bool dma_fence_check_and_signal_locked ( struct dma_fence *  fence)

◆ dma_fence_context_alloc()

u64 dma_fence_context_alloc ( unsigned  num)

◆ dma_fence_default_wait()

signed long dma_fence_default_wait ( struct dma_fence *  fence,
bool  intr,
signed long  timeout 
)

◆ dma_fence_describe()

void dma_fence_describe ( struct dma_fence *  fence,
struct seq_file *  seq 
)

◆ dma_fence_driver_name()

const char __rcu * dma_fence_driver_name ( struct dma_fence *  fence)

DOC: Safe external access to driver provided object members

All data not stored directly in the dma-fence object, such as the &dma_fence.lock and memory potentially accessed by functions in the &dma_fence.ops table, MUST NOT be accessed after the fence has been signalled because after that point drivers are allowed to free it.

All code accessing that data via the dma-fence API (or directly, which is discouraged), MUST make sure to contain the complete access within a &rcu_read_lock and &rcu_read_unlock pair.

Some dma-fence API handles this automatically, while other, as for example &dma_fence_driver_name and &dma_fence_timeline_name, leave that responsibility to the caller.

To enable this scheme to work drivers MUST ensure a RCU grace period elapses between signalling the fence and freeing the said data.

◆ dma_fence_enable_sw_signaling()

void dma_fence_enable_sw_signaling ( struct dma_fence *  fence)

◆ dma_fence_free()

void dma_fence_free ( struct dma_fence *  fence)

◆ dma_fence_get_status()

int dma_fence_get_status ( struct dma_fence *  fence)

◆ dma_fence_get_stub()

struct dma_fence * dma_fence_get_stub ( void  )

◆ dma_fence_init()

void dma_fence_init ( struct dma_fence *  fence,
const struct dma_fence_ops *  ops,
spinlock_t *  lock,
u64  context,
u64  seqno 
)

◆ dma_fence_init64()

void dma_fence_init64 ( struct dma_fence *  fence,
const struct dma_fence_ops *  ops,
spinlock_t *  lock,
u64  context,
u64  seqno 
)

◆ dma_fence_release()

void dma_fence_release ( struct kref *  kref)

◆ dma_fence_remove_callback()

bool dma_fence_remove_callback ( struct dma_fence *  fence,
struct dma_fence_cb *  cb 
)

◆ dma_fence_set_deadline()

void dma_fence_set_deadline ( struct dma_fence *  fence,
ktime_t  deadline 
)

◆ dma_fence_signal()

void dma_fence_signal ( struct dma_fence *  fence)

◆ dma_fence_signal_locked()

void dma_fence_signal_locked ( struct dma_fence *  fence)

◆ dma_fence_signal_timestamp()

void dma_fence_signal_timestamp ( struct dma_fence *  fence,
ktime_t  timestamp 
)

◆ dma_fence_signal_timestamp_locked()

void dma_fence_signal_timestamp_locked ( struct dma_fence *  fence,
ktime_t  timestamp 
)

◆ dma_fence_timeline_name()

const char __rcu * dma_fence_timeline_name ( struct dma_fence *  fence)

◆ dma_fence_wait_any_timeout()

signed long dma_fence_wait_any_timeout ( struct dma_fence **  fences,
uint32_t  count,
bool  intr,
signed long  timeout,
uint32_t *  idx 
)

◆ dma_fence_wait_timeout()

signed long dma_fence_wait_timeout ( struct dma_fence *  ,
bool  intr,
signed long  timeout 
)

Variable Documentation

◆ dma_fence_array_ops

const struct dma_fence_ops dma_fence_array_ops
extern

◆ dma_fence_chain_ops

const struct dma_fence_ops dma_fence_chain_ops
extern