Commit 4f51e057 authored by Jani Nikula's avatar Jani Nikula

drm/ttm: fix ttm_bo.h kernel-doc warnings

Some renames, some formatting fixes, add some missing documentation.

v3: Fix struct ttm_buffer_object .sg documentation (Christian)

Cc: Christian Koenig <christian.koenig@amd.com>
Cc: Huang Rui <ray.huang@amd.com>
Acked-by: default avatarThomas Zimmermann <tzimmermann@suse.de>
Reviewed-by: default avatarChristian König <christian.koenig@amd.com>
Signed-off-by: default avatarJani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240308160750.3741833-1-jani.nikula@intel.com
parent d1815393
...@@ -83,6 +83,9 @@ enum ttm_bo_type { ...@@ -83,6 +83,9 @@ enum ttm_bo_type {
* @resource: structure describing current placement. * @resource: structure describing current placement.
* @ttm: TTM structure holding system pages. * @ttm: TTM structure holding system pages.
* @deleted: True if the object is only a zombie and already deleted. * @deleted: True if the object is only a zombie and already deleted.
* @bulk_move: The bulk move object.
* @priority: Priority for LRU, BOs with lower priority are evicted first.
* @pin_count: Pin count.
* *
* Base class for TTM buffer object, that deals with data placement and CPU * Base class for TTM buffer object, that deals with data placement and CPU
* mappings. GPU mappings are really up to the driver, but for simpler GPUs * mappings. GPU mappings are really up to the driver, but for simpler GPUs
...@@ -128,26 +131,27 @@ struct ttm_buffer_object { ...@@ -128,26 +131,27 @@ struct ttm_buffer_object {
struct work_struct delayed_delete; struct work_struct delayed_delete;
/** /**
* Special members that are protected by the reserve lock * @sg: external source of pages and DMA addresses, protected by the
* and the bo::lock when written to. Can be read with * reservation lock.
* either of these locks held.
*/ */
struct sg_table *sg; struct sg_table *sg;
}; };
#define TTM_BO_MAP_IOMEM_MASK 0x80
/** /**
* struct ttm_bo_kmap_obj * struct ttm_bo_kmap_obj
* *
* @virtual: The current kernel virtual address. * @virtual: The current kernel virtual address.
* @page: The page when kmap'ing a single page. * @page: The page when kmap'ing a single page.
* @bo_kmap_type: Type of bo_kmap. * @bo_kmap_type: Type of bo_kmap.
* @bo: The TTM BO.
* *
* Object describing a kernel mapping. Since a TTM bo may be located * Object describing a kernel mapping. Since a TTM bo may be located
* in various memory types with various caching policies, the * in various memory types with various caching policies, the
* mapping can either be an ioremap, a vmap, a kmap or part of a * mapping can either be an ioremap, a vmap, a kmap or part of a
* premapped region. * premapped region.
*/ */
#define TTM_BO_MAP_IOMEM_MASK 0x80
struct ttm_bo_kmap_obj { struct ttm_bo_kmap_obj {
void *virtual; void *virtual;
struct page *page; struct page *page;
...@@ -171,6 +175,7 @@ struct ttm_bo_kmap_obj { ...@@ -171,6 +175,7 @@ struct ttm_bo_kmap_obj {
* @force_alloc: Don't check the memory account during suspend or CPU page * @force_alloc: Don't check the memory account during suspend or CPU page
* faults. Should only be used by TTM internally. * faults. Should only be used by TTM internally.
* @resv: Reservation object to allow reserved evictions with. * @resv: Reservation object to allow reserved evictions with.
* @bytes_moved: Statistics on how many bytes have been moved.
* *
* Context for TTM operations like changing buffer placement or general memory * Context for TTM operations like changing buffer placement or general memory
* allocation. * allocation.
...@@ -264,7 +269,7 @@ static inline int ttm_bo_reserve(struct ttm_buffer_object *bo, ...@@ -264,7 +269,7 @@ static inline int ttm_bo_reserve(struct ttm_buffer_object *bo,
* ttm_bo_reserve_slowpath: * ttm_bo_reserve_slowpath:
* @bo: A pointer to a struct ttm_buffer_object. * @bo: A pointer to a struct ttm_buffer_object.
* @interruptible: Sleep interruptible if waiting. * @interruptible: Sleep interruptible if waiting.
* @sequence: Set (@bo)->sequence to this value after lock * @ticket: Ticket used to acquire the ww_mutex.
* *
* This is called after ttm_bo_reserve returns -EAGAIN and we backed off * This is called after ttm_bo_reserve returns -EAGAIN and we backed off
* from all our other reservations. Because there are no other reservations * from all our other reservations. Because there are no other reservations
...@@ -303,7 +308,7 @@ static inline void ttm_bo_assign_mem(struct ttm_buffer_object *bo, ...@@ -303,7 +308,7 @@ static inline void ttm_bo_assign_mem(struct ttm_buffer_object *bo,
} }
/** /**
* ttm_bo_move_null = assign memory for a buffer object. * ttm_bo_move_null - assign memory for a buffer object.
* @bo: The bo to assign the memory to * @bo: The bo to assign the memory to
* @new_mem: The memory to be assigned. * @new_mem: The memory to be assigned.
* *
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment