mirror of
https://github.com/torvalds/linux.git
synced 2026-05-01 13:02:35 -04:00
drm/amdgpu/gfx10: fix mqd backup/restore for gfx rings (v2)
1. no need to allocate an extra member for 'mqd_backup' array 2. backup/restore mqd to/from the correct 'mqd_backup' array slot v2: warning fix (Alex) Signed-off-by: Xiaojie Yuan <xiaojie.yuan@amd.com> Acked-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
17eee668b3
commit
0900a9efdb
@@ -3114,6 +3114,7 @@ static int gfx_v10_0_gfx_init_queue(struct amdgpu_ring *ring)
|
||||
{
|
||||
struct amdgpu_device *adev = ring->adev;
|
||||
struct v10_gfx_mqd *mqd = ring->mqd_ptr;
|
||||
int mqd_idx = ring - &adev->gfx.gfx_ring[0];
|
||||
|
||||
if (!adev->in_gpu_reset && !adev->in_suspend) {
|
||||
memset((void *)mqd, 0, sizeof(*mqd));
|
||||
@@ -3125,12 +3126,12 @@ static int gfx_v10_0_gfx_init_queue(struct amdgpu_ring *ring)
|
||||
#endif
|
||||
nv_grbm_select(adev, 0, 0, 0, 0);
|
||||
mutex_unlock(&adev->srbm_mutex);
|
||||
if (adev->gfx.me.mqd_backup[AMDGPU_MAX_GFX_RINGS])
|
||||
memcpy(adev->gfx.me.mqd_backup[AMDGPU_MAX_GFX_RINGS], mqd, sizeof(*mqd));
|
||||
if (adev->gfx.me.mqd_backup[mqd_idx])
|
||||
memcpy(adev->gfx.me.mqd_backup[mqd_idx], mqd, sizeof(*mqd));
|
||||
} else if (adev->in_gpu_reset) {
|
||||
/* reset mqd with the backup copy */
|
||||
if (adev->gfx.me.mqd_backup[AMDGPU_MAX_GFX_RINGS])
|
||||
memcpy(mqd, adev->gfx.me.mqd_backup[AMDGPU_MAX_GFX_RINGS], sizeof(*mqd));
|
||||
if (adev->gfx.me.mqd_backup[mqd_idx])
|
||||
memcpy(mqd, adev->gfx.me.mqd_backup[mqd_idx], sizeof(*mqd));
|
||||
/* reset the ring */
|
||||
ring->wptr = 0;
|
||||
adev->wb.wb[ring->wptr_offs] = 0;
|
||||
|
||||
Reference in New Issue
Block a user