Commit ac4f24c2 authored by Sam Ravnborg's avatar Sam Ravnborg Committed by Daniel Vetter

drm: drm_device.h: update comments to kernel-doc style

Updated comment style to kernel-doc format in drm_device.h

In struct drm_device there are 12 struct members without doc:
- registered
- filelist_mutex
- filelist
- irq
- vbl_lock
- event_lock
- hose
- sigdata
- sigdata.context
- sigdata.lock
- agp_buffer_map
- agp_buffer_token

They all need proper documentation, a task left for someone
that knows their usage.

drm_device is not plugged into Documentation/gpu/drm-internals.rst
as this would create a new load of warnings.
Signed-off-by: default avatarSam Ravnborg <sam@ravnborg.org>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <maxime.ripard@bootlin.com>
Cc: Sean Paul <sean@poorly.run>
Cc: David Airlie <airlied@linux.ie>
Cc: Daniel Vetter <daniel@ffwll.ch>
Cc: Jonathan Corbet <corbet@lwn.net>
Signed-off-by: default avatarDaniel Vetter <daniel.vetter@ffwll.ch>
Link: https://patchwork.freedesktop.org/patch/msgid/20190108192939.15255-2-sam@ravnborg.org
parent 4fb6bb89
...@@ -25,24 +25,48 @@ struct pci_dev; ...@@ -25,24 +25,48 @@ struct pci_dev;
struct pci_controller; struct pci_controller;
/** /**
* DRM device structure. This structure represent a complete card that * struct drm_device - DRM device structure
*
* This structure represent a complete card that
* may contain multiple heads. * may contain multiple heads.
*/ */
struct drm_device { struct drm_device {
struct list_head legacy_dev_list;/**< list of devices per driver for stealth attach cleanup */ /**
int if_version; /**< Highest interface version set */ * @legacy_dev_list:
*
/** \name Lifetime Management */ * List of devices per driver for stealth attach cleanup
/*@{ */ */
struct kref ref; /**< Object ref-count */ struct list_head legacy_dev_list;
struct device *dev; /**< Device structure of bus-device */
struct drm_driver *driver; /**< DRM driver managing the device */ /** @if_version: Highest interface version set */
void *dev_private; /**< DRM driver private data */ int if_version;
struct drm_minor *primary; /**< Primary node */
struct drm_minor *render; /**< Render node */ /** @ref: Object ref-count */
struct kref ref;
/** @dev: Device structure of bus-device */
struct device *dev;
/** @driver: DRM driver managing the device */
struct drm_driver *driver;
/** @dev_private: DRM driver private data */
void *dev_private;
/** @primary: Primary node */
struct drm_minor *primary;
/** @render: Render node */
struct drm_minor *render;
bool registered; bool registered;
/* currently active master for this device. Protected by master_mutex */ /**
* @master:
*
* Currently active master for this device.
* Protected by &master_mutex
*/
struct drm_master *master; struct drm_master *master;
/** /**
...@@ -63,23 +87,42 @@ struct drm_device { ...@@ -63,23 +87,42 @@ struct drm_device {
*/ */
bool unplugged; bool unplugged;
struct inode *anon_inode; /**< inode for private address-space */ /** @anon_inode: inode for private address-space */
char *unique; /**< unique name of the device */ struct inode *anon_inode;
/*@} */
/** \name Locks */ /** @unique: Unique name of the device */
/*@{ */ char *unique;
struct mutex struct_mutex; /**< For others */
struct mutex master_mutex; /**< For drm_minor::master and drm_file::is_master */
/*@} */
/** \name Usage Counters */ /**
/*@{ */ * @struct_mutex:
int open_count; /**< Outstanding files open, protected by drm_global_mutex. */ *
spinlock_t buf_lock; /**< For drm_device::buf_use and a few other things. */ * Lock for others (not &drm_minor.master and &drm_file.is_master)
int buf_use; /**< Buffers in use -- cannot alloc */ */
atomic_t buf_alloc; /**< Buffer allocation in progress */ struct mutex struct_mutex;
/*@} */
/**
* @master_mutex:
*
* Lock for &drm_minor.master and &drm_file.is_master
*/
struct mutex master_mutex;
/**
* @open_count:
*
* Usage counter for outstanding files open,
* protected by drm_global_mutex
*/
int open_count;
/** @buf_lock: Lock for &buf_use and a few other things. */
spinlock_t buf_lock;
/** @buf_use: Usage counter for buffers in use -- cannot alloc */
int buf_use;
/** @buf_alloc: Buffer allocation in progress */
atomic_t buf_alloc;
struct mutex filelist_mutex; struct mutex filelist_mutex;
struct list_head filelist; struct list_head filelist;
...@@ -87,51 +130,64 @@ struct drm_device { ...@@ -87,51 +130,64 @@ struct drm_device {
/** /**
* @filelist_internal: * @filelist_internal:
* *
* List of open DRM files for in-kernel clients. Protected by @filelist_mutex. * List of open DRM files for in-kernel clients.
* Protected by &filelist_mutex.
*/ */
struct list_head filelist_internal; struct list_head filelist_internal;
/** /**
* @clientlist_mutex: * @clientlist_mutex:
* *
* Protects @clientlist access. * Protects &clientlist access.
*/ */
struct mutex clientlist_mutex; struct mutex clientlist_mutex;
/** /**
* @clientlist: * @clientlist:
* *
* List of in-kernel clients. Protected by @clientlist_mutex. * List of in-kernel clients. Protected by &clientlist_mutex.
*/ */
struct list_head clientlist; struct list_head clientlist;
/** \name Memory management */ /** @maplist: Memory management - linked list of regions */
/*@{ */ struct list_head maplist;
struct list_head maplist; /**< Linked list of regions */
struct drm_open_hash map_hash; /**< User token hash table for maps */
/** \name Context handle management */ /** @map_hash: Memory management - user token hash table for maps */
/*@{ */ struct drm_open_hash map_hash;
struct list_head ctxlist; /**< Linked list of context handles */
struct mutex ctxlist_mutex; /**< For ctxlist */
struct idr ctx_idr; /**
* @ctxlist:
* Context handle management - linked list of context handles
*/
struct list_head ctxlist;
struct list_head vmalist; /**< List of vmas (for debugging) */ /**
* @ctxlist_mutex:
*
* Context handle management - mutex for &ctxlist
*/
struct mutex ctxlist_mutex;
/*@} */ /**
* @ctx_idr:
* Context handle management
*/
struct idr ctx_idr;
/** \name DMA support */ /**
/*@{ */ * @vmalist:
struct drm_device_dma *dma; /**< Optional pointer for DMA support */ * Context handle management - list of vmas (for debugging)
/*@} */ */
struct list_head vmalist;
/** @dma: Optional pointer for DMA support */
struct drm_device_dma *dma;
/** \name Context support */ /** @context_flag: Context swapping flag */
/*@{ */ __volatile__ long context_flag;
__volatile__ long context_flag; /**< Context swapping flag */ /** @last_context: Last current context */
int last_context; /**< Last current context */ int last_context;
/*@} */
/** /**
* @irq_enabled: * @irq_enabled:
...@@ -168,7 +224,12 @@ struct drm_device { ...@@ -168,7 +224,12 @@ struct drm_device {
*/ */
struct drm_vblank_crtc *vblank; struct drm_vblank_crtc *vblank;
spinlock_t vblank_time_lock; /**< Protects vblank count and time updates during vblank enable/disable */ /**
* @vblank_time_lock:
*
* Protects vblank count and time updates during vblank enable/disable
*/
spinlock_t vblank_time_lock;
spinlock_t vbl_lock; spinlock_t vbl_lock;
/** /**
...@@ -186,25 +247,29 @@ struct drm_device { ...@@ -186,25 +247,29 @@ struct drm_device {
* *
* If non-zeor, &drm_crtc_funcs.get_vblank_counter must be set. * If non-zeor, &drm_crtc_funcs.get_vblank_counter must be set.
*/ */
u32 max_vblank_count; /**< size of vblank counter register */
/** /** @max_vblank_count: Size of vblank counter register */
* List of events u32 max_vblank_count;
*/
/** @vblank_event_list: List of vblank events */
struct list_head vblank_event_list; struct list_head vblank_event_list;
spinlock_t event_lock; spinlock_t event_lock;
/*@} */ /** @agp: AGP data */
struct drm_agp_head *agp;
struct drm_agp_head *agp; /**< AGP data */ /** @pdev: PCI device structure */
struct pci_dev *pdev;
struct pci_dev *pdev; /**< PCI device structure */
#ifdef __alpha__ #ifdef __alpha__
struct pci_controller *hose; struct pci_controller *hose;
#endif #endif
struct drm_sg_mem *sg; /**< Scatter gather memory */ /** @sg: Scatter gather memory */
unsigned int num_crtcs; /**< Number of CRTCs on this device */ struct drm_sg_mem *sg;
/** @num_crtcs: Number of CRTCs on this device */
unsigned int num_crtcs;
struct { struct {
int context; int context;
...@@ -214,14 +279,18 @@ struct drm_device { ...@@ -214,14 +279,18 @@ struct drm_device {
struct drm_local_map *agp_buffer_map; struct drm_local_map *agp_buffer_map;
unsigned int agp_buffer_token; unsigned int agp_buffer_token;
struct drm_mode_config mode_config; /**< Current mode config */ /** @mode_config: Current mode config */
struct drm_mode_config mode_config;
/** \name GEM information */ /** @object_name_lock: GEM information */
/*@{ */
struct mutex object_name_lock; struct mutex object_name_lock;
/** @object_name_idr: GEM information */
struct idr object_name_idr; struct idr object_name_idr;
/** @vma_offset_manager: GEM information */
struct drm_vma_offset_manager *vma_offset_manager; struct drm_vma_offset_manager *vma_offset_manager;
/*@} */
int switch_power_state; int switch_power_state;
/** /**
......
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