diff options
author | Dave Airlie <airlied@redhat.com> | 2017-11-22 19:56:11 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2017-11-22 19:56:11 -0500 |
commit | 9cae7751dc6896fb0c11ac858d3cbd9d6a8c022f (patch) | |
tree | d01ec99e5703f9a12bda4bc4ab36dad0539c3d4c | |
parent | af5ecb53c8333df424aedf97024f38ea4ec5cbb2 (diff) | |
parent | 446947b44fb8cabc0213ff4efd706931e36b1963 (diff) |
Merge branch 'drm-next-4.15' of git://people.freedesktop.org/~agd5f/linux into drm-next
more misc amdgpu fixes.
* 'drm-next-4.15' of git://people.freedesktop.org/~agd5f/linux:
drm/amdgpu: fix rmmod KCQ disable failed error
drm/amdgpu: fix kernel hang when starting VNC server
drm/amdgpu: don't skip attributes when powerplay is enabled
drm/amd/pp: fix typecast error in powerplay.
Revert "drm/radeon: dont switch vt on suspend"
drm/amd/amdgpu: fix over-bound accessing in amdgpu_cs_wait_any_fence
drm/amd/powerplay: fix unfreeze level smc message for smu7
drm/amdgpu:fix memleak
drm/amdgpu:fix memleak in takedown
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | 6 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | 5 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 9 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 8 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | 2 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_fb.c | 1 |
14 files changed, 37 insertions, 25 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 146e05f21d35..bdef497a6a26 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |||
@@ -1498,7 +1498,7 @@ out: | |||
1498 | wait->out.status = (r > 0); | 1498 | wait->out.status = (r > 0); |
1499 | wait->out.first_signaled = first; | 1499 | wait->out.first_signaled = first; |
1500 | 1500 | ||
1501 | if (array[first]) | 1501 | if (first < fence_count && array[first]) |
1502 | r = array[first]->error; | 1502 | r = array[first]->error; |
1503 | else | 1503 | else |
1504 | r = 0; | 1504 | r = 0; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index cbe5620654e7..2c85e0a98608 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
@@ -1836,6 +1836,9 @@ static int amdgpu_fini(struct amdgpu_device *adev) | |||
1836 | adev->ip_blocks[i].status.hw = false; | 1836 | adev->ip_blocks[i].status.hw = false; |
1837 | } | 1837 | } |
1838 | 1838 | ||
1839 | if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU) | ||
1840 | amdgpu_ucode_fini_bo(adev); | ||
1841 | |||
1839 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { | 1842 | for (i = adev->num_ip_blocks - 1; i >= 0; i--) { |
1840 | if (!adev->ip_blocks[i].status.sw) | 1843 | if (!adev->ip_blocks[i].status.sw) |
1841 | continue; | 1844 | continue; |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c index 951d625bbdd7..14aff2f15a94 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gem.c | |||
@@ -328,7 +328,7 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data, | |||
328 | r = amdgpu_ttm_tt_get_user_pages(bo->tbo.ttm, | 328 | r = amdgpu_ttm_tt_get_user_pages(bo->tbo.ttm, |
329 | bo->tbo.ttm->pages); | 329 | bo->tbo.ttm->pages); |
330 | if (r) | 330 | if (r) |
331 | goto unlock_mmap_sem; | 331 | goto release_object; |
332 | 332 | ||
333 | r = amdgpu_bo_reserve(bo, true); | 333 | r = amdgpu_bo_reserve(bo, true); |
334 | if (r) | 334 | if (r) |
@@ -353,9 +353,6 @@ int amdgpu_gem_userptr_ioctl(struct drm_device *dev, void *data, | |||
353 | free_pages: | 353 | free_pages: |
354 | release_pages(bo->tbo.ttm->pages, bo->tbo.ttm->num_pages, false); | 354 | release_pages(bo->tbo.ttm->pages, bo->tbo.ttm->num_pages, false); |
355 | 355 | ||
356 | unlock_mmap_sem: | ||
357 | up_read(¤t->mm->mmap_sem); | ||
358 | |||
359 | release_object: | 356 | release_object: |
360 | drm_gem_object_put_unlocked(gobj); | 357 | drm_gem_object_put_unlocked(gobj); |
361 | 358 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c index 33535d347734..00e0ce10862f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_gtt_mgr.c | |||
@@ -71,12 +71,6 @@ static int amdgpu_gtt_mgr_fini(struct ttm_mem_type_manager *man) | |||
71 | { | 71 | { |
72 | struct amdgpu_gtt_mgr *mgr = man->priv; | 72 | struct amdgpu_gtt_mgr *mgr = man->priv; |
73 | 73 | ||
74 | spin_lock(&mgr->lock); | ||
75 | if (!drm_mm_clean(&mgr->mm)) { | ||
76 | spin_unlock(&mgr->lock); | ||
77 | return -EBUSY; | ||
78 | } | ||
79 | |||
80 | drm_mm_takedown(&mgr->mm); | 74 | drm_mm_takedown(&mgr->mm); |
81 | spin_unlock(&mgr->lock); | 75 | spin_unlock(&mgr->lock); |
82 | kfree(mgr); | 76 | kfree(mgr); |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index a59e04f3eeba..ce00f629dcce 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
@@ -946,6 +946,10 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj, | |||
946 | struct amdgpu_device *adev = dev_get_drvdata(dev); | 946 | struct amdgpu_device *adev = dev_get_drvdata(dev); |
947 | umode_t effective_mode = attr->mode; | 947 | umode_t effective_mode = attr->mode; |
948 | 948 | ||
949 | /* no skipping for powerplay */ | ||
950 | if (adev->powerplay.cgs_device) | ||
951 | return effective_mode; | ||
952 | |||
949 | /* Skip limit attributes if DPM is not enabled */ | 953 | /* Skip limit attributes if DPM is not enabled */ |
950 | if (!adev->pm.dpm_enabled && | 954 | if (!adev->pm.dpm_enabled && |
951 | (attr == &sensor_dev_attr_temp1_crit.dev_attr.attr || | 955 | (attr == &sensor_dev_attr_temp1_crit.dev_attr.attr || |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c index 5f5aa5fddc16..033fba2def6f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_powerplay.c | |||
@@ -164,9 +164,6 @@ static int amdgpu_pp_hw_fini(void *handle) | |||
164 | ret = adev->powerplay.ip_funcs->hw_fini( | 164 | ret = adev->powerplay.ip_funcs->hw_fini( |
165 | adev->powerplay.pp_handle); | 165 | adev->powerplay.pp_handle); |
166 | 166 | ||
167 | if (adev->firmware.load_type == AMDGPU_FW_LOAD_SMU) | ||
168 | amdgpu_ucode_fini_bo(adev); | ||
169 | |||
170 | return ret; | 167 | return ret; |
171 | } | 168 | } |
172 | 169 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 447d446b5015..7714f4a6c8b0 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | |||
@@ -442,8 +442,6 @@ static int psp_hw_fini(void *handle) | |||
442 | if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) | 442 | if (adev->firmware.load_type != AMDGPU_FW_LOAD_PSP) |
443 | return 0; | 443 | return 0; |
444 | 444 | ||
445 | amdgpu_ucode_fini_bo(adev); | ||
446 | |||
447 | psp_ring_destroy(psp, PSP_RING_TYPE__KM); | 445 | psp_ring_destroy(psp, PSP_RING_TYPE__KM); |
448 | 446 | ||
449 | amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf); | 447 | amdgpu_bo_free_kernel(&psp->tmr_bo, &psp->tmr_mc_addr, &psp->tmr_buf); |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c index 26e900627971..4acca92f6a52 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vram_mgr.c | |||
@@ -68,11 +68,6 @@ static int amdgpu_vram_mgr_fini(struct ttm_mem_type_manager *man) | |||
68 | struct amdgpu_vram_mgr *mgr = man->priv; | 68 | struct amdgpu_vram_mgr *mgr = man->priv; |
69 | 69 | ||
70 | spin_lock(&mgr->lock); | 70 | spin_lock(&mgr->lock); |
71 | if (!drm_mm_clean(&mgr->mm)) { | ||
72 | spin_unlock(&mgr->lock); | ||
73 | return -EBUSY; | ||
74 | } | ||
75 | |||
76 | drm_mm_takedown(&mgr->mm); | 71 | drm_mm_takedown(&mgr->mm); |
77 | spin_unlock(&mgr->lock); | 72 | spin_unlock(&mgr->lock); |
78 | kfree(mgr); | 73 | kfree(mgr); |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c index 00868764a0dd..5c8a7a48a4ad 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | |||
@@ -4670,6 +4670,14 @@ static int gfx_v7_0_sw_fini(void *handle) | |||
4670 | gfx_v7_0_cp_compute_fini(adev); | 4670 | gfx_v7_0_cp_compute_fini(adev); |
4671 | gfx_v7_0_rlc_fini(adev); | 4671 | gfx_v7_0_rlc_fini(adev); |
4672 | gfx_v7_0_mec_fini(adev); | 4672 | gfx_v7_0_mec_fini(adev); |
4673 | amdgpu_bo_free_kernel(&adev->gfx.rlc.clear_state_obj, | ||
4674 | &adev->gfx.rlc.clear_state_gpu_addr, | ||
4675 | (void **)&adev->gfx.rlc.cs_ptr); | ||
4676 | if (adev->gfx.rlc.cp_table_size) { | ||
4677 | amdgpu_bo_free_kernel(&adev->gfx.rlc.cp_table_obj, | ||
4678 | &adev->gfx.rlc.cp_table_gpu_addr, | ||
4679 | (void **)&adev->gfx.rlc.cp_table_ptr); | ||
4680 | } | ||
4673 | gfx_v7_0_free_microcode(adev); | 4681 | gfx_v7_0_free_microcode(adev); |
4674 | 4682 | ||
4675 | return 0; | 4683 | return 0; |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index b8002ac3e536..9ecdf621a74a 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |||
@@ -2118,6 +2118,15 @@ static int gfx_v8_0_sw_fini(void *handle) | |||
2118 | 2118 | ||
2119 | gfx_v8_0_mec_fini(adev); | 2119 | gfx_v8_0_mec_fini(adev); |
2120 | gfx_v8_0_rlc_fini(adev); | 2120 | gfx_v8_0_rlc_fini(adev); |
2121 | amdgpu_bo_free_kernel(&adev->gfx.rlc.clear_state_obj, | ||
2122 | &adev->gfx.rlc.clear_state_gpu_addr, | ||
2123 | (void **)&adev->gfx.rlc.cs_ptr); | ||
2124 | if ((adev->asic_type == CHIP_CARRIZO) || | ||
2125 | (adev->asic_type == CHIP_STONEY)) { | ||
2126 | amdgpu_bo_free_kernel(&adev->gfx.rlc.cp_table_obj, | ||
2127 | &adev->gfx.rlc.cp_table_gpu_addr, | ||
2128 | (void **)&adev->gfx.rlc.cp_table_ptr); | ||
2129 | } | ||
2121 | gfx_v8_0_free_microcode(adev); | 2130 | gfx_v8_0_free_microcode(adev); |
2122 | 2131 | ||
2123 | return 0; | 2132 | return 0; |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c index bc32bbde1165..da43813d67a4 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | |||
@@ -1468,6 +1468,14 @@ static int gfx_v9_0_sw_fini(void *handle) | |||
1468 | 1468 | ||
1469 | gfx_v9_0_mec_fini(adev); | 1469 | gfx_v9_0_mec_fini(adev); |
1470 | gfx_v9_0_ngg_fini(adev); | 1470 | gfx_v9_0_ngg_fini(adev); |
1471 | amdgpu_bo_free_kernel(&adev->gfx.rlc.clear_state_obj, | ||
1472 | &adev->gfx.rlc.clear_state_gpu_addr, | ||
1473 | (void **)&adev->gfx.rlc.cs_ptr); | ||
1474 | if (adev->asic_type == CHIP_RAVEN) { | ||
1475 | amdgpu_bo_free_kernel(&adev->gfx.rlc.cp_table_obj, | ||
1476 | &adev->gfx.rlc.cp_table_gpu_addr, | ||
1477 | (void **)&adev->gfx.rlc.cp_table_ptr); | ||
1478 | } | ||
1471 | gfx_v9_0_free_microcode(adev); | 1479 | gfx_v9_0_free_microcode(adev); |
1472 | 1480 | ||
1473 | return 0; | 1481 | return 0; |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c index d1af1483c69b..a651ebcf44fd 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/process_pptables_v1_0.c | |||
@@ -830,9 +830,9 @@ static int init_over_drive_limits( | |||
830 | const ATOM_Tonga_POWERPLAYTABLE *powerplay_table) | 830 | const ATOM_Tonga_POWERPLAYTABLE *powerplay_table) |
831 | { | 831 | { |
832 | hwmgr->platform_descriptor.overdriveLimit.engineClock = | 832 | hwmgr->platform_descriptor.overdriveLimit.engineClock = |
833 | le16_to_cpu(powerplay_table->ulMaxODEngineClock); | 833 | le32_to_cpu(powerplay_table->ulMaxODEngineClock); |
834 | hwmgr->platform_descriptor.overdriveLimit.memoryClock = | 834 | hwmgr->platform_descriptor.overdriveLimit.memoryClock = |
835 | le16_to_cpu(powerplay_table->ulMaxODMemoryClock); | 835 | le32_to_cpu(powerplay_table->ulMaxODMemoryClock); |
836 | 836 | ||
837 | hwmgr->platform_descriptor.minOverdriveVDDC = 0; | 837 | hwmgr->platform_descriptor.minOverdriveVDDC = 0; |
838 | hwmgr->platform_descriptor.maxOverdriveVDDC = 0; | 838 | hwmgr->platform_descriptor.maxOverdriveVDDC = 0; |
diff --git a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c index 4466469cf8ab..e33ec7fc5d09 100644 --- a/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c +++ b/drivers/gpu/drm/amd/powerplay/hwmgr/smu7_hwmgr.c | |||
@@ -3778,7 +3778,7 @@ static int smu7_unfreeze_sclk_mclk_dpm(struct pp_hwmgr *hwmgr) | |||
3778 | "Trying to Unfreeze MCLK DPM when DPM is disabled", | 3778 | "Trying to Unfreeze MCLK DPM when DPM is disabled", |
3779 | ); | 3779 | ); |
3780 | PP_ASSERT_WITH_CODE(0 == smum_send_msg_to_smc(hwmgr, | 3780 | PP_ASSERT_WITH_CODE(0 == smum_send_msg_to_smc(hwmgr, |
3781 | PPSMC_MSG_SCLKDPM_UnfreezeLevel), | 3781 | PPSMC_MSG_MCLKDPM_UnfreezeLevel), |
3782 | "Failed to unfreeze MCLK DPM during UnFreezeSclkMclkDPM Function!", | 3782 | "Failed to unfreeze MCLK DPM during UnFreezeSclkMclkDPM Function!", |
3783 | return -EINVAL); | 3783 | return -EINVAL); |
3784 | } | 3784 | } |
diff --git a/drivers/gpu/drm/radeon/radeon_fb.c b/drivers/gpu/drm/radeon/radeon_fb.c index 2fcf805d3a16..33b821d6d018 100644 --- a/drivers/gpu/drm/radeon/radeon_fb.c +++ b/drivers/gpu/drm/radeon/radeon_fb.c | |||
@@ -245,7 +245,6 @@ static int radeonfb_create(struct drm_fb_helper *helper, | |||
245 | } | 245 | } |
246 | 246 | ||
247 | info->par = rfbdev; | 247 | info->par = rfbdev; |
248 | info->skip_vt_switch = true; | ||
249 | 248 | ||
250 | ret = radeon_framebuffer_init(rdev->ddev, &rfbdev->rfb, &mode_cmd, gobj); | 249 | ret = radeon_framebuffer_init(rdev->ddev, &rfbdev->rfb, &mode_cmd, gobj); |
251 | if (ret) { | 250 | if (ret) { |