Skip to content

Commit d10985f

Browse files
jameszhu-amdalexdeucher
authored andcommitted
Revert "drm/amdgpu/vcn: add shared memory restore after wake up from sleep."
This reverts commit 21b704d. To merge vcn firmware shared memory bo into vcn vcpu bo. Signed-off-by: James Zhu <[email protected]> Reviewed-by: Leo Liu <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent d182e78 commit d10985f

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

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

Lines changed: 1 addition & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static void amdgpu_vcn_idle_work_handler(struct work_struct *work);
6060

6161
int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
6262
{
63-
unsigned long bo_size, fw_shared_bo_size;
63+
unsigned long bo_size;
6464
const char *fw_name;
6565
const struct common_firmware_header *hdr;
6666
unsigned char fw_check;
@@ -206,9 +206,6 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev)
206206
dev_err(adev->dev, "VCN %d (%d) failed to allocate firmware shared bo\n", i, r);
207207
return r;
208208
}
209-
210-
fw_shared_bo_size = amdgpu_bo_size(adev->vcn.inst[i].fw_shared_bo);
211-
adev->vcn.inst[i].saved_shm_bo = kvmalloc(fw_shared_bo_size, GFP_KERNEL);
212209
}
213210

214211
return 0;
@@ -224,7 +221,6 @@ int amdgpu_vcn_sw_fini(struct amdgpu_device *adev)
224221
if (adev->vcn.harvest_config & (1 << j))
225222
continue;
226223

227-
kvfree(adev->vcn.inst[j].saved_shm_bo);
228224
amdgpu_bo_free_kernel(&adev->vcn.inst[j].fw_shared_bo,
229225
&adev->vcn.inst[j].fw_shared_gpu_addr,
230226
(void **)&adev->vcn.inst[j].fw_shared_cpu_addr);
@@ -274,17 +270,6 @@ int amdgpu_vcn_suspend(struct amdgpu_device *adev)
274270
return -ENOMEM;
275271

276272
memcpy_fromio(adev->vcn.inst[i].saved_bo, ptr, size);
277-
278-
if (adev->vcn.inst[i].fw_shared_bo == NULL)
279-
return 0;
280-
281-
if (!adev->vcn.inst[i].saved_shm_bo)
282-
return -ENOMEM;
283-
284-
size = amdgpu_bo_size(adev->vcn.inst[i].fw_shared_bo);
285-
ptr = adev->vcn.inst[i].fw_shared_cpu_addr;
286-
287-
memcpy_fromio(adev->vcn.inst[i].saved_shm_bo, ptr, size);
288273
}
289274
return 0;
290275
}
@@ -322,17 +307,6 @@ int amdgpu_vcn_resume(struct amdgpu_device *adev)
322307
}
323308
memset_io(ptr, 0, size);
324309
}
325-
326-
if (adev->vcn.inst[i].fw_shared_bo == NULL)
327-
return -EINVAL;
328-
329-
size = amdgpu_bo_size(adev->vcn.inst[i].fw_shared_bo);
330-
ptr = adev->vcn.inst[i].fw_shared_cpu_addr;
331-
332-
if (adev->vcn.inst[i].saved_shm_bo != NULL)
333-
memcpy_toio(ptr, adev->vcn.inst[i].saved_shm_bo, size);
334-
else
335-
memset_io(ptr, 0, size);
336310
}
337311
return 0;
338312
}

drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -207,7 +207,6 @@ struct amdgpu_vcn_inst {
207207
atomic_t dpg_enc_submission_cnt;
208208
void *fw_shared_cpu_addr;
209209
uint64_t fw_shared_gpu_addr;
210-
void *saved_shm_bo;
211210
};
212211

213212
struct amdgpu_vcn {

0 commit comments

Comments
 (0)