Re: [PATCH 1/4] drm/amdgpu: cleanup struct amdgpu_ring

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 2/1/21 10:34 PM, Alex Deucher wrote:
On Mon, Feb 1, 2021 at 11:13 AM Christian König
<christian.koenig@xxxxxxx> wrote:
Am 01.02.21 um 16:51 schrieb Nirmoy Das:
This patch consist of below related changes:

1 Rename ring->priority to ring->hw_prio.
2 Assign correct hardware ring priority.
3 Remove ring->priority_mutex as ring priority remains unchanged
    after initialization.
4 Remove unused ring->num_jobs.

v3: remove ring->num_jobs.
v2: remove ring->priority_mutex.

Fixes: 33abcb1f5a17 ("drm/amdgpu: set compute queue priority at mqd_init")
Signed-off-by: Nirmoy Das <nirmoy.das@xxxxxxx>
Reviewed-by: Christian König <christian.koenig@xxxxxxx> for patch #1, #3
and #4.

Maybe ping Alex for an rb on patch #2.
Series looks good to me too.  Maybe add something to the commit
message for patch 3 to explain why we don't need this on gfx10 so
someone doesn't try and make the change there in the future.  With
that fixes series is:
Reviewed-by: Alex Deucher <alexander.deucher@xxxxxxx>


Thanks Alex, I will do that.


Nirmoy


Alex



Christian.

---
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 8 ++------
   drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h | 6 +-----
   2 files changed, 3 insertions(+), 11 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
index 1a612f51ecd9..b644c78475fd 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
@@ -166,7 +166,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
                    unsigned int max_dw, struct amdgpu_irq_src *irq_src,
                    unsigned int irq_type, unsigned int hw_prio)
   {
-     int r, i;
+     int r;
       int sched_hw_submission = amdgpu_sched_hw_submission;
       u32 *num_sched;
       u32 hw_ip;
@@ -258,8 +258,7 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
       }

       ring->max_dw = max_dw;
-     ring->priority = DRM_SCHED_PRIORITY_NORMAL;
-     mutex_init(&ring->priority_mutex);
+     ring->hw_prio = hw_prio;

       if (!ring->no_scheduler) {
               hw_ip = ring->funcs->type;
@@ -268,9 +267,6 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
                       &ring->sched;
       }

-     for (i = DRM_SCHED_PRIORITY_MIN; i < DRM_SCHED_PRIORITY_COUNT; ++i)
-             atomic_set(&ring->num_jobs[i], 0);
-
       return 0;
   }

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
index 7112137689db..2ada80ce42f5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h
@@ -242,11 +242,7 @@ struct amdgpu_ring {
       struct dma_fence        *vmid_wait;
       bool                    has_compute_vm_bug;
       bool                    no_scheduler;
-
-     atomic_t                num_jobs[DRM_SCHED_PRIORITY_COUNT];
-     struct mutex            priority_mutex;
-     /* protected by priority_mutex */
-     int                     priority;
+     int                     hw_prio;

   #if defined(CONFIG_DEBUG_FS)
       struct dentry *ent;
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flists.freedesktop.org%2Fmailman%2Flistinfo%2Famd-gfx&amp;data=04%7C01%7Cnirmoy.das%40amd.com%7C39c71cb0cd8d4a0f51fc08d8c6f935ac%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637478120945480670%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=IYRWRIp%2BCN0IZb8z2nSh1VoLtP5bs5AaeKbtnfaXaTg%3D&amp;reserved=0
_______________________________________________
amd-gfx mailing list
amd-gfx@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/amd-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux