diff options
| author | Dave Airlie <airlied@redhat.com> | 2018-11-01 22:56:24 -0400 |
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2018-11-01 22:56:28 -0400 |
| commit | 43e0f873b2f2226f454930172f8090819d380f5a (patch) | |
| tree | 4eed99a486aa1ef6c7f30aafbeca29443c3a91d8 | |
| parent | 52b50ae1af8a9672792c55b23471a3488dec7229 (diff) | |
| parent | 9d064be1e6a195eaaa3762af5c7c6cd3f66aa6cc (diff) | |
Merge branch 'drm-next-4.20' of git://people.freedesktop.org/~agd5f/linux into drm-next
- Fix flickering at low backlight levels on some systems
- Fix some overclocking regressions
- Vega20 updates for
- GPU recovery fixes
- Disable gfxoff on RV as some sbios/fw combinations are not stable yet
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Alex Deucher <alexdeucher@gmail.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181101151939.2828-1-alexander.deucher@amd.com
21 files changed, 207 insertions, 115 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c index 297a5490ad8c..0a4fba196b84 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_acp.c | |||
| @@ -135,7 +135,8 @@ static int acp_poweroff(struct generic_pm_domain *genpd) | |||
| 135 | * 2. power off the acp tiles | 135 | * 2. power off the acp tiles |
| 136 | * 3. check and enter ulv state | 136 | * 3. check and enter ulv state |
| 137 | */ | 137 | */ |
| 138 | if (adev->powerplay.pp_funcs->set_powergating_by_smu) | 138 | if (adev->powerplay.pp_funcs && |
| 139 | adev->powerplay.pp_funcs->set_powergating_by_smu) | ||
| 139 | amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, true); | 140 | amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, true); |
| 140 | } | 141 | } |
| 141 | return 0; | 142 | return 0; |
| @@ -517,7 +518,8 @@ static int acp_set_powergating_state(void *handle, | |||
| 517 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; | 518 | struct amdgpu_device *adev = (struct amdgpu_device *)handle; |
| 518 | bool enable = state == AMD_PG_STATE_GATE ? true : false; | 519 | bool enable = state == AMD_PG_STATE_GATE ? true : false; |
| 519 | 520 | ||
| 520 | if (adev->powerplay.pp_funcs->set_powergating_by_smu) | 521 | if (adev->powerplay.pp_funcs && |
| 522 | adev->powerplay.pp_funcs->set_powergating_by_smu) | ||
| 521 | amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, enable); | 523 | amdgpu_dpm_set_powergating_by_smu(adev, AMD_IP_BLOCK_TYPE_ACP, enable); |
| 522 | 524 | ||
| 523 | return 0; | 525 | return 0; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 1e4dd09a5072..30bc345d6fdf 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
| @@ -1493,8 +1493,6 @@ static int amdgpu_device_ip_early_init(struct amdgpu_device *adev) | |||
| 1493 | } | 1493 | } |
| 1494 | 1494 | ||
| 1495 | adev->powerplay.pp_feature = amdgpu_pp_feature_mask; | 1495 | adev->powerplay.pp_feature = amdgpu_pp_feature_mask; |
| 1496 | if (amdgpu_sriov_vf(adev)) | ||
| 1497 | adev->powerplay.pp_feature &= ~PP_GFXOFF_MASK; | ||
| 1498 | 1496 | ||
| 1499 | for (i = 0; i < adev->num_ip_blocks; i++) { | 1497 | for (i = 0; i < adev->num_ip_blocks; i++) { |
| 1500 | if ((amdgpu_ip_block_mask & (1 << i)) == 0) { | 1498 | if ((amdgpu_ip_block_mask & (1 << i)) == 0) { |
| @@ -1600,7 +1598,7 @@ static int amdgpu_device_fw_loading(struct amdgpu_device *adev) | |||
| 1600 | } | 1598 | } |
| 1601 | } | 1599 | } |
| 1602 | 1600 | ||
| 1603 | if (adev->powerplay.pp_funcs->load_firmware) { | 1601 | if (adev->powerplay.pp_funcs && adev->powerplay.pp_funcs->load_firmware) { |
| 1604 | r = adev->powerplay.pp_funcs->load_firmware(adev->powerplay.pp_handle); | 1602 | r = adev->powerplay.pp_funcs->load_firmware(adev->powerplay.pp_handle); |
| 1605 | if (r) { | 1603 | if (r) { |
| 1606 | pr_err("firmware loading failed\n"); | 1604 | pr_err("firmware loading failed\n"); |
| @@ -3341,7 +3339,7 @@ int amdgpu_device_gpu_recover(struct amdgpu_device *adev, | |||
| 3341 | 3339 | ||
| 3342 | kthread_park(ring->sched.thread); | 3340 | kthread_park(ring->sched.thread); |
| 3343 | 3341 | ||
| 3344 | if (job && job->base.sched == &ring->sched) | 3342 | if (job && job->base.sched != &ring->sched) |
| 3345 | continue; | 3343 | continue; |
| 3346 | 3344 | ||
| 3347 | drm_sched_hw_job_reset(&ring->sched, job ? &job->base : NULL); | 3345 | drm_sched_hw_job_reset(&ring->sched, job ? &job->base : NULL); |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c index 28781414d71c..943dbf3c5da1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c | |||
| @@ -114,8 +114,8 @@ uint amdgpu_pg_mask = 0xffffffff; | |||
| 114 | uint amdgpu_sdma_phase_quantum = 32; | 114 | uint amdgpu_sdma_phase_quantum = 32; |
| 115 | char *amdgpu_disable_cu = NULL; | 115 | char *amdgpu_disable_cu = NULL; |
| 116 | char *amdgpu_virtual_display = NULL; | 116 | char *amdgpu_virtual_display = NULL; |
| 117 | /* OverDrive(bit 14) disabled by default*/ | 117 | /* OverDrive(bit 14),gfxoff(bit 15),stutter mode(bit 17) disabled by default*/ |
| 118 | uint amdgpu_pp_feature_mask = 0xffffbfff; | 118 | uint amdgpu_pp_feature_mask = 0xfffd3fff; |
| 119 | int amdgpu_ngg = 0; | 119 | int amdgpu_ngg = 0; |
| 120 | int amdgpu_prim_buf_per_se = 0; | 120 | int amdgpu_prim_buf_per_se = 0; |
| 121 | int amdgpu_pos_buf_per_se = 0; | 121 | int amdgpu_pos_buf_per_se = 0; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c index 790fd5408ddf..1a656b8657f7 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c | |||
| @@ -392,7 +392,7 @@ void amdgpu_gfx_off_ctrl(struct amdgpu_device *adev, bool enable) | |||
| 392 | if (!(adev->powerplay.pp_feature & PP_GFXOFF_MASK)) | 392 | if (!(adev->powerplay.pp_feature & PP_GFXOFF_MASK)) |
| 393 | return; | 393 | return; |
| 394 | 394 | ||
| 395 | if (!adev->powerplay.pp_funcs->set_powergating_by_smu) | 395 | if (!adev->powerplay.pp_funcs || !adev->powerplay.pp_funcs->set_powergating_by_smu) |
| 396 | return; | 396 | return; |
| 397 | 397 | ||
| 398 | 398 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index 94055a485e01..59cc678de8c1 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
| @@ -704,7 +704,10 @@ static ssize_t amdgpu_set_pp_dpm_sclk(struct device *dev, | |||
| 704 | return ret; | 704 | return ret; |
| 705 | 705 | ||
| 706 | if (adev->powerplay.pp_funcs->force_clock_level) | 706 | if (adev->powerplay.pp_funcs->force_clock_level) |
| 707 | amdgpu_dpm_force_clock_level(adev, PP_SCLK, mask); | 707 | ret = amdgpu_dpm_force_clock_level(adev, PP_SCLK, mask); |
| 708 | |||
| 709 | if (ret) | ||
| 710 | return -EINVAL; | ||
| 708 | 711 | ||
| 709 | return count; | 712 | return count; |
| 710 | } | 713 | } |
| @@ -737,7 +740,10 @@ static ssize_t amdgpu_set_pp_dpm_mclk(struct device *dev, | |||
| 737 | return ret; | 740 | return ret; |
| 738 | 741 | ||
| 739 | if (adev->powerplay.pp_funcs->force_clock_level) | 742 | if (adev->powerplay.pp_funcs->force_clock_level) |
| 740 | amdgpu_dpm_force_clock_level(adev, PP_MCLK, mask); | 743 | ret = amdgpu_dpm_force_clock_level(adev, PP_MCLK, mask); |
| 744 | |||
| 745 | if (ret) | ||
| 746 | return -EINVAL; | ||
| 741 | 747 | ||
| 742 | return count; | 748 | return count; |
| 743 | } | 749 | } |
| @@ -770,7 +776,10 @@ static ssize_t amdgpu_set_pp_dpm_pcie(struct device *dev, | |||
| 770 | return ret; | 776 | return ret; |
| 771 | 777 | ||
| 772 | if (adev->powerplay.pp_funcs->force_clock_level) | 778 | if (adev->powerplay.pp_funcs->force_clock_level) |
| 773 | amdgpu_dpm_force_clock_level(adev, PP_PCIE, mask); | 779 | ret = amdgpu_dpm_force_clock_level(adev, PP_PCIE, mask); |
| 780 | |||
| 781 | if (ret) | ||
| 782 | return -EINVAL; | ||
| 774 | 783 | ||
| 775 | return count; | 784 | return count; |
| 776 | } | 785 | } |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index 6904d794d60a..352b30409060 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
| @@ -542,7 +542,8 @@ static void amdgpu_vm_pt_next_leaf(struct amdgpu_device *adev, | |||
| 542 | struct amdgpu_vm_pt_cursor *cursor) | 542 | struct amdgpu_vm_pt_cursor *cursor) |
| 543 | { | 543 | { |
| 544 | amdgpu_vm_pt_next(adev, cursor); | 544 | amdgpu_vm_pt_next(adev, cursor); |
| 545 | while (amdgpu_vm_pt_descendant(adev, cursor)); | 545 | if (cursor->pfn != ~0ll) |
| 546 | while (amdgpu_vm_pt_descendant(adev, cursor)); | ||
| 546 | } | 547 | } |
| 547 | 548 | ||
| 548 | /** | 549 | /** |
| @@ -3234,8 +3235,10 @@ void amdgpu_vm_fini(struct amdgpu_device *adev, struct amdgpu_vm *vm) | |||
| 3234 | } | 3235 | } |
| 3235 | rbtree_postorder_for_each_entry_safe(mapping, tmp, | 3236 | rbtree_postorder_for_each_entry_safe(mapping, tmp, |
| 3236 | &vm->va.rb_root, rb) { | 3237 | &vm->va.rb_root, rb) { |
| 3238 | /* Don't remove the mapping here, we don't want to trigger a | ||
| 3239 | * rebalance and the tree is about to be destroyed anyway. | ||
| 3240 | */ | ||
| 3237 | |||
