aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
diff options
context:
space:
mode:
authorVijetha Malkai <vijetha.malkai@amd.com>2018-09-13 14:47:39 -0400
committerAlex Deucher <alexander.deucher@amd.com>2018-09-14 10:37:28 -0400
commit56ea09760076800f08c57ef2026b67d51f338810 (patch)
treeb7e4e08aab7830cc5edcaf511e0d8280d3e6c3e1 /drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
parent6a15f3ff19a8dd394e3a21480512c2cb98e26b3c (diff)
drm/amdgpu: Style fixes to PRIME code documentation
* Use consistent capitalization in the description of function arguments * Define and consistently use the BO acronym for buffer objects * Some minor wording improvements Signed-off-by: Vijetha Malkai <vijetha.malkai@amd.com> [ Michel Dänzer: Made commit log more specific ] Signed-off-by: Michel Dänzer <michel.daenzer@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c52
1 files changed, 26 insertions, 26 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
index 2686297e34e0..e45e929aaab5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c
@@ -44,10 +44,10 @@ static const struct dma_buf_ops amdgpu_dmabuf_ops;
44/** 44/**
45 * amdgpu_gem_prime_get_sg_table - &drm_driver.gem_prime_get_sg_table 45 * amdgpu_gem_prime_get_sg_table - &drm_driver.gem_prime_get_sg_table
46 * implementation 46 * implementation
47 * @obj: GEM buffer object 47 * @obj: GEM buffer object (BO)
48 * 48 *
49 * Returns: 49 * Returns:
50 * A scatter/gather table for the pinned pages of the buffer object's memory. 50 * A scatter/gather table for the pinned pages of the BO's memory.
51 */ 51 */
52struct sg_table *amdgpu_gem_prime_get_sg_table(struct drm_gem_object *obj) 52struct sg_table *amdgpu_gem_prime_get_sg_table(struct drm_gem_object *obj)
53{ 53{
@@ -59,9 +59,9 @@ struct sg_table *amdgpu_gem_prime_get_sg_table(struct drm_gem_object *obj)
59 59
60/** 60/**
61 * amdgpu_gem_prime_vmap - &dma_buf_ops.vmap implementation 61 * amdgpu_gem_prime_vmap - &dma_buf_ops.vmap implementation
62 * @obj: GEM buffer object 62 * @obj: GEM BO
63 * 63 *
64 * Sets up an in-kernel virtual mapping of the buffer object's memory. 64 * Sets up an in-kernel virtual mapping of the BO's memory.
65 * 65 *
66 * Returns: 66 * Returns:
67 * The virtual address of the mapping or an error pointer. 67 * The virtual address of the mapping or an error pointer.
@@ -81,10 +81,10 @@ void *amdgpu_gem_prime_vmap(struct drm_gem_object *obj)
81 81
82/** 82/**
83 * amdgpu_gem_prime_vunmap - &dma_buf_ops.vunmap implementation 83 * amdgpu_gem_prime_vunmap - &dma_buf_ops.vunmap implementation
84 * @obj: GEM buffer object 84 * @obj: GEM BO
85 * @vaddr: virtual address (unused) 85 * @vaddr: Virtual address (unused)
86 * 86 *
87 * Tears down the in-kernel virtual mapping of the buffer object's memory. 87 * Tears down the in-kernel virtual mapping of the BO's memory.
88 */ 88 */
89void amdgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr) 89void amdgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
90{ 90{
@@ -95,14 +95,14 @@ void amdgpu_gem_prime_vunmap(struct drm_gem_object *obj, void *vaddr)
95 95
96/** 96/**
97 * amdgpu_gem_prime_mmap - &drm_driver.gem_prime_mmap implementation 97 * amdgpu_gem_prime_mmap - &drm_driver.gem_prime_mmap implementation
98 * @obj: GEM buffer object 98 * @obj: GEM BO
99 * @vma: virtual memory area 99 * @vma: Virtual memory area
100 * 100 *
101 * Sets up a userspace mapping of the buffer object's memory in the given 101 * Sets up a userspace mapping of the BO's memory in the given
102 * virtual memory area. 102 * virtual memory area.
103 * 103 *
104 * Returns: 104 * Returns:
105 * 0 on success or negative error code. 105 * 0 on success or a negative error code on failure.
106 */ 106 */
107int amdgpu_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma) 107int amdgpu_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma)
108{ 108{
@@ -145,10 +145,10 @@ int amdgpu_gem_prime_mmap(struct drm_gem_object *obj, struct vm_area_struct *vma
145 * @attach: DMA-buf attachment 145 * @attach: DMA-buf attachment
146 * @sg: Scatter/gather table 146 * @sg: Scatter/gather table
147 * 147 *
148 * Import shared DMA buffer memory exported by another device. 148 * Imports shared DMA buffer memory exported by another device.
149 * 149 *
150 * Returns: 150 * Returns:
151 * A new GEM buffer object of the given DRM device, representing the memory 151 * A new GEM BO of the given DRM device, representing the memory
152 * described by the given DMA-buf attachment and scatter/gather table. 152 * described by the given DMA-buf attachment and scatter/gather table.
153 */ 153 */
154struct drm_gem_object * 154struct drm_gem_object *
@@ -191,7 +191,7 @@ error:
191 191
192/** 192/**
193 * amdgpu_gem_map_attach - &dma_buf_ops.attach implementation 193 * amdgpu_gem_map_attach - &dma_buf_ops.attach implementation
194 * @dma_buf: shared DMA buffer 194 * @dma_buf: Shared DMA buffer
195 * @attach: DMA-buf attachment 195 * @attach: DMA-buf attachment
196 * 196 *
197 * Makes sure that the shared DMA buffer can be accessed by the target device. 197 * Makes sure that the shared DMA buffer can be accessed by the target device.
@@ -199,7 +199,7 @@ error:
199 * all DMA devices. 199 * all DMA devices.
200 * 200 *
201 * Returns: 201 * Returns:
202 * 0 on success or negative error code. 202 * 0 on success or a negative error code on failure.
203 */ 203 */
204static int amdgpu_gem_map_attach(struct dma_buf *dma_buf, 204static int amdgpu_gem_map_attach(struct dma_buf *dma_buf,
205 struct dma_buf_attachment *attach) 205 struct dma_buf_attachment *attach)
@@ -251,11 +251,11 @@ error_detach:
251 251
252/** 252/**
253 * amdgpu_gem_map_detach - &dma_buf_ops.detach implementation 253 * amdgpu_gem_map_detach - &dma_buf_ops.detach implementation
254 * @dma_buf: shared DMA buffer 254 * @dma_buf: Shared DMA buffer
255 * @attach: DMA-buf attachment 255 * @attach: DMA-buf attachment
256 * 256 *
257 * This is called when a shared DMA buffer no longer needs to be accessible by 257 * This is called when a shared DMA buffer no longer needs to be accessible by
258 * the other device. For now, simply unpins the buffer from GTT. 258 * another device. For now, simply unpins the buffer from GTT.
259 */ 259 */
260static void amdgpu_gem_map_detach(struct dma_buf *dma_buf, 260static void amdgpu_gem_map_detach(struct dma_buf *dma_buf,
261 struct dma_buf_attachment *attach) 261 struct dma_buf_attachment *attach)
@@ -280,10 +280,10 @@ error:
280 280
281/** 281/**
282 * amdgpu_gem_prime_res_obj - &drm_driver.gem_prime_res_obj implementation 282 * amdgpu_gem_prime_res_obj - &drm_driver.gem_prime_res_obj implementation
283 * @obj: GEM buffer object 283 * @obj: GEM BO
284 * 284 *
285 * Returns: 285 * Returns:
286 * The buffer object's reservation object. 286 * The BO's reservation object.
287 */ 287 */
288struct reservation_object *amdgpu_gem_prime_res_obj(struct drm_gem_object *obj) 288struct reservation_object *amdgpu_gem_prime_res_obj(struct drm_gem_object *obj)
289{ 289{
@@ -294,15 +294,15 @@ struct reservation_object *amdgpu_gem_prime_res_obj(struct drm_gem_object *obj)
294 294
295/** 295/**
296 * amdgpu_gem_begin_cpu_access - &dma_buf_ops.begin_cpu_access implementation 296 * amdgpu_gem_begin_cpu_access - &dma_buf_ops.begin_cpu_access implementation
297 * @dma_buf: shared DMA buffer 297 * @dma_buf: Shared DMA buffer
298 * @direction: direction of DMA transfer 298 * @direction: Direction of DMA transfer
299 * 299 *
300 * This is called before CPU access to the shared DMA buffer's memory. If it's 300 * This is called before CPU access to the shared DMA buffer's memory. If it's
301 * a read access, the buffer is moved to the GTT domain if possible, for optimal 301 * a read access, the buffer is moved to the GTT domain if possible, for optimal
302 * CPU read performance. 302 * CPU read performance.
303 * 303 *
304 * Returns: 304 * Returns:
305 * 0 on success or negative error code. 305 * 0 on success or a negative error code on failure.
306 */ 306 */
307static int amdgpu_gem_begin_cpu_access(struct dma_buf *dma_buf, 307static int amdgpu_gem_begin_cpu_access(struct dma_buf *dma_buf,
308 enum dma_data_direction direction) 308 enum dma_data_direction direction)
@@ -349,14 +349,14 @@ static const struct dma_buf_ops amdgpu_dmabuf_ops = {
349/** 349/**
350 * amdgpu_gem_prime_export - &drm_driver.gem_prime_export implementation 350 * amdgpu_gem_prime_export - &drm_driver.gem_prime_export implementation
351 * @dev: DRM device 351 * @dev: DRM device
352 * @gobj: GEM buffer object 352 * @gobj: GEM BO
353 * @flags: flags like DRM_CLOEXEC and DRM_RDWR 353 * @flags: Flags such as DRM_CLOEXEC and DRM_RDWR.
354 * 354 *
355 * The main work is done by the &drm_gem_prime_export helper, which in turn 355 * The main work is done by the &drm_gem_prime_export helper, which in turn
356 * uses &amdgpu_gem_prime_res_obj. 356 * uses &amdgpu_gem_prime_res_obj.
357 * 357 *
358 * Returns: 358 * Returns:
359 * Shared DMA buffer representing the GEM buffer object from the given device. 359 * Shared DMA buffer representing the GEM BO from the given device.
360 */ 360 */
361struct dma_buf *amdgpu_gem_prime_export(struct drm_device *dev, 361struct dma_buf *amdgpu_gem_prime_export(struct drm_device *dev,
362 struct drm_gem_object *gobj, 362 struct drm_gem_object *gobj,
@@ -387,7 +387,7 @@ struct dma_buf *amdgpu_gem_prime_export(struct drm_device *dev,
387 * uses &amdgpu_gem_prime_import_sg_table. 387 * uses &amdgpu_gem_prime_import_sg_table.
388 * 388 *
389 * Returns: 389 * Returns:
390 * GEM buffer object representing the shared DMA buffer for the given device. 390 * GEM BO representing the shared DMA buffer for the given device.
391 */ 391 */
392struct drm_gem_object *amdgpu_gem_prime_import(struct drm_device *dev, 392struct drm_gem_object *amdgpu_gem_prime_import(struct drm_device *dev,
393 struct dma_buf *dma_buf) 393 struct dma_buf *dma_buf)