drm/amdgpu: Fix incorrect enum type
authorGrigory Vasilyev <h0tc0d3@gmail.com>
Fri, 8 Apr 2022 07:58:17 +0000 (10:58 +0300)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 11 Apr 2022 17:50:35 +0000 (13:50 -0400)
Instead of the 'amdgpu_ring_priority_level' type,
the 'amdgpu_gfx_pipe_priority' type was used,
which is an error when setting ring priority.
This is a minor error, but may cause problems in the future.

Instead of AMDGPU_RING_PRIO_2 = 2, we can use AMDGPU_RING_PRIO_MAX = 3,
but AMDGPU_RING_PRIO_2 = 2 is used for compatibility with
AMDGPU_GFX_PIPE_PRIO_HIGH = 2, and not change the behavior of the
code.

Signed-off-by: Grigory Vasilyev <h0tc0d3@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c

index 5147358f240069ec663750f1b09e7d89ecfecbec..54446162db8b71b4144a04b626f53b738a25a814 100644 (file)
@@ -4741,7 +4741,7 @@ static int gfx_v10_0_compute_ring_init(struct amdgpu_device *adev, int ring_id,
                + ((ring->me - 1) * adev->gfx.mec.num_pipe_per_mec)
                + ring->pipe;
        hw_prio = amdgpu_gfx_is_high_priority_compute_queue(adev, ring) ?
-                       AMDGPU_GFX_PIPE_PRIO_HIGH : AMDGPU_GFX_PIPE_PRIO_NORMAL;
+                       AMDGPU_RING_PRIO_2 : AMDGPU_RING_PRIO_DEFAULT;
        /* type-2 packets are deprecated on MEC, use type-3 instead */
        r = amdgpu_ring_init(adev, ring, 1024, &adev->gfx.eop_irq, irq_type,
                             hw_prio, NULL);
index 46d436be74ebdcbe65bbc14d41428926f9a121df..25dc729d0ec2dc5009ca3f44b0c50d7b11dca22c 100644 (file)
@@ -1925,7 +1925,7 @@ static int gfx_v8_0_compute_ring_init(struct amdgpu_device *adev, int ring_id,
                + ring->pipe;
 
        hw_prio = amdgpu_gfx_is_high_priority_compute_queue(adev, ring) ?
-                       AMDGPU_GFX_PIPE_PRIO_HIGH : AMDGPU_RING_PRIO_DEFAULT;
+                       AMDGPU_RING_PRIO_2 : AMDGPU_RING_PRIO_DEFAULT;
        /* type-2 packets are deprecated on MEC, use type-3 instead */
        r = amdgpu_ring_init(adev, ring, 1024, &adev->gfx.eop_irq, irq_type,
                             hw_prio, NULL);
index 26535ebec4983ef16642857e501f277d5117c5c2..d58fd83524ac70d1c481fa26f9d3e80242a3f4ef 100644 (file)
@@ -2276,7 +2276,7 @@ static int gfx_v9_0_compute_ring_init(struct amdgpu_device *adev, int ring_id,
                + ((ring->me - 1) * adev->gfx.mec.num_pipe_per_mec)
                + ring->pipe;
        hw_prio = amdgpu_gfx_is_high_priority_compute_queue(adev, ring) ?
-                       AMDGPU_GFX_PIPE_PRIO_HIGH : AMDGPU_GFX_PIPE_PRIO_NORMAL;
+                       AMDGPU_RING_PRIO_2 : AMDGPU_RING_PRIO_DEFAULT;
        /* type-2 packets are deprecated on MEC, use type-3 instead */
        return amdgpu_ring_init(adev, ring, 1024, &adev->gfx.eop_irq, irq_type,
                                hw_prio, NULL);