Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Functions
radeon_fence.c File Reference
#include <linux/seq_file.h>
#include <linux/atomic.h>
#include <linux/wait.h>
#include <linux/list.h>
#include <linux/kref.h>
#include <linux/slab.h>
#include <drm/drmP.h>
#include "radeon_reg.h"
#include "radeon.h"
#include "radeon_trace.h"

Go to the source code of this file.

Functions

int radeon_fence_emit (struct radeon_device *rdev, struct radeon_fence **fence, int ring)
 
void radeon_fence_process (struct radeon_device *rdev, int ring)
 
bool radeon_fence_signaled (struct radeon_fence *fence)
 
int radeon_fence_wait (struct radeon_fence *fence, bool intr)
 
int radeon_fence_wait_any (struct radeon_device *rdev, struct radeon_fence **fences, bool intr)
 
int radeon_fence_wait_next_locked (struct radeon_device *rdev, int ring)
 
void radeon_fence_wait_empty_locked (struct radeon_device *rdev, int ring)
 
struct radeon_fenceradeon_fence_ref (struct radeon_fence *fence)
 
void radeon_fence_unref (struct radeon_fence **fence)
 
unsigned radeon_fence_count_emitted (struct radeon_device *rdev, int ring)
 
bool radeon_fence_need_sync (struct radeon_fence *fence, int dst_ring)
 
void radeon_fence_note_sync (struct radeon_fence *fence, int dst_ring)
 
int radeon_fence_driver_start_ring (struct radeon_device *rdev, int ring)
 
int radeon_fence_driver_init (struct radeon_device *rdev)
 
void radeon_fence_driver_fini (struct radeon_device *rdev)
 
int radeon_debugfs_fence_init (struct radeon_device *rdev)
 

Function Documentation

int radeon_debugfs_fence_init ( struct radeon_device rdev)

Definition at line 907 of file radeon_fence.c.

unsigned radeon_fence_count_emitted ( struct radeon_device rdev,
int  ring 
)

radeon_fence_count_emitted - get the count of emitted fences

: radeon device pointer : ring index the fence is associated with

Get the number of fences emitted on the requested ring (all asics). Returns the number of emitted fences on the ring. Used by the dynpm code to ring track activity.

Definition at line 675 of file radeon_fence.c.

void radeon_fence_driver_fini ( struct radeon_device rdev)

radeon_fence_driver_fini - tear down the fence driver for all possible rings.

: radeon device pointer

Tear down the fence driver for all possible rings (all asics).

Definition at line 855 of file radeon_fence.c.

int radeon_fence_driver_init ( struct radeon_device rdev)

radeon_fence_driver_init - init the fence driver for all possible rings.

: radeon device pointer

Init the fence driver for all possible rings (all asics). Not all asics have all rings, so each asic will only start the fence driver on the rings it has using radeon_fence_driver_start_ring(). Returns 0 for success.

Definition at line 833 of file radeon_fence.c.

int radeon_fence_driver_start_ring ( struct radeon_device rdev,
int  ring 
)

radeon_fence_driver_start_ring - make the fence driver ready for use on the requested ring.

: radeon device pointer : ring index to start the fence driver on

Make the fence driver ready for processing (all asics). Not all asics have all rings, so each asic will only start the fence driver on the rings it has. Returns 0 for success, errors for failure.

Definition at line 769 of file radeon_fence.c.

int radeon_fence_emit ( struct radeon_device rdev,
struct radeon_fence **  fence,
int  ring 
)

radeon_fence_emit - emit a fence on the requested ring

: radeon_device pointer : radeon fence object : ring index the fence is associated with

Emits a fence command on the requested ring (all asics). Returns 0 on success, -ENOMEM on failure.

Definition at line 104 of file radeon_fence.c.

bool radeon_fence_need_sync ( struct radeon_fence fence,
int  dst_ring 
)

radeon_fence_need_sync - do we need a semaphore

: radeon fence object : which ring to check against

Check if the fence needs to be synced against another ring (all asics). If so, we need to emit a semaphore. Returns true if we need to sync with another ring, false if not.

Definition at line 703 of file radeon_fence.c.

void radeon_fence_note_sync ( struct radeon_fence fence,
int  dst_ring 
)

radeon_fence_note_sync - record the sync point

: radeon fence object : which ring to check against

Note the sequence number at which point the fence will be synced with the requested ring (all asics).

Definition at line 733 of file radeon_fence.c.

void radeon_fence_process ( struct radeon_device rdev,
int  ring 
)

radeon_fence_process - process a fence

: radeon_device pointer : ring index the fence is associated with

Checks the current fence value and wakes the fence queue if the sequence number has increased (all asics).

Definition at line 131 of file radeon_fence.c.

struct radeon_fence* radeon_fence_ref ( struct radeon_fence fence)
read

radeon_fence_ref - take a ref on a fence

: radeon fence object

Take a reference on a fence (all asics). Returns the fence.

Definition at line 642 of file radeon_fence.c.

bool radeon_fence_signaled ( struct radeon_fence fence)

radeon_fence_signaled - check if a fence has signaled

: radeon fence object

Check if the requested fence has signaled (all asics). Returns true if the fence has signaled or false if it has not.

Definition at line 244 of file radeon_fence.c.

void radeon_fence_unref ( struct radeon_fence **  fence)

radeon_fence_unref - remove a ref on a fence

: radeon fence object

Remove a reference on a fence (all asics).

Definition at line 655 of file radeon_fence.c.

int radeon_fence_wait ( struct radeon_fence fence,
bool  intr 
)

radeon_fence_wait - wait for a fence to signal

: radeon fence object : use interruptable sleep

Wait for the requested fence to signal (all asics). selects whether to use interruptable (true) or non-interruptable (false) sleep when waiting for the fence. Returns 0 if the fence has passed, error for all other cases.

Definition at line 383 of file radeon_fence.c.

int radeon_fence_wait_any ( struct radeon_device rdev,
struct radeon_fence **  fences,
bool  intr 
)

radeon_fence_wait_any - wait for a fence to signal on any ring

: radeon device pointer : radeon fence object(s) : use interruptable sleep

Wait for any requested fence to signal (all asics). Fence array is indexed by ring id. selects whether to use interruptable (true) or non-interruptable (false) sleep when waiting for the fences. Used by the suballocator. Returns 0 if any fence has passed, error for all other cases.

Definition at line 549 of file radeon_fence.c.

void radeon_fence_wait_empty_locked ( struct radeon_device rdev,
int  ring 
)

radeon_fence_wait_empty_locked - wait for all fences to signal

: radeon device pointer : ring index the fence is associated with

Wait for all fences on the requested ring to signal (all asics). Returns 0 if the fences have passed, error for all other cases. Caller must hold ring lock.

Definition at line 612 of file radeon_fence.c.

int radeon_fence_wait_next_locked ( struct radeon_device rdev,
int  ring 
)

radeon_fence_wait_next_locked - wait for the next fence to signal

: radeon device pointer : ring index the fence is associated with

Wait for the next fence on the requested ring to signal (all asics). Returns 0 if the next fence has passed, error for all other cases. Caller must hold ring lock.

Definition at line 589 of file radeon_fence.c.