]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu/gfx: enable mes to map legacy queue support
authorJack Xiao <Jack.Xiao@amd.com>
Fri, 1 Mar 2024 09:40:30 +0000 (17:40 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 2 May 2024 20:18:14 +0000 (16:18 -0400)
Enable mes to map legacy queue support.

v2: drop unused gfx_v12_0_kiq_enable_kgq() (Alex)

Signed-off-by: Jack Xiao <Jack.Xiao@amd.com>
Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c

index be72837c3cf23978b6c026efa826fbe1320f55c3..ca90d6b577c827a131af8f77a3401c1e3c16df33 100644 (file)
@@ -657,7 +657,7 @@ int amdgpu_gfx_enable_kcq(struct amdgpu_device *adev, int xcc_id)
        if (r)
                DRM_ERROR("KCQ enable failed\n");
 
-       if (adev->enable_mes) {
+       if (adev->enable_mes || adev->enable_uni_mes) {
                for (i = 0; i < adev->gfx.num_compute_rings; i++) {
                        j = i + xcc_id * adev->gfx.num_compute_rings;
                        r = amdgpu_mes_map_legacy_queue(adev,
@@ -685,7 +685,7 @@ int amdgpu_gfx_enable_kgq(struct amdgpu_device *adev, int xcc_id)
 
        amdgpu_device_flush_hdp(adev, NULL);
 
-       if (adev->enable_mes) {
+       if (adev->enable_mes || adev->enable_uni_mes) {
                for (i = 0; i < adev->gfx.num_gfx_rings; i++) {
                        j = i + xcc_id * adev->gfx.num_gfx_rings;
                        r = amdgpu_mes_map_legacy_queue(adev,
index 080f5879a55c57c441d01d3a528c3dabf947f12a..fcf2bb0e886cda30f5f8724a945ec3c7af7757b6 100644 (file)
@@ -2707,28 +2707,6 @@ static int gfx_v12_0_gfx_init_queue(struct amdgpu_ring *ring)
        return 0;
 }
 
-static int gfx_v12_0_kiq_enable_kgq(struct amdgpu_device *adev)
-{
-       struct amdgpu_kiq *kiq = &adev->gfx.kiq[0];
-       struct amdgpu_ring *kiq_ring = &adev->gfx.kiq[0].ring;
-       int r, i;
-
-       if (!kiq->pmf || !kiq->pmf->kiq_map_queues)
-               return -EINVAL;
-
-       r = amdgpu_ring_alloc(kiq_ring, kiq->pmf->map_queues_size *
-                                       adev->gfx.num_gfx_rings);
-       if (r) {
-               DRM_ERROR("Failed to lock KIQ (%d).\n", r);
-               return r;
-       }
-
-       for (i = 0; i < adev->gfx.num_gfx_rings; i++)
-               kiq->pmf->kiq_map_queues(kiq_ring, &adev->gfx.gfx_ring[i]);
-
-       return amdgpu_ring_test_helper(kiq_ring);
-}
-
 static int gfx_v12_0_cp_async_gfx_ring_resume(struct amdgpu_device *adev)
 {
        int r, i;
@@ -2751,7 +2729,8 @@ static int gfx_v12_0_cp_async_gfx_ring_resume(struct amdgpu_device *adev)
                if (r)
                        goto done;
        }
-       r = gfx_v12_0_kiq_enable_kgq(adev);
+
+       r = amdgpu_gfx_enable_kgq(adev, 0);
        if (r)
                goto done;