Skip to content

Commit 940eba2

Browse files
committed
drm/gem|prime|mm: Use recommened kerneldoc for struct member refs
I just learned that &struct_name.member_name works and looks pretty even. It doesn't (yet) link to the member directly though, which would be really good for big structures or vfunc tables (where the per-member kerneldoc tends to be long). Also some minor drive-by polish where it makes sense, I read a lot of docs ... Cc: Jani Nikula <jani.nikula@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Gustavo Padovan <gustavo.padovan@collabora.com> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com> Link: http://patchwork.freedesktop.org/patch/msgid/20170125062657.19270-5-daniel.vetter@ffwll.ch
1 parent 6806cdf commit 940eba2

4 files changed

Lines changed: 23 additions & 23 deletions

File tree

‎drivers/gpu/drm/drm_gem.c‎

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -316,8 +316,8 @@ EXPORT_SYMBOL(drm_gem_handle_delete);
316316
* @dev: corresponding drm_device
317317
* @handle: the dumb handle to remove
318318
*
319-
* This implements the ->dumb_destroy kms driver callback for drivers which use
320-
* gem to manage their backing storage.
319+
* This implements the &drm_driver.dumb_destroy kms driver callback for drivers
320+
* which use gem to manage their backing storage.
321321
*/
322322
int drm_gem_dumb_destroy(struct drm_file *file,
323323
struct drm_device *dev,
@@ -333,9 +333,9 @@ EXPORT_SYMBOL(drm_gem_dumb_destroy);
333333
* @obj: object to register
334334
* @handlep: pointer to return the created handle to the caller
335335
*
336-
* This expects the dev->object_name_lock to be held already and will drop it
337-
* before returning. Used to avoid races in establishing new handles when
338-
* importing an object from either an flink name or a dma-buf.
336+
* This expects the &drm_device.object_name_lock to be held already and will
337+
* drop it before returning. Used to avoid races in establishing new handles
338+
* when importing an object from either an flink name or a dma-buf.
339339
*
340340
* Handles must be release again through drm_gem_handle_delete(). This is done
341341
* when userspace closes @file_priv for all attached handles, or through the
@@ -447,8 +447,8 @@ EXPORT_SYMBOL(drm_gem_free_mmap_offset);
447447
* structures.
448448
*
449449
* This routine allocates and attaches a fake offset for @obj, in cases where
450-
* the virtual size differs from the physical size (ie. obj->size). Otherwise
451-
* just use drm_gem_create_mmap_offset().
450+
* the virtual size differs from the physical size (ie. &drm_gem_object.size).
451+
* Otherwise just use drm_gem_create_mmap_offset().
452452
*
453453
* This function is idempotent and handles an already allocated mmap offset
454454
* transparently. Drivers do not need to check for this case.
@@ -787,7 +787,7 @@ EXPORT_SYMBOL(drm_gem_object_release);
787787
* @kref: kref of the object to free
788788
*
789789
* Called after the last reference to the object has been lost.
790-
* Must be called holding &drm_device->struct_mutex.
790+
* Must be called holding &drm_device.struct_mutex.
791791
*
792792
* Frees the object
793793
*/
@@ -813,7 +813,7 @@ EXPORT_SYMBOL(drm_gem_object_free);
813813
* @obj: GEM buffer object
814814
*
815815
* This releases a reference to @obj. Callers must not hold the
816-
* dev->struct_mutex lock when calling this function.
816+
* &drm_device.struct_mutex lock when calling this function.
817817
*
818818
* See also __drm_gem_object_unreference().
819819
*/
@@ -840,9 +840,9 @@ EXPORT_SYMBOL(drm_gem_object_unreference_unlocked);
840840
* drm_gem_object_unreference - release a GEM BO reference
841841
* @obj: GEM buffer object
842842
*
843-
* This releases a reference to @obj. Callers must hold the dev->struct_mutex
844-
* lock when calling this function, even when the driver doesn't use
845-
* dev->struct_mutex for anything.
843+
* This releases a reference to @obj. Callers must hold the
844+
* &drm_device.struct_mutex lock when calling this function, even when the
845+
* driver doesn't use &drm_device.struct_mutex for anything.
846846
*
847847
* For drivers not encumbered with legacy locking use
848848
* drm_gem_object_unreference_unlocked() instead.

‎drivers/gpu/drm/drm_mm.c‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -552,8 +552,8 @@ EXPORT_SYMBOL(drm_mm_replace_node);
552552
* objects to the roster, probably by walking an LRU list, but this can be
553553
* freely implemented. Eviction candiates are added using
554554
* drm_mm_scan_add_block() until a suitable hole is found or there are no
555-
* further evictable objects. Eviction roster metadata is tracked in struct
556-
* &drm_mm_scan.
555+
* further evictable objects. Eviction roster metadata is tracked in &struct
556+
* drm_mm_scan.
557557
*
558558
* The driver must walk through all objects again in exactly the reverse
559559
* order to restore the allocator state. Note that while the allocator is used

‎drivers/gpu/drm/drm_prime.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ static void drm_gem_unmap_dma_buf(struct dma_buf_attachment *attach,
291291
* This wraps dma_buf_export() for use by generic GEM drivers that are using
292292
* drm_gem_dmabuf_release(). In addition to calling dma_buf_export(), we take
293293
* a reference to the &drm_device and the exported &drm_gem_object (stored in
294-
* exp_info->priv) which is released by drm_gem_dmabuf_release().
294+
* &dma_buf_export_info.priv) which is released by drm_gem_dmabuf_release().
295295
*
296296
* Returns the new dmabuf.
297297
*/

‎include/drm/drm_gem.h‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ struct drm_gem_object {
6363
* drops to 0 any global names (e.g. the id in the flink namespace) will
6464
* be cleared.
6565
*
66-
* Protected by dev->object_name_lock.
66+
* Protected by &drm_device.object_name_lock.
6767
*/
6868
unsigned handle_count;
6969

@@ -106,8 +106,8 @@ struct drm_gem_object {
106106
* @name:
107107
*
108108
* Global name for this object, starts at 1. 0 means unnamed.
109-
* Access is covered by dev->object_name_lock. This is used by the GEM_FLINK
110-
* and GEM_OPEN ioctls.
109+
* Access is covered by &drm_device.object_name_lock. This is used by
110+
* the GEM_FLINK and GEM_OPEN ioctls.
111111
*/
112112
int name;
113113

@@ -150,7 +150,7 @@ struct drm_gem_object {
150150
* through importing or exporting). We break the resulting reference
151151
* loop when the last gem handle for this object is released.
152152
*
153-
* Protected by obj->object_name_lock.
153+
* Protected by &drm_device.object_name_lock.
154154
*/
155155
struct dma_buf *dma_buf;
156156

@@ -163,7 +163,7 @@ struct drm_gem_object {
163163
* attachment point for the device. This is invariant over the lifetime
164164
* of a gem object.
165165
*
166-
* The driver's ->gem_free_object callback is responsible for cleaning
166+
* The &drm_driver.gem_free_object callback is responsible for cleaning
167167
* up the dma_buf attachment and references acquired at import time.
168168
*
169169
* Note that the drm gem/prime core does not depend upon drivers setting
@@ -204,16 +204,16 @@ drm_gem_object_reference(struct drm_gem_object *obj)
204204
* @obj: GEM buffer object
205205
*
206206
* This function is meant to be used by drivers which are not encumbered with
207-
* dev->struct_mutex legacy locking and which are using the
207+
* &drm_device.struct_mutex legacy locking and which are using the
208208
* gem_free_object_unlocked callback. It avoids all the locking checks and
209209
* locking overhead of drm_gem_object_unreference() and
210210
* drm_gem_object_unreference_unlocked().
211211
*
212212
* Drivers should never call this directly in their code. Instead they should
213213
* wrap it up into a ``driver_gem_object_unreference(struct driver_gem_object
214214
* *obj)`` wrapper function, and use that. Shared code should never call this, to
215-
* avoid breaking drivers by accident which still depend upon dev->struct_mutex
216-
* locking.
215+
* avoid breaking drivers by accident which still depend upon
216+
* &drm_device.struct_mutex locking.
217217
*/
218218
static inline void
219219
__drm_gem_object_unreference(struct drm_gem_object *obj)

0 commit comments

Comments
 (0)