diff options
author | Christian König <christian.koenig@amd.com> | 2016-08-23 05:00:17 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2016-08-24 16:25:06 -0400 |
commit | ba0b2275a6781b2f3919d931d63329b5548f6d5f (patch) | |
tree | 0094a9b454d9266e7b068210c9de04a9cb6c99a0 /drivers/gpu/drm/amd/amdgpu | |
parent | 39a5830a05a1b599192346e832eb9fe4ff4f2164 (diff) |
drm/amdgpu: use memcpy_to/fromio for UVD fw upload
Also use the firmware size from the header instead of calculating it.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c index af408b6c6e05..cc766cc53a87 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c | |||
@@ -298,7 +298,7 @@ int amdgpu_uvd_suspend(struct amdgpu_device *adev) | |||
298 | if (!adev->uvd.saved_bo) | 298 | if (!adev->uvd.saved_bo) |
299 | return -ENOMEM; | 299 | return -ENOMEM; |
300 | 300 | ||
301 | memcpy(adev->uvd.saved_bo, ptr, size); | 301 | memcpy_fromio(adev->uvd.saved_bo, ptr, size); |
302 | 302 | ||
303 | return 0; | 303 | return 0; |
304 | } | 304 | } |
@@ -315,7 +315,7 @@ int amdgpu_uvd_resume(struct amdgpu_device *adev) | |||
315 | ptr = adev->uvd.cpu_addr; | 315 | ptr = adev->uvd.cpu_addr; |
316 | 316 | ||
317 | if (adev->uvd.saved_bo != NULL) { | 317 | if (adev->uvd.saved_bo != NULL) { |
318 | memcpy(ptr, adev->uvd.saved_bo, size); | 318 | memcpy_toio(ptr, adev->uvd.saved_bo, size); |
319 | kfree(adev->uvd.saved_bo); | 319 | kfree(adev->uvd.saved_bo); |
320 | adev->uvd.saved_bo = NULL; | 320 | adev->uvd.saved_bo = NULL; |
321 | } else { | 321 | } else { |
@@ -324,11 +324,11 @@ int amdgpu_uvd_resume(struct amdgpu_device *adev) | |||
324 | 324 | ||
325 | hdr = (const struct common_firmware_header *)adev->uvd.fw->data; | 325 | hdr = (const struct common_firmware_header *)adev->uvd.fw->data; |
326 | offset = le32_to_cpu(hdr->ucode_array_offset_bytes); | 326 | offset = le32_to_cpu(hdr->ucode_array_offset_bytes); |
327 | memcpy(adev->uvd.cpu_addr, (adev->uvd.fw->data) + offset, | 327 | memcpy_toio(adev->uvd.cpu_addr, adev->uvd.fw->data + offset, |
328 | (adev->uvd.fw->size) - offset); | 328 | le32_to_cpu(hdr->ucode_size_bytes)); |
329 | size -= le32_to_cpu(hdr->ucode_size_bytes); | 329 | size -= le32_to_cpu(hdr->ucode_size_bytes); |
330 | ptr += le32_to_cpu(hdr->ucode_size_bytes); | 330 | ptr += le32_to_cpu(hdr->ucode_size_bytes); |
331 | memset(ptr, 0, size); | 331 | memset_io(ptr, 0, size); |
332 | } | 332 | } |
333 | 333 | ||
334 | return 0; | 334 | return 0; |