Skip to contentSkip to conversation

drm/amdgpu/ttm: make some functions static

PATCH In review Alex Deucher 3 participants 4 messages Jul 5, 2019 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drm/amdgpu/ttm: make some functions static

Noticed while reviewing the code.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 14 +++++++-------
 drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h |  6 ------
 2 files changed, 7 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +7 -7
index c9faa69cd677..d090106ef23b 100644
@@ -299,12 +299,12 @@ static struct drm_mm_node *amdgpu_find_mm_node(struct ttm_mem_reg *mem,
  *
  * @f: Returns the last fence if multiple jobs are submitted.
  */
-int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
-			       struct amdgpu_copy_mem *src,
-			       struct amdgpu_copy_mem *dst,
-			       uint64_t size,
-			       struct reservation_object *resv,
-			       struct dma_fence **f)
+static int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
+				      struct amdgpu_copy_mem *src,
+				      struct amdgpu_copy_mem *dst,
+				      uint64_t size,
+				      struct reservation_object *resv,
+				      struct dma_fence **f)
 {
 	struct amdgpu_ring *ring = adev->mman.buffer_funcs_ring;
 	struct drm_mm_node *src_mm, *dst_mm;
@@ -949,7 +949,7 @@ static void amdgpu_ttm_tt_unpin_userptr(struct ttm_tt *ttm)
 #endif
 }
 
-int amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
+static int amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
 				struct ttm_buffer_object *tbo,
 				uint64_t flags)
 {
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +0 -6
index c2b7669004ba..de89c218db26 100644
@@ -86,12 +86,6 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset,
 		       struct reservation_object *resv,
 		       struct dma_fence **fence, bool direct_submit,
 		       bool vm_needs_flush);
-int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
-			       struct amdgpu_copy_mem *src,
-			       struct amdgpu_copy_mem *dst,
-			       uint64_t size,
-			       struct reservation_object *resv,
-			       struct dma_fence **f);
 int amdgpu_fill_buffer(struct amdgpu_bo *bo,
 			uint32_t src_data,
 			struct reservation_object *resv,
Signature · 6 lines
2.20.1

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): 20190705171227.21009-1-alexander.deucher-5C7GfCeVMHo@public.gmane.org

Reviewed-by Felix Kuehling
#2 lore raw
Quoted 3 lines · Alex Deucher

Noticed while reviewing the code.

We'll need to be careful not to merge this change on amd-kfd-staging and amd-staging-dkms. On those branches, this function is called from amdgpu_amdkfd_gpuvm.c.

Regards,
  Felix

Quoted 44 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 14 +++++++-------
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h |  6 ------
  2 files changed, 7 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +7 -7
index c9faa69cd677..d090106ef23b 100644
@@ -299,12 +299,12 @@ static struct drm_mm_node *amdgpu_find_mm_node(struct ttm_mem_reg *mem,
   *
   * @f: Returns the last fence if multiple jobs are submitted.
   */
-int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
-			       struct amdgpu_copy_mem *src,
-			       struct amdgpu_copy_mem *dst,
-			       uint64_t size,
-			       struct reservation_object *resv,
-			       struct dma_fence **f)
+static int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
+				      struct amdgpu_copy_mem *src,
+				      struct amdgpu_copy_mem *dst,
+				      uint64_t size,
+				      struct reservation_object *resv,
+				      struct dma_fence **f)
  {
  	struct amdgpu_ring *ring = adev->mman.buffer_funcs_ring;
  	struct drm_mm_node *src_mm, *dst_mm;
@@ -949,7 +949,7 @@ static void amdgpu_ttm_tt_unpin_userptr(struct ttm_tt *ttm)
  #endif
  }
 
-int amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
+static int amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
  				struct ttm_buffer_object *tbo,
  				uint64_t flags)
  {
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +0 -0
index c2b7669004ba..de89c218db26 100644
@@ -86,12 +86,6 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset,
  		       struct reservation_object *resv,
  		       struct dma_fence **fence, bool direct_submit,

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset, · line 91

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +0 -6
  		       bool vm_needs_flush);
-int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
-			       struct amdgpu_copy_mem *src,
-			       struct amdgpu_copy_mem *dst,
-			       uint64_t size,
-			       struct reservation_object *resv,
-			       struct dma_fence **f);
  int amdgpu_fill_buffer(struct amdgpu_bo *bo,
  			uint32_t src_data,
  			struct reservation_object *resv,

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): f4c1f72f-9dfa-da35-eb1f-5f58dbabdc3f-5C7GfCeVMHo@public.gmane.org

Reviewed-by Felix Kuehling
#4 lore raw

How would we handle that? Having a revert on amd-kfd-staging? We can ensure that amd-staging-dkms doesn't cherrypick it in, but since KFD merges, it would be more complicated.

Kent

KENT RUSSELL
Sr. Software Engineer | Linux Compute Kernel
1 Commerce Valley Drive East
Markham, ON L3T 7X6
O +(1) 289-695-2122 | Ext 72122
________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Kuehling, Felix <[email protected]>
Sent: Friday, July 5, 2019 2:59:31 PM
To: Alex Deucher; [email protected]
Cc: Deucher, Alexander
Subject: Re: [PATCH] drm/amdgpu/ttm: make some functions static

Quoted 3 lines · Alex Deucher

Noticed while reviewing the code.

We'll need to be careful not to merge this change on amd-kfd-staging and amd-staging-dkms. On those branches, this function is called from amdgpu_amdkfd_gpuvm.c.

Regards,
Felix

Quoted 44 lines
---
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 14 +++++++-------
  drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h |  6 ------
  2 files changed, 7 insertions(+), 13 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +7 -7
index c9faa69cd677..d090106ef23b 100644
@@ -299,12 +299,12 @@ static struct drm_mm_node *amdgpu_find_mm_node(struct ttm_mem_reg *mem,
   *
   * @f: Returns the last fence if multiple jobs are submitted.
   */
-int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
-                            struct amdgpu_copy_mem *src,
-                            struct amdgpu_copy_mem *dst,
-                            uint64_t size,
-                            struct reservation_object *resv,
-                            struct dma_fence **f)
+static int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
+                                   struct amdgpu_copy_mem *src,
+                                   struct amdgpu_copy_mem *dst,
+                                   uint64_t size,
+                                   struct reservation_object *resv,
+                                   struct dma_fence **f)
  {
       struct amdgpu_ring *ring = adev->mman.buffer_funcs_ring;
       struct drm_mm_node *src_mm, *dst_mm;
@@ -949,7 +949,7 @@ static void amdgpu_ttm_tt_unpin_userptr(struct ttm_tt *ttm)
  #endif
  }
 
-int amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
+static int amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
                               struct ttm_buffer_object *tbo,
                               uint64_t flags)
  {
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +0 -0
index c2b7669004ba..de89c218db26 100644
@@ -86,12 +86,6 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset,
                      struct reservation_object *resv,
                      struct dma_fence **fence, bool direct_submit,

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset, · line 91

Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +0 -6
                      bool vm_needs_flush);
-int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
-                            struct amdgpu_copy_mem *src,
-                            struct amdgpu_copy_mem *dst,
-                            uint64_t size,
-                            struct reservation_object *resv,
-                            struct dma_fence **f);
  int amdgpu_fill_buffer(struct amdgpu_bo *bo,
                       uint32_t src_data,
                       struct reservation_object *resv,

_______________________________________________
amd-gfx mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

A message that is not in the archive (sent off-list or not yet received): BN6PR12MB161810373183A43F8FE1AB7085F50-/b2+HYfkarRqaFUXYJa4HgdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

#6 lore raw
Quoted 3 lines · Kent

How would we handle that? Having a revert on amd-kfd-staging? We can ensure that amd-staging-dkms doesn't cherrypick it in, but since KFD merges, it would be more complicated.

You could manually edit the merge commit before submitting it. Like you would do when resolving a conflict.

Regards,
  Felix

Quoted 88 lines

Kent

KENT RUSSELL
Sr. Software Engineer | Linux Compute Kernel
1 Commerce Valley Drive East
Markham, ON L3T 7X6
O +(1) 289-695-2122 | Ext 72122
------------------------------------------------------------------------
*From:* amd-gfx <[email protected]> on behalf of Kuehling, Felix <[email protected]>
*Sent:* Friday, July 5, 2019 2:59:31 PM
*To:* Alex Deucher; [email protected]
*Cc:* Deucher, Alexander
*Subject:* Re: [PATCH] drm/amdgpu/ttm: make some functions static

Quoted 3 lines · Alex Deucher

Noticed while reviewing the code.

We'll need to be careful not to merge this change on amd-kfd-staging and amd-staging-dkms. On those branches, this function is called from amdgpu_amdkfd_gpuvm.c.

Regards,
   Felix

Review

Quoted 6 lines

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 14 +++++++------- drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h |  6 ------

   2 files changed, 7 insertions(+), 13 deletions(-)
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c static struct drm_mm_node

Quoted 4 lines

index c9faa69cd677..d090106ef23b 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +0 -0
@@ -299,12 +299,12 @@ static struct drm_mm_node 

*amdgpu_find_mm_node(struct ttm_mem_reg *mem,

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c static void amdgpu_ttm_tt_unpin_userptr(struct

Quoted 19 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +6 -6
     *
     * @f: Returns the last fence if multiple jobs are submitted.
     */
-int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
-                            struct amdgpu_copy_mem *src,
-                            struct amdgpu_copy_mem *dst,
-                            uint64_t size,
-                            struct reservation_object *resv,
-                            struct dma_fence **f)
+static int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
+                                   struct amdgpu_copy_mem *src,
+                                   struct amdgpu_copy_mem *dst,
+                                   uint64_t size,
+                                   struct reservation_object *resv,
+                                   struct dma_fence **f)
    {
         struct amdgpu_ring *ring = adev->mman.buffer_funcs_ring;
         struct drm_mm_node *src_mm, *dst_mm;
@@ -949,7 +949,7 @@ static void amdgpu_ttm_tt_unpin_userptr(struct 

ttm_tt *ttm)

Review

Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +1 -1
    #endif
    }
 
-int amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
+static int amdgpu_ttm_gart_bind(struct amdgpu_device *adev,
                                 struct ttm_buffer_object *tbo,
                                 uint64_t flags)
    {
(quoted diff) +0 -0

b/drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h int amdgpu_copy_buffer(struct amdgpu_ring *ring,

Quoted 4 lines

index c2b7669004ba..de89c218db26 100644

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +0 -0
@@ -86,12 +86,6 @@ int amdgpu_copy_buffer(struct amdgpu_ring *ring, 

uint64_t src_offset,

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h int amdgpu_copy_buffer(struct amdgpu_ring *ring, uint64_t src_offset, · line 91

Quoted 12 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.h +0 -6
                        struct reservation_object *resv,
                        struct dma_fence **fence, bool direct_submit,
                        bool vm_needs_flush);
-int amdgpu_ttm_copy_mem_to_mem(struct amdgpu_device *adev,
-                            struct amdgpu_copy_mem *src,
-                            struct amdgpu_copy_mem *dst,
-                            uint64_t size,
-                            struct reservation_object *resv,
-                            struct dma_fence **f);
    int amdgpu_fill_buffer(struct amdgpu_bo *bo,
                         uint32_t src_data,
                         struct reservation_object *resv,
Quoted 4 lines

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx