mirror of
https://github.com/torvalds/linux.git
synced 2024-12-28 22:02:28 +00:00
drm/ttm: cleanup coding style in ttm_bo_api.h
Extern is the default for function declerations anyway and this solves a bunch of 80char per line issues. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
c0c2c3bffc
commit
ba87349ed3
@ -288,8 +288,7 @@ ttm_bo_reference(struct ttm_buffer_object *bo)
|
|||||||
* Returns -EBUSY if no_wait is true and the buffer is busy.
|
* Returns -EBUSY if no_wait is true and the buffer is busy.
|
||||||
* Returns -ERESTARTSYS if interrupted by a signal.
|
* Returns -ERESTARTSYS if interrupted by a signal.
|
||||||
*/
|
*/
|
||||||
extern int ttm_bo_wait(struct ttm_buffer_object *bo,
|
int ttm_bo_wait(struct ttm_buffer_object *bo, bool interruptible, bool no_wait);
|
||||||
bool interruptible, bool no_wait);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_mem_compat - Check if proposed placement is compatible with a bo
|
* ttm_bo_mem_compat - Check if proposed placement is compatible with a bo
|
||||||
@ -300,9 +299,8 @@ extern int ttm_bo_wait(struct ttm_buffer_object *bo,
|
|||||||
*
|
*
|
||||||
* Returns true if the placement is compatible
|
* Returns true if the placement is compatible
|
||||||
*/
|
*/
|
||||||
extern bool ttm_bo_mem_compat(struct ttm_placement *placement,
|
bool ttm_bo_mem_compat(struct ttm_placement *placement, struct ttm_mem_reg *mem,
|
||||||
struct ttm_mem_reg *mem,
|
uint32_t *new_flags);
|
||||||
uint32_t *new_flags);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_validate
|
* ttm_bo_validate
|
||||||
@ -320,10 +318,10 @@ extern bool ttm_bo_mem_compat(struct ttm_placement *placement,
|
|||||||
* -EBUSY if no_wait is true and buffer busy.
|
* -EBUSY if no_wait is true and buffer busy.
|
||||||
* -ERESTARTSYS if interrupted by a signal.
|
* -ERESTARTSYS if interrupted by a signal.
|
||||||
*/
|
*/
|
||||||
extern int ttm_bo_validate(struct ttm_buffer_object *bo,
|
int ttm_bo_validate(struct ttm_buffer_object *bo,
|
||||||
struct ttm_placement *placement,
|
struct ttm_placement *placement,
|
||||||
bool interruptible,
|
bool interruptible,
|
||||||
bool no_wait_gpu);
|
bool no_wait_gpu);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_unref
|
* ttm_bo_unref
|
||||||
@ -332,7 +330,7 @@ extern int ttm_bo_validate(struct ttm_buffer_object *bo,
|
|||||||
*
|
*
|
||||||
* Unreference and clear a pointer to a buffer object.
|
* Unreference and clear a pointer to a buffer object.
|
||||||
*/
|
*/
|
||||||
extern void ttm_bo_unref(struct ttm_buffer_object **bo);
|
void ttm_bo_unref(struct ttm_buffer_object **bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_add_to_lru
|
* ttm_bo_add_to_lru
|
||||||
@ -344,7 +342,7 @@ extern void ttm_bo_unref(struct ttm_buffer_object **bo);
|
|||||||
* This function must be called with struct ttm_bo_global::lru_lock held, and
|
* This function must be called with struct ttm_bo_global::lru_lock held, and
|
||||||
* is typically called immediately prior to unreserving a bo.
|
* is typically called immediately prior to unreserving a bo.
|
||||||
*/
|
*/
|
||||||
extern void ttm_bo_add_to_lru(struct ttm_buffer_object *bo);
|
void ttm_bo_add_to_lru(struct ttm_buffer_object *bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_del_from_lru
|
* ttm_bo_del_from_lru
|
||||||
@ -356,7 +354,7 @@ extern void ttm_bo_add_to_lru(struct ttm_buffer_object *bo);
|
|||||||
* and is usually called just immediately after the bo has been reserved to
|
* and is usually called just immediately after the bo has been reserved to
|
||||||
* avoid recursive reservation from lru lists.
|
* avoid recursive reservation from lru lists.
|
||||||
*/
|
*/
|
||||||
extern void ttm_bo_del_from_lru(struct ttm_buffer_object *bo);
|
void ttm_bo_del_from_lru(struct ttm_buffer_object *bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_move_to_lru_tail
|
* ttm_bo_move_to_lru_tail
|
||||||
@ -367,7 +365,7 @@ extern void ttm_bo_del_from_lru(struct ttm_buffer_object *bo);
|
|||||||
* object. This function must be called with struct ttm_bo_global::lru_lock
|
* object. This function must be called with struct ttm_bo_global::lru_lock
|
||||||
* held, and is used to make a BO less likely to be considered for eviction.
|
* held, and is used to make a BO less likely to be considered for eviction.
|
||||||
*/
|
*/
|
||||||
extern void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo);
|
void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_lock_delayed_workqueue
|
* ttm_bo_lock_delayed_workqueue
|
||||||
@ -376,15 +374,14 @@ extern void ttm_bo_move_to_lru_tail(struct ttm_buffer_object *bo);
|
|||||||
* Returns
|
* Returns
|
||||||
* True if the workqueue was queued at the time
|
* True if the workqueue was queued at the time
|
||||||
*/
|
*/
|
||||||
extern int ttm_bo_lock_delayed_workqueue(struct ttm_bo_device *bdev);
|
int ttm_bo_lock_delayed_workqueue(struct ttm_bo_device *bdev);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_unlock_delayed_workqueue
|
* ttm_bo_unlock_delayed_workqueue
|
||||||
*
|
*
|
||||||
* Allows the delayed workqueue to run.
|
* Allows the delayed workqueue to run.
|
||||||
*/
|
*/
|
||||||
extern void ttm_bo_unlock_delayed_workqueue(struct ttm_bo_device *bdev,
|
void ttm_bo_unlock_delayed_workqueue(struct ttm_bo_device *bdev, int resched);
|
||||||
int resched);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_eviction_valuable
|
* ttm_bo_eviction_valuable
|
||||||
@ -411,8 +408,7 @@ bool ttm_bo_eviction_valuable(struct ttm_buffer_object *bo,
|
|||||||
* -EBUSY if the buffer is busy and no_wait is true.
|
* -EBUSY if the buffer is busy and no_wait is true.
|
||||||
* -ERESTARTSYS if interrupted by a signal.
|
* -ERESTARTSYS if interrupted by a signal.
|
||||||
*/
|
*/
|
||||||
extern int
|
int ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait);
|
||||||
ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_synccpu_write_release:
|
* ttm_bo_synccpu_write_release:
|
||||||
@ -421,7 +417,7 @@ ttm_bo_synccpu_write_grab(struct ttm_buffer_object *bo, bool no_wait);
|
|||||||
*
|
*
|
||||||
* Releases a synccpu lock.
|
* Releases a synccpu lock.
|
||||||
*/
|
*/
|
||||||
extern void ttm_bo_synccpu_write_release(struct ttm_buffer_object *bo);
|
void ttm_bo_synccpu_write_release(struct ttm_buffer_object *bo);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_acc_size
|
* ttm_bo_acc_size
|
||||||
@ -480,18 +476,18 @@ size_t ttm_bo_dma_acc_size(struct ttm_bo_device *bdev,
|
|||||||
* -ERESTARTSYS: Interrupted by signal while sleeping waiting for resources.
|
* -ERESTARTSYS: Interrupted by signal while sleeping waiting for resources.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
extern int ttm_bo_init_reserved(struct ttm_bo_device *bdev,
|
int ttm_bo_init_reserved(struct ttm_bo_device *bdev,
|
||||||
struct ttm_buffer_object *bo,
|
struct ttm_buffer_object *bo,
|
||||||
unsigned long size,
|
unsigned long size,
|
||||||
enum ttm_bo_type type,
|
enum ttm_bo_type type,
|
||||||
struct ttm_placement *placement,
|
struct ttm_placement *placement,
|
||||||
uint32_t page_alignment,
|
uint32_t page_alignment,
|
||||||
bool interrubtible,
|
bool interrubtible,
|
||||||
struct file *persistent_swap_storage,
|
struct file *persistent_swap_storage,
|
||||||
size_t acc_size,
|
size_t acc_size,
|
||||||
struct sg_table *sg,
|
struct sg_table *sg,
|
||||||
struct reservation_object *resv,
|
struct reservation_object *resv,
|
||||||
void (*destroy) (struct ttm_buffer_object *));
|
void (*destroy) (struct ttm_buffer_object *));
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_init
|
* ttm_bo_init
|
||||||
@ -531,19 +527,13 @@ extern int ttm_bo_init_reserved(struct ttm_bo_device *bdev,
|
|||||||
* -EINVAL: Invalid placement flags.
|
* -EINVAL: Invalid placement flags.
|
||||||
* -ERESTARTSYS: Interrupted by signal while sleeping waiting for resources.
|
* -ERESTARTSYS: Interrupted by signal while sleeping waiting for resources.
|
||||||
*/
|
*/
|
||||||
|
int ttm_bo_init(struct ttm_bo_device *bdev, struct ttm_buffer_object *bo,
|
||||||
extern int ttm_bo_init(struct ttm_bo_device *bdev,
|
unsigned long size, enum ttm_bo_type type,
|
||||||
struct ttm_buffer_object *bo,
|
struct ttm_placement *placement,
|
||||||
unsigned long size,
|
uint32_t page_alignment, bool interrubtible,
|
||||||
enum ttm_bo_type type,
|
struct file *persistent_swap_storage, size_t acc_size,
|
||||||
struct ttm_placement *placement,
|
struct sg_table *sg, struct reservation_object *resv,
|
||||||
uint32_t page_alignment,
|
void (*destroy) (struct ttm_buffer_object *));
|
||||||
bool interrubtible,
|
|
||||||
struct file *persistent_swap_storage,
|
|
||||||
size_t acc_size,
|
|
||||||
struct sg_table *sg,
|
|
||||||
struct reservation_object *resv,
|
|
||||||
void (*destroy) (struct ttm_buffer_object *));
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_create
|
* ttm_bo_create
|
||||||
@ -569,15 +559,11 @@ extern int ttm_bo_init(struct ttm_bo_device *bdev,
|
|||||||
* -EINVAL: Invalid placement flags.
|
* -EINVAL: Invalid placement flags.
|
||||||
* -ERESTARTSYS: Interrupted by signal while waiting for resources.
|
* -ERESTARTSYS: Interrupted by signal while waiting for resources.
|
||||||
*/
|
*/
|
||||||
|
int ttm_bo_create(struct ttm_bo_device *bdev, unsigned long size,
|
||||||
extern int ttm_bo_create(struct ttm_bo_device *bdev,
|
enum ttm_bo_type type, struct ttm_placement *placement,
|
||||||
unsigned long size,
|
uint32_t page_alignment, bool interruptible,
|
||||||
enum ttm_bo_type type,
|
struct file *persistent_swap_storage,
|
||||||
struct ttm_placement *placement,
|
struct ttm_buffer_object **p_bo);
|
||||||
uint32_t page_alignment,
|
|
||||||
bool interruptible,
|
|
||||||
struct file *persistent_swap_storage,
|
|
||||||
struct ttm_buffer_object **p_bo);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_init_mm
|
* ttm_bo_init_mm
|
||||||
@ -594,9 +580,9 @@ extern int ttm_bo_create(struct ttm_bo_device *bdev,
|
|||||||
* -ENOMEM: Not enough memory.
|
* -ENOMEM: Not enough memory.
|
||||||
* May also return driver-specified errors.
|
* May also return driver-specified errors.
|
||||||
*/
|
*/
|
||||||
|
int ttm_bo_init_mm(struct ttm_bo_device *bdev, unsigned type,
|
||||||
|
unsigned long p_size);
|
||||||
|
|
||||||
extern int ttm_bo_init_mm(struct ttm_bo_device *bdev, unsigned type,
|
|
||||||
unsigned long p_size);
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_clean_mm
|
* ttm_bo_clean_mm
|
||||||
*
|
*
|
||||||
@ -623,8 +609,7 @@ extern int ttm_bo_init_mm(struct ttm_bo_device *bdev, unsigned type,
|
|||||||
* -EINVAL: invalid or uninitialized memory type.
|
* -EINVAL: invalid or uninitialized memory type.
|
||||||
* -EBUSY: There are still buffers left in this memory type.
|
* -EBUSY: There are still buffers left in this memory type.
|
||||||
*/
|
*/
|
||||||
|
int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type);
|
||||||
extern int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_evict_mm
|
* ttm_bo_evict_mm
|
||||||
@ -644,8 +629,7 @@ extern int ttm_bo_clean_mm(struct ttm_bo_device *bdev, unsigned mem_type);
|
|||||||
* -ERESTARTSYS: The call was interrupted by a signal while waiting to
|
* -ERESTARTSYS: The call was interrupted by a signal while waiting to
|
||||||
* evict a buffer.
|
* evict a buffer.
|
||||||
*/
|
*/
|
||||||
|
int ttm_bo_evict_mm(struct ttm_bo_device *bdev, unsigned mem_type);
|
||||||
extern int ttm_bo_evict_mm(struct ttm_bo_device *bdev, unsigned mem_type);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_kmap_obj_virtual
|
* ttm_kmap_obj_virtual
|
||||||
@ -658,7 +642,6 @@ extern int ttm_bo_evict_mm(struct ttm_bo_device *bdev, unsigned mem_type);
|
|||||||
* If *is_iomem is 1 on return, the virtual address points to an io memory area,
|
* If *is_iomem is 1 on return, the virtual address points to an io memory area,
|
||||||
* that should strictly be accessed by the iowriteXX() and similar functions.
|
* that should strictly be accessed by the iowriteXX() and similar functions.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
static inline void *ttm_kmap_obj_virtual(struct ttm_bo_kmap_obj *map,
|
static inline void *ttm_kmap_obj_virtual(struct ttm_bo_kmap_obj *map,
|
||||||
bool *is_iomem)
|
bool *is_iomem)
|
||||||
{
|
{
|
||||||
@ -682,9 +665,8 @@ static inline void *ttm_kmap_obj_virtual(struct ttm_bo_kmap_obj *map,
|
|||||||
* -ENOMEM: Out of memory.
|
* -ENOMEM: Out of memory.
|
||||||
* -EINVAL: Invalid range.
|
* -EINVAL: Invalid range.
|
||||||
*/
|
*/
|
||||||
|
int ttm_bo_kmap(struct ttm_buffer_object *bo, unsigned long start_page,
|
||||||
extern int ttm_bo_kmap(struct ttm_buffer_object *bo, unsigned long start_page,
|
unsigned long num_pages, struct ttm_bo_kmap_obj *map);
|
||||||
unsigned long num_pages, struct ttm_bo_kmap_obj *map);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_kunmap
|
* ttm_bo_kunmap
|
||||||
@ -693,8 +675,7 @@ extern int ttm_bo_kmap(struct ttm_buffer_object *bo, unsigned long start_page,
|
|||||||
*
|
*
|
||||||
* Unmaps a kernel map set up by ttm_bo_kmap.
|
* Unmaps a kernel map set up by ttm_bo_kmap.
|
||||||
*/
|
*/
|
||||||
|
void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map);
|
||||||
extern void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_fbdev_mmap - mmap fbdev memory backed by a ttm buffer object.
|
* ttm_fbdev_mmap - mmap fbdev memory backed by a ttm buffer object.
|
||||||
@ -706,9 +687,7 @@ extern void ttm_bo_kunmap(struct ttm_bo_kmap_obj *map);
|
|||||||
* This function is intended to be called by the fbdev mmap method
|
* This function is intended to be called by the fbdev mmap method
|
||||||
* if the fbdev address space is to be backed by a bo.
|
* if the fbdev address space is to be backed by a bo.
|
||||||
*/
|
*/
|
||||||
|
int ttm_fbdev_mmap(struct vm_area_struct *vma, struct ttm_buffer_object *bo);
|
||||||
extern int ttm_fbdev_mmap(struct vm_area_struct *vma,
|
|
||||||
struct ttm_buffer_object *bo);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_default_iomem_pfn - get a pfn for a page offset
|
* ttm_bo_default_iomem_pfn - get a pfn for a page offset
|
||||||
@ -731,9 +710,8 @@ unsigned long ttm_bo_default_io_mem_pfn(struct ttm_buffer_object *bo,
|
|||||||
* This function is intended to be called by the device mmap method.
|
* This function is intended to be called by the device mmap method.
|
||||||
* if the device address space is to be backed by the bo manager.
|
* if the device address space is to be backed by the bo manager.
|
||||||
*/
|
*/
|
||||||
|
int ttm_bo_mmap(struct file *filp, struct vm_area_struct *vma,
|
||||||
extern int ttm_bo_mmap(struct file *filp, struct vm_area_struct *vma,
|
struct ttm_bo_device *bdev);
|
||||||
struct ttm_bo_device *bdev);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* ttm_bo_io
|
* ttm_bo_io
|
||||||
@ -755,11 +733,10 @@ extern int ttm_bo_mmap(struct file *filp, struct vm_area_struct *vma,
|
|||||||
* the function may return -ERESTARTSYS if
|
* the function may return -ERESTARTSYS if
|
||||||
* interrupted by a signal.
|
* interrupted by a signal.
|
||||||
*/
|
*/
|
||||||
|
ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp,
|
||||||
|
const char __user *wbuf, char __user *rbuf,
|
||||||
|
size_t count, loff_t *f_pos, bool write);
|
||||||
|
|
||||||
extern ssize_t ttm_bo_io(struct ttm_bo_device *bdev, struct file *filp,
|
void ttm_bo_swapout_all(struct ttm_bo_device *bdev);
|
||||||
const char __user *wbuf, char __user *rbuf,
|
int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo);
|
||||||
size_t count, loff_t *f_pos, bool write);
|
|
||||||
|
|
||||||
extern void ttm_bo_swapout_all(struct ttm_bo_device *bdev);
|
|
||||||
extern int ttm_bo_wait_unreserved(struct ttm_buffer_object *bo);
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user