Skip to content

Commit f39c253

Browse files
committed
drm/amdgpu/gfx10: use generic [en/dis]able_kgq() helpers
And remove the duplicate local variants. Reviewed-by: Hawking Zhang <Hawking.Zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
1 parent 1156e1a commit f39c253

File tree

1 file changed

+2
-46
lines changed

1 file changed

+2
-46
lines changed

drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c

Lines changed: 2 additions & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -6462,28 +6462,6 @@ static int gfx_v10_0_gfx_init_queue(struct amdgpu_ring *ring)
64626462
return 0;
64636463
}
64646464

6465-
static int gfx_v10_0_kiq_enable_kgq(struct amdgpu_device *adev)
6466-
{
6467-
struct amdgpu_kiq *kiq = &adev->gfx.kiq[0];
6468-
struct amdgpu_ring *kiq_ring = &adev->gfx.kiq[0].ring;
6469-
int r, i;
6470-
6471-
if (!kiq->pmf || !kiq->pmf->kiq_map_queues)
6472-
return -EINVAL;
6473-
6474-
r = amdgpu_ring_alloc(kiq_ring, kiq->pmf->map_queues_size *
6475-
adev->gfx.num_gfx_rings);
6476-
if (r) {
6477-
DRM_ERROR("Failed to lock KIQ (%d).\n", r);
6478-
return r;
6479-
}
6480-
6481-
for (i = 0; i < adev->gfx.num_gfx_rings; i++)
6482-
kiq->pmf->kiq_map_queues(kiq_ring, &adev->gfx.gfx_ring[i]);
6483-
6484-
return amdgpu_ring_test_helper(kiq_ring);
6485-
}
6486-
64876465
static int gfx_v10_0_cp_async_gfx_ring_resume(struct amdgpu_device *adev)
64886466
{
64896467
int r, i;
@@ -6507,7 +6485,7 @@ static int gfx_v10_0_cp_async_gfx_ring_resume(struct amdgpu_device *adev)
65076485
goto done;
65086486
}
65096487

6510-
r = gfx_v10_0_kiq_enable_kgq(adev);
6488+
r = amdgpu_gfx_enable_kgq(adev, 0);
65116489
if (r)
65126490
goto done;
65136491

@@ -7178,28 +7156,6 @@ static int gfx_v10_0_hw_init(void *handle)
71787156
return r;
71797157
}
71807158

7181-
static int gfx_v10_0_kiq_disable_kgq(struct amdgpu_device *adev)
7182-
{
7183-
struct amdgpu_kiq *kiq = &adev->gfx.kiq[0];
7184-
struct amdgpu_ring *kiq_ring = &kiq->ring;
7185-
int i;
7186-
7187-
if (!kiq->pmf || !kiq->pmf->kiq_unmap_queues)
7188-
return -EINVAL;
7189-
7190-
if (amdgpu_ring_alloc(kiq_ring, kiq->pmf->unmap_queues_size *
7191-
adev->gfx.num_gfx_rings))
7192-
return -ENOMEM;
7193-
7194-
for (i = 0; i < adev->gfx.num_gfx_rings; i++)
7195-
kiq->pmf->kiq_unmap_queues(kiq_ring, &adev->gfx.gfx_ring[i],
7196-
PREEMPT_QUEUES, 0, 0);
7197-
if (!adev->job_hang)
7198-
return amdgpu_ring_test_helper(kiq_ring);
7199-
else
7200-
return 0;
7201-
}
7202-
72037159
static int gfx_v10_0_hw_fini(void *handle)
72047160
{
72057161
struct amdgpu_device *adev = (struct amdgpu_device *)handle;
@@ -7210,7 +7166,7 @@ static int gfx_v10_0_hw_fini(void *handle)
72107166

72117167
if (!adev->no_hw_access) {
72127168
if (amdgpu_async_gfx_ring) {
7213-
r = gfx_v10_0_kiq_disable_kgq(adev);
7169+
r = amdgpu_gfx_disable_kgq(adev, 0);
72147170
if (r)
72157171
DRM_ERROR("KGQ disable failed\n");
72167172
}

0 commit comments

Comments
 (0)