mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-04-23 03:53:56 -04:00
drm/amdgpu/gfx: enable mes to map legacy queue support
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>
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user