mirror of
https://github.com/torvalds/linux.git
synced 2026-09-24 06:24:02 +02:00
drm/amdgpu/gfx12: use the new MQD helper for queue reset
And while we are at it remove the reset parameter as it's no longer needed. Reviewed-by: Jesse Zhang <jesse.zhang@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
0f1c75242b
commit
1563844c5b
|
|
@ -3071,13 +3071,13 @@ static int gfx_v12_0_gfx_mqd_init(struct amdgpu_device *adev, void *m,
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int gfx_v12_0_kgq_init_queue(struct amdgpu_ring *ring, bool reset)
|
||||
static int gfx_v12_0_kgq_init_queue(struct amdgpu_ring *ring)
|
||||
{
|
||||
struct amdgpu_device *adev = ring->adev;
|
||||
struct v12_gfx_mqd *mqd = ring->mqd_ptr;
|
||||
int mqd_idx = ring - &adev->gfx.gfx_ring[0];
|
||||
|
||||
if (!reset && !amdgpu_in_reset(adev) && !adev->in_suspend) {
|
||||
if (!amdgpu_in_reset(adev) && !adev->in_suspend) {
|
||||
memset((void *)mqd, 0, sizeof(*mqd));
|
||||
mutex_lock(&adev->srbm_mutex);
|
||||
soc24_grbm_select(adev, ring->me, ring->pipe, ring->queue, 0);
|
||||
|
|
@ -3104,7 +3104,7 @@ static int gfx_v12_0_cp_async_gfx_ring_resume(struct amdgpu_device *adev)
|
|||
int i, r;
|
||||
|
||||
for (i = 0; i < adev->gfx.num_gfx_rings; i++) {
|
||||
r = gfx_v12_0_kgq_init_queue(&adev->gfx.gfx_ring[i], false);
|
||||
r = gfx_v12_0_kgq_init_queue(&adev->gfx.gfx_ring[i]);
|
||||
if (r)
|
||||
return r;
|
||||
}
|
||||
|
|
@ -3441,13 +3441,13 @@ static int gfx_v12_0_kiq_init_queue(struct amdgpu_ring *ring)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static int gfx_v12_0_kcq_init_queue(struct amdgpu_ring *ring, bool reset)
|
||||
static int gfx_v12_0_kcq_init_queue(struct amdgpu_ring *ring)
|
||||
{
|
||||
struct amdgpu_device *adev = ring->adev;
|
||||
struct v12_compute_mqd *mqd = ring->mqd_ptr;
|
||||
int mqd_idx = ring - &adev->gfx.compute_ring[0];
|
||||
|
||||
if (!reset && !amdgpu_in_reset(adev) && !adev->in_suspend) {
|
||||
if (!amdgpu_in_reset(adev) && !adev->in_suspend) {
|
||||
memset((void *)mqd, 0, sizeof(*mqd));
|
||||
mutex_lock(&adev->srbm_mutex);
|
||||
soc24_grbm_select(adev, ring->me, ring->pipe, ring->queue, 0);
|
||||
|
|
@ -3485,7 +3485,7 @@ static int gfx_v12_0_kcq_resume(struct amdgpu_device *adev)
|
|||
gfx_v12_0_cp_compute_enable(adev, true);
|
||||
|
||||
for (i = 0; i < adev->gfx.num_compute_rings; i++) {
|
||||
r = gfx_v12_0_kcq_init_queue(&adev->gfx.compute_ring[i], false);
|
||||
r = gfx_v12_0_kcq_init_queue(&adev->gfx.compute_ring[i]);
|
||||
if (r)
|
||||
return r;
|
||||
}
|
||||
|
|
@ -5255,11 +5255,7 @@ static int gfx_v12_0_reset_kgq(struct amdgpu_ring *ring,
|
|||
return r;
|
||||
|
||||
if (use_mmio) {
|
||||
r = gfx_v12_0_kgq_init_queue(ring, true);
|
||||
if (r) {
|
||||
dev_err(adev->dev, "failed to init kgq\n");
|
||||
return r;
|
||||
}
|
||||
amdgpu_gfx_mqd_reset_restore(ring);
|
||||
|
||||
r = amdgpu_mes_map_legacy_queue(adev, ring, 0);
|
||||
if (r) {
|
||||
|
|
@ -5286,11 +5282,8 @@ static int gfx_v12_0_reset_kcq(struct amdgpu_ring *ring,
|
|||
return r;
|
||||
|
||||
if (use_mmio) {
|
||||
r = gfx_v12_0_kcq_init_queue(ring, true);
|
||||
if (r) {
|
||||
dev_err(adev->dev, "failed to init kcq\n");
|
||||
return r;
|
||||
}
|
||||
amdgpu_gfx_mqd_reset_restore(ring);
|
||||
|
||||
r = amdgpu_mes_map_legacy_queue(adev, ring, 0);
|
||||
if (r) {
|
||||
dev_err(adev->dev, "failed to remap kcq\n");
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user