diff options
| author | Dave Airlie <airlied@redhat.com> | 2018-10-11 00:53:40 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2018-10-11 00:53:45 -0400 |
| commit | ca4b869240d5810ebac6b1570ad7beffcfbac2f5 (patch) | |
| tree | d7e36e551b058316ab35e28f1bb992ce06b2ce0c /drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | |
| parent | 46972c03ab667dc298cad0c9db517fb9b1521b5f (diff) | |
| parent | df2fc43d09d3ee5ede82cab9299df5e78aa427b5 (diff) | |
Merge branch 'drm-next-4.20' of git://people.freedesktop.org/~agd5f/linux into drm-next
Add a new list.h helper for doing bulk updates. Used by ttm.
- Fixes for display underflow on VI APUs at 4K with UVD running
- Endian fixes for powerplay on vega
- DC fixes for interlaced video
- Vega20 powerplay fixes
- RV/RV2/PCO powerplay fixes
- Fix for spurious ACPI events on HG laptops
- Fix a memory leak in DC on driver unload
- Fixes for manual fan control mode switching
- Suspend/resume robustness fixes
- Fix display handling on RV2
- VCN fixes for DPG on PCO
- Misc code cleanups and warning fixes
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181011014739.3117-1-alexander.deucher@amd.com
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 57 |
1 files changed, 7 insertions, 50 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c index 6d5c8ac64874..6fb3edaba0ec 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | |||
| @@ -318,14 +318,13 @@ static int sdma_v3_0_init_microcode(struct amdgpu_device *adev) | |||
| 318 | if (adev->sdma.instance[i].feature_version >= 20) | 318 | if (adev->sdma.instance[i].feature_version >= 20) |
| 319 | adev->sdma.instance[i].burst_nop = true; | 319 | adev->sdma.instance[i].burst_nop = true; |
| 320 | 320 | ||
| 321 | if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU) { | 321 | info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SDMA0 + i]; |
| 322 | info = &adev->firmware.ucode[AMDGPU_UCODE_ID_SDMA0 + i]; | 322 | info->ucode_id = AMDGPU_UCODE_ID_SDMA0 + i; |
| 323 | info->ucode_id = AMDGPU_UCODE_ID_SDMA0 + i; | 323 | info->fw = adev->sdma.instance[i].fw; |
| 324 | info->fw = adev->sdma.instance[i].fw; | 324 | header = (const struct common_firmware_header *)info->fw->data; |
| 325 | header = (const struct common_firmware_header *)info->fw->data; | 325 | adev->firmware.fw_size += |
| 326 | adev->firmware.fw_size += | 326 | ALIGN(le32_to_cpu(header->ucode_size_bytes), PAGE_SIZE); |
| 327 | ALIGN(le32_to_cpu(header->ucode_size_bytes), PAGE_SIZE); | 327 | |
| 328 | } | ||
| 329 | } | 328 | } |
| 330 | out: | 329 | out: |
| 331 | if (err) { | 330 | if (err) { |
| @@ -778,42 +777,6 @@ static int sdma_v3_0_rlc_resume(struct amdgpu_device *adev) | |||
| 778 | } | 777 | } |
| 779 | 778 | ||
| 780 | /** | 779 | /** |
| 781 | * sdma_v3_0_load_microcode - load the sDMA ME ucode | ||
| 782 | * | ||
| 783 | * @adev: amdgpu_device pointer | ||
| 784 | * | ||
| 785 | * Loads the sDMA0/1 ucode. | ||
| 786 | * Returns 0 for success, -EINVAL if the ucode is not available. | ||
| 787 | */ | ||
| 788 | static int sdma_v3_0_load_microcode(struct amdgpu_device *adev) | ||
| 789 | { | ||
| 790 | const struct sdma_firmware_header_v1_0 *hdr; | ||
| 791 | const __le32 *fw_data; | ||
| 792 | u32 fw_size; | ||
| 793 | int i, j; | ||
| 794 | |||
| 795 | /* halt the MEs */ | ||
| 796 | sdma_v3_0_enable(adev, false); | ||
| 797 | |||
| 798 | for (i = 0; i < adev->sdma.num_instances; i++) { | ||
| 799 | if (!adev->sdma.instance[i].fw) | ||
| 800 | return -EINVAL; | ||
| 801 | hdr = (const struct sdma_firmware_header_v1_0 *)adev->sdma.instance[i].fw->data; | ||
| 802 | amdgpu_ucode_print_sdma_hdr(&hdr->header); | ||
| 803 | fw_size = le32_to_cpu(hdr->header.ucode_size_bytes) / 4; | ||
| 804 | fw_data = (const __le32 *) | ||
| 805 | (adev->sdma.instance[i].fw->data + | ||
| 806 | le32_to_cpu(hdr->header.ucode_array_offset_bytes)); | ||
| 807 | WREG32(mmSDMA0_UCODE_ADDR + sdma_offsets[i], 0); | ||
| 808 | for (j = 0; j < fw_size; j++) | ||
| 809 | WREG32(mmSDMA0_UCODE_DATA + sdma_offsets[i], le32_to_cpup(fw_data++)); | ||
| 810 | WREG32(mmSDMA0_UCODE_ADDR + sdma_offsets[i], adev->sdma.instance[i].fw_version); | ||
| 811 | } | ||
| 812 | |||
| 813 | return 0; | ||
| 814 | } | ||
| 815 | |||
| 816 | /** | ||
| 817 | * sdma_v3_0_start - setup and start the async dma engines | 780 | * sdma_v3_0_start - setup and start the async dma engines |
| 818 | * | 781 | * |
| 819 | * @adev: amdgpu_device pointer | 782 | * @adev: amdgpu_device pointer |
| @@ -825,12 +788,6 @@ static int sdma_v3_0_start(struct amdgpu_device *adev) | |||
| 825 | { | 788 | { |
| 826 | int r; | 789 | int r; |
| 827 | 790 | ||
| 828 | if (adev->firmware.load_type == AMDGPU_FW_LOAD_DIRECT) { | ||
| 829 | r = sdma_v3_0_load_microcode(adev); | ||
| 830 | if (r) | ||
| 831 | return r; | ||
| 832 | } | ||
| 833 | |||
| 834 | /* disable sdma engine before programing it */ | 791 | /* disable sdma engine before programing it */ |
| 835 | sdma_v3_0_ctx_switch_enable(adev, false); | 792 | sdma_v3_0_ctx_switch_enable(adev, false); |
| 836 | sdma_v3_0_enable(adev, false); | 793 | sdma_v3_0_enable(adev, false); |
