diff options
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | 12 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | 20 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | 1 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | 25 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c | 59 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | 9 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 10 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/dce_virtual.c | 17 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 48 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 14 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | 2 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c | 13 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | 28 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | 7 | ||||
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/soc15.c | 6 |
16 files changed, 183 insertions, 89 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c index a028661d9e20..92b11de19581 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_atpx_handler.c | |||
| @@ -576,6 +576,7 @@ static const struct amdgpu_px_quirk amdgpu_px_quirk_list[] = { | |||
| 576 | { 0x1002, 0x6900, 0x1028, 0x0812, AMDGPU_PX_QUIRK_FORCE_ATPX }, | 576 | { 0x1002, 0x6900, 0x1028, 0x0812, AMDGPU_PX_QUIRK_FORCE_ATPX }, |
| 577 | { 0x1002, 0x6900, 0x1028, 0x0813, AMDGPU_PX_QUIRK_FORCE_ATPX }, | 577 | { 0x1002, 0x6900, 0x1028, 0x0813, AMDGPU_PX_QUIRK_FORCE_ATPX }, |
| 578 | { 0x1002, 0x6900, 0x1025, 0x125A, AMDGPU_PX_QUIRK_FORCE_ATPX }, | 578 | { 0x1002, 0x6900, 0x1025, 0x125A, AMDGPU_PX_QUIRK_FORCE_ATPX }, |
| 579 | { 0x1002, 0x6900, 0x17AA, 0x3806, AMDGPU_PX_QUIRK_FORCE_ATPX }, | ||
| 579 | { 0, 0, 0, 0, 0 }, | 580 | { 0, 0, 0, 0, 0 }, |
| 580 | }; | 581 | }; |
| 581 | 582 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c index 8a078f4ae73d..7ff3a28fc903 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_device.c | |||
| @@ -1701,8 +1701,10 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev) | |||
| 1701 | amdgpu_xgmi_add_device(adev); | 1701 | amdgpu_xgmi_add_device(adev); |
| 1702 | amdgpu_amdkfd_device_init(adev); | 1702 | amdgpu_amdkfd_device_init(adev); |
| 1703 | 1703 | ||
| 1704 | if (amdgpu_sriov_vf(adev)) | 1704 | if (amdgpu_sriov_vf(adev)) { |
| 1705 | amdgpu_virt_init_data_exchange(adev); | ||
| 1705 | amdgpu_virt_release_full_gpu(adev, true); | 1706 | amdgpu_virt_release_full_gpu(adev, true); |
| 1707 | } | ||
| 1706 | 1708 | ||
| 1707 | return 0; | 1709 | return 0; |
| 1708 | } | 1710 | } |
| @@ -2632,9 +2634,6 @@ fence_driver_init: | |||
| 2632 | goto failed; | 2634 | goto failed; |
| 2633 | } | 2635 | } |
| 2634 | 2636 | ||
| 2635 | if (amdgpu_sriov_vf(adev)) | ||
| 2636 | amdgpu_virt_init_data_exchange(adev); | ||
| 2637 | |||
| 2638 | amdgpu_fbdev_init(adev); | 2637 | amdgpu_fbdev_init(adev); |
| 2639 | 2638 | ||
| 2640 | r = amdgpu_pm_sysfs_init(adev); | 2639 | r = amdgpu_pm_sysfs_init(adev); |
| @@ -2798,7 +2797,7 @@ int amdgpu_device_suspend(struct drm_device *dev, bool suspend, bool fbcon) | |||
| 2798 | struct drm_framebuffer *fb = crtc->primary->fb; | 2797 | struct drm_framebuffer *fb = crtc->primary->fb; |
| 2799 | struct amdgpu_bo *robj; | 2798 | struct amdgpu_bo *robj; |
| 2800 | 2799 | ||
| 2801 | if (amdgpu_crtc->cursor_bo) { | 2800 | if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) { |
| 2802 | struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); | 2801 | struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); |
| 2803 | r = amdgpu_bo_reserve(aobj, true); | 2802 | r = amdgpu_bo_reserve(aobj, true); |
| 2804 | if (r == 0) { | 2803 | if (r == 0) { |
| @@ -2906,7 +2905,7 @@ int amdgpu_device_resume(struct drm_device *dev, bool resume, bool fbcon) | |||
| 2906 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { | 2905 | list_for_each_entry(crtc, &dev->mode_config.crtc_list, head) { |
| 2907 | struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); | 2906 | struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); |
| 2908 | 2907 | ||
| 2909 | if (amdgpu_crtc->cursor_bo) { | 2908 | if (amdgpu_crtc->cursor_bo && !adev->enable_virtual_display) { |
| 2910 | struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); | 2909 | struct amdgpu_bo *aobj = gem_to_amdgpu_bo(amdgpu_crtc->cursor_bo); |
| 2911 | r = amdgpu_bo_reserve(aobj, true); | 2910 | r = amdgpu_bo_reserve(aobj, true); |
| 2912 | if (r == 0) { | 2911 | if (r == 0) { |
| @@ -3226,6 +3225,7 @@ static int amdgpu_device_reset_sriov(struct amdgpu_device *adev, | |||
| 3226 | r = amdgpu_ib_ring_tests(adev); | 3225 | r = amdgpu_ib_ring_tests(adev); |
| 3227 | 3226 | ||
| 3228 | error: | 3227 | error: |
| 3228 | amdgpu_virt_init_data_exchange(adev); | ||
| 3229 | amdgpu_virt_release_full_gpu(adev, true); | 3229 | amdgpu_virt_release_full_gpu(adev, true); |
| 3230 | if (!r && adev->virt.gim_feature & AMDGIM_FEATURE_GIM_FLR_VRAMLOST) { | 3230 | if (!r && adev->virt.gim_feature & AMDGIM_FEATURE_GIM_FLR_VRAMLOST) { |
| 3231 | atomic_inc(&adev->vram_lost_counter); | 3231 | atomic_inc(&adev->vram_lost_counter); |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c index 15ce7e681d67..b083b219b1a9 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_display.c | |||
| @@ -188,10 +188,12 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, | |||
| 188 | goto cleanup; | 188 | goto cleanup; |
| 189 | } | 189 | } |
| 190 | 190 | ||
| 191 | r = amdgpu_bo_pin(new_abo, amdgpu_display_supported_domains(adev)); | 191 | if (!adev->enable_virtual_display) { |
| 192 | if (unlikely(r != 0)) { | 192 | r = amdgpu_bo_pin(new_abo, amdgpu_display_supported_domains(adev)); |
| 193 | DRM_ERROR("failed to pin new abo buffer before flip\n"); | 193 | if (unlikely(r != 0)) { |
| 194 | goto unreserve; | 194 | DRM_ERROR("failed to pin new abo buffer before flip\n"); |
| 195 | goto unreserve; | ||
| 196 | } | ||
| 195 | } | 197 | } |
| 196 | 198 | ||
| 197 | r = amdgpu_ttm_alloc_gart(&new_abo->tbo); | 199 | r = amdgpu_ttm_alloc_gart(&new_abo->tbo); |
| @@ -211,7 +213,8 @@ int amdgpu_display_crtc_page_flip_target(struct drm_crtc *crtc, | |||
| 211 | amdgpu_bo_get_tiling_flags(new_abo, &tiling_flags); | 213 | amdgpu_bo_get_tiling_flags(new_abo, &tiling_flags); |
| 212 | amdgpu_bo_unreserve(new_abo); | 214 | amdgpu_bo_unreserve(new_abo); |
| 213 | 215 | ||
| 214 | work->base = amdgpu_bo_gpu_offset(new_abo); | 216 | if (!adev->enable_virtual_display) |
| 217 | work->base = amdgpu_bo_gpu_offset(new_abo); | ||
| 215 | work->target_vblank = target - (uint32_t)drm_crtc_vblank_count(crtc) + | 218 | work->target_vblank = target - (uint32_t)drm_crtc_vblank_count(crtc) + |
| 216 | amdgpu_get_vblank_counter_kms(dev, work->crtc_id); | 219 | amdgpu_get_vblank_counter_kms(dev, work->crtc_id); |
| 217 | 220 | ||
| @@ -242,9 +245,10 @@ pflip_cleanup: | |||
| 242 | goto cleanup; | 245 | goto cleanup; |
| 243 | } | 246 | } |
| 244 | unpin: | 247 | unpin: |
| 245 | if (unlikely(amdgpu_bo_unpin(new_abo) != 0)) { | 248 | if (!adev->enable_virtual_display) |
| 246 | DRM_ERROR("failed to unpin new abo in error path\n"); | 249 | if (unlikely(amdgpu_bo_unpin(new_abo) != 0)) |
| 247 | } | 250 | DRM_ERROR("failed to unpin new abo in error path\n"); |
| 251 | |||
| 248 | unreserve: | 252 | unreserve: |
| 249 | amdgpu_bo_unreserve(new_abo); | 253 | amdgpu_bo_unreserve(new_abo); |
| 250 | 254 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index bc62bf41b7e9..5dc349173e4f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c | |||
| @@ -212,6 +212,7 @@ int amdgpu_driver_load_kms(struct drm_device *dev, unsigned long flags) | |||
| 212 | } | 212 | } |
| 213 | 213 | ||
| 214 | if (amdgpu_device_is_px(dev)) { | 214 | if (amdgpu_device_is_px(dev)) { |
| 215 | dev_pm_set_driver_flags(dev->dev, DPM_FLAG_NEVER_SKIP); | ||
| 215 | pm_runtime_use_autosuspend(dev->dev); | 216 | pm_runtime_use_autosuspend(dev->dev); |
| 216 | pm_runtime_set_autosuspend_delay(dev->dev, 5000); | 217 | pm_runtime_set_autosuspend_delay(dev->dev, 5000); |
| 217 | pm_runtime_set_active(dev->dev); | 218 | pm_runtime_set_active(dev->dev); |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c index 1f61ed95727c..0ed41a9d2d77 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_pm.c | |||
| @@ -1686,7 +1686,8 @@ static umode_t hwmon_attributes_visible(struct kobject *kobj, | |||
| 1686 | effective_mode &= ~S_IWUSR; | 1686 | effective_mode &= ~S_IWUSR; |
| 1687 | 1687 | ||
| 1688 | if ((adev->flags & AMD_IS_APU) && | 1688 | if ((adev->flags & AMD_IS_APU) && |
| 1689 | (attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr || | 1689 | (attr == &sensor_dev_attr_power1_average.dev_attr.attr || |
| 1690 | attr == &sensor_dev_attr_power1_cap_max.dev_attr.attr || | ||
| 1690 | attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr|| | 1691 | attr == &sensor_dev_attr_power1_cap_min.dev_attr.attr|| |
| 1691 | attr == &sensor_dev_attr_power1_cap.dev_attr.attr)) | 1692 | attr == &sensor_dev_attr_power1_cap.dev_attr.attr)) |
| 1692 | return 0; | 1693 | return 0; |
| @@ -2008,6 +2009,7 @@ void amdgpu_pm_print_power_states(struct amdgpu_device *adev) | |||
| 2008 | 2009 | ||
| 2009 | int amdgpu_pm_sysfs_init(struct amdgpu_device *adev) | 2010 | int amdgpu_pm_sysfs_init(struct amdgpu_device *adev) |
| 2010 | { | 2011 | { |
| 2012 | struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle; | ||
| 2011 | int ret; | 2013 | int ret; |
| 2012 | 2014 | ||
| 2013 | if (adev->pm.sysfs_initialized) | 2015 | if (adev->pm.sysfs_initialized) |
| @@ -2091,12 +2093,14 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev) | |||
| 2091 | "pp_power_profile_mode\n"); | 2093 | "pp_power_profile_mode\n"); |
| 2092 | return ret; | 2094 | return ret; |
| 2093 | } | 2095 | } |
| 2094 | ret = device_create_file(adev->dev, | 2096 | if (hwmgr->od_enabled) { |
| 2095 | &dev_attr_pp_od_clk_voltage); | 2097 | ret = device_create_file(adev->dev, |
| 2096 | if (ret) { | 2098 | &dev_attr_pp_od_clk_voltage); |
| 2097 | DRM_ERROR("failed to create device file " | 2099 | if (ret) { |
| 2098 | "pp_od_clk_voltage\n"); | 2100 | DRM_ERROR("failed to create device file " |
| 2099 | return ret; | 2101 | "pp_od_clk_voltage\n"); |
| 2102 | return ret; | ||
| 2103 | } | ||
| 2100 | } | 2104 | } |
| 2101 | ret = device_create_file(adev->dev, | 2105 | ret = device_create_file(adev->dev, |
| 2102 | &dev_attr_gpu_busy_percent); | 2106 | &dev_attr_gpu_busy_percent); |
| @@ -2118,6 +2122,8 @@ int amdgpu_pm_sysfs_init(struct amdgpu_device *adev) | |||
| 2118 | 2122 | ||
| 2119 | void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev) | 2123 | void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev) |
| 2120 | { | 2124 | { |
| 2125 | struct pp_hwmgr *hwmgr = adev->powerplay.pp_handle; | ||
| 2126 | |||
| 2121 | if (adev->pm.dpm_enabled == 0) | 2127 | if (adev->pm.dpm_enabled == 0) |
| 2122 | return; | 2128 | return; |
| 2123 | 2129 | ||
| @@ -2138,8 +2144,9 @@ void amdgpu_pm_sysfs_fini(struct amdgpu_device *adev) | |||
| 2138 | device_remove_file(adev->dev, &dev_attr_pp_mclk_od); | 2144 | device_remove_file(adev->dev, &dev_attr_pp_mclk_od); |
| 2139 | device_remove_file(adev->dev, | 2145 | device_remove_file(adev->dev, |
| 2140 | &dev_attr_pp_power_profile_mode); | 2146 | &dev_attr_pp_power_profile_mode); |
| 2141 | device_remove_file(adev->dev, | 2147 | if (hwmgr->od_enabled) |
| 2142 | &dev_attr_pp_od_clk_voltage); | 2148 | device_remove_file(adev->dev, |
| 2149 | &dev_attr_pp_od_clk_voltage); | ||
| 2143 | device_remove_file(adev->dev, &dev_attr_gpu_busy_percent); | 2150 | device_remove_file(adev->dev, &dev_attr_gpu_busy_percent); |
| 2144 | } | 2151 | } |
| 2145 | 2152 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c index 71913a18d142..a38e0fb4a6fe 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_prime.c | |||
| @@ -38,6 +38,7 @@ | |||
| 38 | #include "amdgpu_gem.h" | 38 | #include "amdgpu_gem.h" |
| 39 | #include <drm/amdgpu_drm.h> | 39 | #include <drm/amdgpu_drm.h> |
| 40 | #include <linux/dma-buf.h> | 40 | #include <linux/dma-buf.h> |
| 41 | #include <linux/dma-fence-array.h> | ||
| 41 | 42 | ||
| 42 | /** | 43 | /** |
| 43 | * amdgpu_gem_prime_get_sg_table - &drm_driver.gem_prime_get_sg_table | 44 | * amdgpu_gem_prime_get_sg_table - &drm_driver.gem_prime_get_sg_table |
| @@ -187,6 +188,48 @@ error: | |||
| 187 | return ERR_PTR(ret); | 188 | return ERR_PTR(ret); |
| 188 | } | 189 | } |
| 189 | 190 | ||
| 191 | static int | ||
| 192 | __reservation_object_make_exclusive(struct reservation_object *obj) | ||
| 193 | { | ||
| 194 | struct dma_fence **fences; | ||
| 195 | unsigned int count; | ||
| 196 | int r; | ||
| 197 | |||
| 198 | if (!reservation_object_get_list(obj)) /* no shared fences to convert */ | ||
| 199 | return 0; | ||
| 200 | |||
| 201 | r = reservation_object_get_fences_rcu(obj, NULL, &count, &fences); | ||
| 202 | if (r) | ||
| 203 | return r; | ||
| 204 | |||
| 205 | if (count == 0) { | ||
| 206 | /* Now that was unexpected. */ | ||
| 207 | } else if (count == 1) { | ||
| 208 | reservation_object_add_excl_fence(obj, fences[0]); | ||
| 209 | dma_fence_put(fences[0]); | ||
| 210 | kfree(fences); | ||
| 211 | } else { | ||
| 212 | struct dma_fence_array *array; | ||
| 213 | |||
| 214 | array = dma_fence_array_create(count, fences, | ||
| 215 | dma_fence_context_alloc(1), 0, | ||
| 216 | false); | ||
| 217 | if (!array) | ||
| 218 | goto err_fences_put; | ||
| 219 | |||
| 220 | reservation_object_add_excl_fence(obj, &array->base); | ||
| 221 | dma_fence_put(&array->base); | ||
| 222 | } | ||
| 223 | |||
| 224 | return 0; | ||
| 225 | |||
| 226 | err_fences_put: | ||
| 227 | while (count--) | ||
| 228 | dma_fence_put(fences[count]); | ||
| 229 | kfree(fences); | ||
| 230 | return -ENOMEM; | ||
| 231 | } | ||
| 232 | |||
| 190 | /** | 233 | /** |
| 191 | * amdgpu_gem_map_attach - &dma_buf_ops.attach implementation | 234 | * amdgpu_gem_map_attach - &dma_buf_ops.attach implementation |
| 192 | * @dma_buf: Shared DMA buffer | 235 | * @dma_buf: Shared DMA buffer |
| @@ -218,16 +261,16 @@ static int amdgpu_gem_map_attach(struct dma_buf *dma_buf, | |||
| 218 | 261 | ||
| 219 | if (attach->dev->driver != adev->dev->driver) { | 262 | if (attach->dev->driver != adev->dev->driver) { |
| 220 | /* | 263 | /* |
| 221 | * Wait for all shared fences to complete before we switch to future | 264 | * We only create shared fences for internal use, but importers |
| 222 | * use of exclusive fence on this prime shared bo. | 265 | * of the dmabuf rely on exclusive fences for implicitly |
| 266 | * tracking write hazards. As any of the current fences may | ||
| 267 | * correspond to a write, we need to convert all existing | ||
| 268 | * fences on the reservation object into a single exclusive | ||
| 269 | * fence. | ||
| 223 | */ | 270 | */ |
| 224 | r = reservation_object_wait_timeout_rcu(bo->tbo.resv, | 271 | r = __reservation_object_make_exclusive(bo->tbo.resv); |
| 225 | true, false, | 272 | if (r) |
| 226 | MAX_SCHEDULE_TIMEOUT); | ||
| 227 | if (unlikely(r < 0)) { | ||
| 228 | DRM_DEBUG_PRIME("Fence wait failed: %li\n", r); | ||
| 229 | goto error_unreserve; | 273 | goto error_unreserve; |
| 230 | } | ||
| 231 | } | 274 | } |
| 232 | 275 | ||
| 233 | /* pin buffer into GTT */ | 276 | /* pin buffer into GTT */ |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c index 8fab0d637ee5..3a9b48b227ac 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c | |||
| @@ -90,8 +90,10 @@ static int psp_sw_fini(void *handle) | |||
| 90 | adev->psp.sos_fw = NULL; | 90 | adev->psp.sos_fw = NULL; |
| 91 | release_firmware(adev->psp.asd_fw); | 91 | release_firmware(adev->psp.asd_fw); |
| 92 | adev->psp.asd_fw = NULL; | 92 | adev->psp.asd_fw = NULL; |
| 93 | release_firmware(adev->psp.ta_fw); | 93 | if (adev->psp.ta_fw) { |
| 94 | adev->psp.ta_fw = NULL; | 94 | release_firmware(adev->psp.ta_fw); |
| 95 | adev->psp.ta_fw = NULL; | ||
| 96 | } | ||
| 95 | return 0; | 97 | return 0; |
| 96 | } | 98 | } |
| 97 | 99 | ||
| @@ -435,6 +437,9 @@ static int psp_xgmi_initialize(struct psp_context *psp) | |||
| 435 | struct ta_xgmi_shared_memory *xgmi_cmd; | 437 | struct ta_xgmi_shared_memory *xgmi_cmd; |
| 436 | int ret; | 438 | int ret; |
| 437 | 439 | ||
| 440 | if (!psp->adev->psp.ta_fw) | ||
| 441 | return -ENOENT; | ||
| 442 | |||
| 438 | if (!psp->xgmi_context.initialized) { | 443 | if (!psp->xgmi_context.initialized) { |
| 439 | ret = psp_xgmi_init_shared_buf(psp); | 444 | ret = psp_xgmi_init_shared_buf(psp); |
| 440 | if (ret) | 445 | if (ret) |
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c index e73d152659a2..698bcb8ce61d 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | |||
| @@ -638,12 +638,14 @@ void amdgpu_vm_move_to_lru_tail(struct amdgpu_device *adev, | |||
| 638 | struct ttm_bo_global *glob = adev->mman.bdev.glob; | 638 | struct ttm_bo_global *glob = adev->mman.bdev.glob; |
| 639 | struct amdgpu_vm_bo_base *bo_base; | 639 | struct amdgpu_vm_bo_base *bo_base; |
| 640 | 640 | ||
| 641 | #if 0 | ||
| 641 | if (vm->bulk_moveable) { | 642 | if (vm->bulk_moveable) { |
| 642 | spin_lock(&glob->lru_lock); | 643 | spin_lock(&glob->lru_lock); |
| 643 | ttm_bo_bulk_move_lru_tail(&vm->lru_bulk_move); | 644 | ttm_bo_bulk_move_lru_tail(&vm->lru_bulk_move); |
| 644 | spin_unlock(&glob->lru_lock); | 645 | spin_unlock(&glob->lru_lock); |
| 645 | return; | 646 | return; |
| 646 | } | 647 | } |
| 648 | #endif | ||
| 647 | 649 | ||
| 648 | memset(&vm->lru_bulk_move, 0, sizeof(vm->lru_bulk_move)); | 650 | memset(&vm->lru_bulk_move, 0, sizeof(vm->lru_bulk_move)); |
| 649 | 651 | ||
| @@ -847,9 +849,6 @@ static void amdgpu_vm_bo_param(struct amdgpu_device *adev, struct amdgpu_vm *vm, | |||
| 847 | bp->size = amdgpu_vm_bo_size(adev, level); | 849 | bp->size = amdgpu_vm_bo_size(adev, level); |
| 848 | bp->byte_align = AMDGPU_GPU_PAGE_SIZE; | 850 | bp->byte_align = AMDGPU_GPU_PAGE_SIZE; |
| 849 | bp->domain = AMDGPU_GEM_DOMAIN_VRAM; | 851 | bp->domain = AMDGPU_GEM_DOMAIN_VRAM; |
| 850 | if (bp->size <= PAGE_SIZE && adev->asic_type >= CHIP_VEGA10 && | ||
| 851 | adev->flags & AMD_IS_APU) | ||
| 852 | bp->domain |= AMDGPU_GEM_DOMAIN_GTT; | ||
| 853 | bp->domain = amdgpu_bo_get_preferred_pin_domain(adev, bp->domain); | 852 | bp->domain = amdgpu_bo_get_preferred_pin_domain(adev, bp->domain); |
| 854 | bp->flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS | | 853 | bp->flags = AMDGPU_GEM_CREATE_VRAM_CONTIGUOUS | |
| 855 | AMDGPU_GEM_CREATE_CPU_GTT_USWC; | 854 | AMDGPU_GEM_CREATE_CPU_GTT_USWC; |
| @@ -3366,14 +3365,15 @@ void amdgpu_vm_get_task_info(struct amdgpu_device *adev, unsigned int pasid, | |||
| 3366 | struct amdgpu_task_info *task_info) | 3365 | struct amdgpu_task_info *task_info) |
| 3367 | { | 3366 | { |
| 3368 | struct amdgpu_vm *vm; | 3367 | struct amdgpu_vm *vm; |
| 3368 | unsigned long flags; | ||
| 3369 | 3369 | ||
| 3370 | spin_lock(&adev->vm_manager.pasid_lock); | 3370 | spin_lock_irqsave(&adev->vm_manager.pasid_lock, flags); |
| 3371 | 3371 | ||
| 3372 | vm = idr_find(&adev->vm_manager.pasid_idr, pasid); | 3372 | vm = idr_find(&adev->vm_manager.pasid_idr, pasid); |
| 3373 | if (vm) | 3373 | if (vm) |
| 3374 | *task_info = vm->task_info; | 3374 | *task_info = vm->task_info; |
| 3375 | 3375 | ||
| 3376 | spin_unlock(&adev->vm_manager.pasid_lock); | 3376 | spin_unlock_irqrestore(&adev->vm_manager.pasid_lock, flags); |
| 3377 | } | 3377 | } |
| 3378 | 3378 | ||
| 3379 | /** | 3379 | /** |
diff --git a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c index fdace004544d..e4cc1d48eaab 100644 --- a/drivers/gpu/drm/amd/amdgpu/dce_virtual.c +++ b/drivers/gpu/drm/amd/amdgpu/dce_virtual.c | |||
| @@ -167,19 +167,6 @@ static void dce_virtual_crtc_disable(struct drm_crtc *crtc) | |||
| 167 | struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); | 167 | struct amdgpu_crtc *amdgpu_crtc = to_amdgpu_crtc(crtc); |
| 168 | 168 | ||
| 169 | dce_virtual_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); | 169 | dce_virtual_crtc_dpms(crtc, DRM_MODE_DPMS_OFF); |
| 170 | if (crtc->primary->fb) { | ||
| 171 | int r; | ||
| 172 | struct amdgpu_bo *abo; | ||
| 173 | |||
| 174 | abo = gem_to_amdgpu_bo(crtc->primary->fb->obj[0]); | ||
| 175 | r = amdgpu_bo_reserve(abo, true); | ||
| 176 | if (unlikely(r)) | ||
| 177 | DRM_ERROR("failed to reserve abo before unpin\n"); | ||
| 178 | else { | ||
| 179 | amdgpu_bo_unpin(abo); | ||
| 180 | amdgpu_bo_unreserve(abo); | ||
| 181 | } | ||
| 182 | } | ||
| 183 | 170 | ||
| 184 | amdgpu_crtc->pll_id = ATOM_PPLL_INVALID; | 171 | amdgpu_crtc->pll_id = ATOM_PPLL_INVALID; |
| 185 | amdgpu_crtc->encoder = NULL; | 172 | amdgpu_crtc->encoder = NULL; |
| @@ -692,7 +679,9 @@ static int dce_virtual_pageflip(struct amdgpu_device *adev, | |||
| 692 | spin_unlock_irqrestore(&adev->ddev->event_lock, flags); | 679 | spin_unlock_irqrestore(&adev->ddev->event_lock, flags); |
| 693 | 680 | ||
| 694 | drm_crtc_vblank_put(&amdgpu_crtc->base); | 681 | drm_crtc_vblank_put(&amdgpu_crtc->base); |
| 695 | schedule_work(&works->unpin_work); | 682 | amdgpu_bo_unref(&works->old_abo); |
| 683 | kfree(works->shared); | ||
| 684 | kfree(works); | ||
| 696 | 685 | ||
| 697 | return 0; | 686 | return 0; |
| 698 | } | 687 | } |
diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c index 381f593b0cda..57cb3a51bda7 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | |||
| @@ -4233,7 +4233,6 @@ static int gfx_v8_0_cp_gfx_resume(struct amdgpu_device *adev) | |||
| 4233 | u32 tmp; | 4233 | u32 tmp; |
| 4234 | u32 rb_bufsz; | 4234 | u32 rb_bufsz; |
| 4235 | u64 rb_addr, rptr_addr, wptr_gpu_addr; | 4235 | u64 rb_addr, rptr_addr, wptr_gpu_addr; |
| 4236 | int r; | ||
| 4237 | 4236 | ||
| 4238 | /* Set the write pointer delay */ | 4237 | /* Set the write pointer delay */ |
| 4239 | WREG32(mmCP_RB_WPTR_DELAY, 0); | 4238 | WREG32(mmCP_RB_WPTR_DELAY, 0); |
| @@ -4278,9 +4277,8 @@ static int gfx_v8_0_cp_gfx_resume(struct amdgpu_device *adev) | |||
| 4278 | amdgpu_ring_clear_ring(ring); | 4277 | amdgpu_ring_clear_ring(ring); |
| 4279 | gfx_v8_0_cp_gfx_start(adev); | 4278 | gfx_v8_0_cp_gfx_start(adev); |
| 4280 | ring->sched.ready = true; | 4279 | ring->sched.ready = true; |
| 4281 | r = amdgpu_ring_test_helper(ring); | ||
| 4282 | 4280 | ||
| 4283 | return r; | 4281 | return 0; |
| 4284 | } | 4282 | } |
| 4285 | 4283 | ||
| 4286 | static void gfx_v8_0_cp_compute_enable(struct amdgpu_device *adev, bool enable) | 4284 | static void gfx_v8_0_cp_compute_enable(struct amdgpu_device *adev, bool enable) |
| @@ -4369,10 +4367,9 @@ static int gfx_v8_0_kiq_kcq_enable(struct amdgpu_device *adev) | |||
| 4369 | amdgpu_ring_write(kiq_ring, upper_32_bits(wptr_addr)); | 4367 | amdgpu_ring_write(kiq_ring, upper_32_bits(wptr_addr)); |
| 4370 | } | 4368 | } |
| 4371 | 4369 | ||
| 4372 | r = amdgpu_ring_test_helper(kiq_ring); | 4370 | amdgpu_ring_commit(kiq_ring); |
| 4373 | if (r) | 4371 | |
| 4374 | DRM_ERROR("KCQ enable failed\n"); | 4372 | return 0; |
| 4375 | return r; | ||
| 4376 | } | 4373 | } |
| 4377 | 4374 | ||
| 4378 | static int gfx_v8_0_deactivate_hqd(struct amdgpu_device *adev, u32 req) | 4375 | static int gfx_v8_0_deactivate_hqd(struct amdgpu_device *adev, u32 req) |
| @@ -4709,16 +4706,32 @@ static int gfx_v8_0_kcq_resume(struct amdgpu_device *adev) | |||
| 4709 | if (r) | 4706 | if (r) |
| 4710 | goto done; | 4707 | goto done; |
| 4711 | 4708 | ||
| 4712 | /* Test KCQs - reversing the order of rings seems to fix ring test failure | 4709 | done: |
| 4713 | * after GPU reset | 4710 | return r; |
| 4714 | */ | 4711 | } |
| 4715 | for (i = adev->gfx.num_compute_rings - 1; i >= 0; i--) { | 4712 | |
| 4713 | static int gfx_v8_0_cp_test_all_rings(struct amdgpu_device *adev) | ||
| 4714 | { | ||
| 4715 | int r, i; | ||
| 4716 | struct amdgpu_ring *ring; | ||
| 4717 | |||
| 4718 | /* collect all the ring_tests here, gfx, kiq, compute */ | ||
| 4719 | ring = &adev->gfx.gfx_ring[0]; | ||
| 4720 | r = amdgpu_ring_test_helper(ring); | ||
| 4721 | if (r) | ||
| 4722 | return r; | ||
| 4723 | |||
| 4724 | ring = &adev->gfx.kiq.ring; | ||
| 4725 | r = amdgpu_ring_test_helper(ring); | ||
| 4726 | if (r) | ||
| 4727 | return r; | ||
| 4728 | |||
| 4729 | for (i = 0; i < adev->gfx.num_compute_rings; i++) { | ||
| 4716 | ring = &adev->gfx.compute_ring[i]; | 4730 | ring = &adev->gfx.compute_ring[i]; |
| 4717 | r = amdgpu_ring_test_helper(ring); | 4731 | amdgpu_ring_test_helper(ring); |
| 4718 | } | 4732 | } |
| 4719 | 4733 | ||
| 4720 | done: | 4734 | return 0; |
| 4721 | return r; | ||
| 4722 | } | 4735 | } |
| 4723 | 4736 | ||
| 4724 | static int gfx_v8_0_cp_resume(struct amdgpu_device *adev) | 4737 | static int gfx_v8_0_cp_resume(struct amdgpu_device *adev) |
| @@ -4739,6 +4752,11 @@ static int gfx_v8_0_cp_resume(struct amdgpu_device *adev) | |||
| 4739 | r = gfx_v8_0_kcq_resume(adev); | 4752 | r = gfx_v8_0_kcq_resume(adev); |
| 4740 | if (r) | 4753 | if (r) |
| 4741 | return r; | 4754 | return r; |
| 4755 | |||
| 4756 | r = gfx_v8_0_cp_test_all_rings(adev); | ||
| 4757 | if (r) | ||
| 4758 | return r; | ||
| 4759 | |||
| 4742 | gfx_v8_0_enable_gui_idle_interrupt(adev, true); | 4760 | gfx_v8_0_enable_gui_idle_interrupt(adev, true); |
| 4743 | 4761 | ||
| 4744 | return 0; | 4762 | return 0; |
| @@ -5086,6 +5104,8 @@ static int gfx_v8_0_post_soft_reset(void *handle) | |||
| 5086 | REG_GET_FIELD(grbm_soft_reset, GRBM_SOFT_RESET, SOFT_RESET_GFX)) | 5104 | REG_GET_FIELD(grbm_soft_reset, GRBM_SOFT_RESET, SOFT_RESET_GFX)) |
| 5087 | gfx_v8_0_cp_gfx_resume(adev); | 5105 | gfx_v8_0_cp_gfx_resume(adev); |
| 5088 | 5106 | ||
| 5107 | gfx_v8_0_cp_test_all_rings(adev); | ||
| 5108 | |||
| 5089 | adev->gfx.rlc.funcs->start(adev); | 5109 | adev->gfx.rlc.funcs->start(adev); |
| 5090 | 5110 | ||
| 5091 | return 0; | 5111 | 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 7556716038d3..fbca0494f871 100644 --- a/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +++ b/drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | |||
| @@ -113,7 +113,10 @@ static const struct soc15_reg_golden golden_settings_gc_9_0[] = | |||
| 113 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmTCP_CHAN_STEER_HI, 0xffffffff, 0x4a2c0e68), | 113 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmTCP_CHAN_STEER_HI, 0xffffffff, 0x4a2c0e68), |
| 114 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmTCP_CHAN_STEER_LO, 0xffffffff, 0xb5d3f197), | 114 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmTCP_CHAN_STEER_LO, 0xffffffff, 0xb5d3f197), |
| 115 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmVGT_CACHE_INVALIDATION, 0x3fff3af3, 0x19200000), | 115 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmVGT_CACHE_INVALIDATION, 0x3fff3af3, 0x19200000), |
| 116 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmVGT_GS_MAX_WAVE_ID, 0x00000fff, 0x000003ff) | 116 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmVGT_GS_MAX_WAVE_ID, 0x00000fff, 0x000003ff), |
| 117 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmCP_MEC1_F32_INT_DIS, 0x00000000, 0x00000800), | ||
| 118 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmCP_MEC2_F32_INT_DIS, 0x00000000, 0x00000800), | ||
| 119 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmCP_DEBUG, 0x00000000, 0x00008000) | ||
| 117 | }; | 120 | }; |
| 118 | 121 | ||
| 119 | static const struct soc15_reg_golden golden_settings_gc_9_0_vg10[] = | 122 | static const struct soc15_reg_golden golden_settings_gc_9_0_vg10[] = |
| @@ -135,10 +138,7 @@ static const struct soc15_reg_golden golden_settings_gc_9_0_vg10[] = | |||
| 135 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmRMI_UTCL1_CNTL2, 0x00030000, 0x00020000), | 138 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmRMI_UTCL1_CNTL2, 0x00030000, 0x00020000), |
| 136 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmSPI_CONFIG_CNTL_1, 0x0000000f, 0x01000107), | 139 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmSPI_CONFIG_CNTL_1, 0x0000000f, 0x01000107), |
| 137 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmTD_CNTL, 0x00001800, 0x00000800), | 140 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmTD_CNTL, 0x00001800, 0x00000800), |
| 138 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmWD_UTCL1_CNTL, 0x08000000, 0x08000080), | 141 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmWD_UTCL1_CNTL, 0x08000000, 0x08000080) |
| 139 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmCP_MEC1_F32_INT_DIS, 0x00000000, 0x00000800), | ||
| 140 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmCP_MEC2_F32_INT_DIS, 0x00000000, 0x00000800), | ||
| 141 | SOC15_REG_GOLDEN_VALUE(GC, 0, mmCP_DEBUG, 0x00000000, 0x00008000) | ||
| 142 | }; | 142 | }; |
| 143 | 143 | ||
| 144 | static const struct soc15_reg_golden golden_settings_gc_9_0_vg20[] = | 144 | static const struct soc15_reg_golden golden_settings_gc_9_0_vg20[] = |
| @@ -3587,6 +3587,8 @@ static void gfx_v9_0_update_medium_grain_clock_gating(struct amdgpu_device *adev | |||
| 3587 | { | 3587 | { |
| 3588 | uint32_t data, def; | 3588 | uint32_t data, def; |
| 3589 | 3589 | ||
| 3590 | amdgpu_gfx_rlc_enter_safe_mode(adev); | ||
| 3591 | |||
| 3590 | /* It is disabled by HW by default */ | 3592 | /* It is disabled by HW by default */ |
| 3591 | if (enable && (adev->cg_flags & AMD_CG_SUPPORT_GFX_MGCG)) { | 3593 | if (enable && (adev->cg_flags & AMD_CG_SUPPORT_GFX_MGCG)) { |
| 3592 | /* 1 - RLC_CGTT_MGCG_OVERRIDE */ | 3594 | /* 1 - RLC_CGTT_MGCG_OVERRIDE */ |
| @@ -3651,6 +3653,8 @@ static void gfx_v9_0_update_medium_grain_clock_gating(struct amdgpu_device *adev | |||
| 3651 | WREG32_SOC15(GC, 0, mmCP_MEM_SLP_CNTL, data); | 3653 | WREG32_SOC15(GC, 0, mmCP_MEM_SLP_CNTL, data); |
| 3652 | } | 3654 | } |
| 3653 | } | 3655 | } |
| 3656 | |||
| 3657 | amdgpu_gfx_rlc_exit_safe_mode(adev); | ||
| 3654 | } | 3658 | } |
| 3655 | 3659 | ||
| 3656 | static void gfx_v9_0_update_3d_clock_gating(struct amdgpu_device *adev, | 3660 | static void gfx_v9_0_update_3d_clock_gating(struct amdgpu_device *adev, |
diff --git a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c index 8cbb4655896a..b11a1c17a7f2 100644 --- a/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +++ b/drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c | |||
| @@ -174,7 +174,7 @@ static int xgpu_ai_send_access_requests(struct amdgpu_device *adev, | |||
| 174 | return r; | 174 | return r; |
| 175 | } | 175 | } |
| 176 | /* Retrieve checksum from mailbox2 */ | 176 | /* Retrieve checksum from mailbox2 */ |
| 177 | if (req == IDH_REQ_GPU_INIT_ACCESS) { | 177 | if (req == IDH_REQ_GPU_INIT_ACCESS || req == IDH_REQ_GPU_RESET_ACCESS) { |
| 178 | adev->virt.fw_reserve.checksum_key = | 178 | adev->virt.fw_reserve.checksum_key = |
| 179 | RREG32_NO_KIQ(SOC15_REG_OFFSET(NBIO, 0, | 179 | RREG32_NO_KIQ(SOC15_REG_OFFSET(NBIO, 0, |
| 180 | mmBIF_BX_PF0_MAILBOX_MSGBUF_RCV_DW2)); | 180 | mmBIF_BX_PF0_MAILBOX_MSGBUF_RCV_DW2)); |
diff --git a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c index 4cd31a276dcd..186db182f924 100644 --- a/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c +++ b/drivers/gpu/drm/amd/amdgpu/nbio_v7_4.c | |||
| @@ -93,7 +93,20 @@ static void nbio_v7_4_enable_doorbell_aperture(struct amdgpu_device *adev, | |||
| 93 | static void nbio_v7_4_enable_doorbell_selfring_aperture(struct amdgpu_device *adev, | 93 | static void nbio_v7_4_enable_doorbell_selfring_aperture(struct amdgpu_device *adev, |
| 94 | bool enable) | 94 | bool enable) |
| 95 | { | 95 | { |
| 96 | u32 tmp = 0; | ||
| 96 | 97 | ||
| 98 | if (enable) { | ||
| 99 | tmp = REG_SET_FIELD(tmp, DOORBELL_SELFRING_GPA_APER_CNTL, DOORBELL_SELFRING_GPA_APER_EN, 1) | | ||
| 100 | REG_SET_FIELD(tmp, DOORBELL_SELFRING_GPA_APER_CNTL, DOORBELL_SELFRING_GPA_APER_MODE, 1) | | ||
| 101 | REG_SET_FIELD(tmp, DOORBELL_SELFRING_GPA_APER_CNTL, DOORBELL_SELFRING_GPA_APER_SIZE, 0); | ||
| 102 | |||
| 103 | WREG32_SOC15(NBIO, 0, mmDOORBELL_SELFRING_GPA_APER_BASE_LOW, | ||
| 104 | lower_32_bits(adev->doorbell.base)); | ||
| 105 | WREG32_SOC15(NBIO, 0, mmDOORBELL_SELFRING_GPA_APER_BASE_HIGH, | ||
| 106 | upper_32_bits(adev->doorbell.base)); | ||
| 107 | } | ||
| 108 | |||
| 109 | WREG32_SOC15(NBIO, 0, mmDOORBELL_SELFRING_GPA_APER_CNTL, tmp); | ||
| 97 | } | 110 | } |
| 98 | 111 | ||
| 99 | static void nbio_v7_4_ih_doorbell_range(struct amdgpu_device *adev, | 112 | static void nbio_v7_4_ih_doorbell_range(struct amdgpu_device *adev, |
diff --git a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c index 0c6e7f9b143f..189fcb004579 100644 --- a/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c +++ b/drivers/gpu/drm/amd/amdgpu/psp_v11_0.c | |||
| @@ -152,18 +152,22 @@ static int psp_v11_0_init_microcode(struct psp_context *psp) | |||
| 152 | 152 | ||
| 153 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ta.bin", chip_name); | 153 | snprintf(fw_name, sizeof(fw_name), "amdgpu/%s_ta.bin", chip_name); |
| 154 | err = request_firmware(&adev->psp.ta_fw, fw_name, adev->dev); | 154 | err = request_firmware(&adev->psp.ta_fw, fw_name, adev->dev); |
| 155 | if (err) | 155 | if (err) { |
| 156 | goto out2; | 156 | release_firmware(adev->psp.ta_fw); |
| 157 | 157 | adev->psp.ta_fw = NULL; | |
| 158 | err = amdgpu_ucode_validate(adev->psp.ta_fw); | 158 | dev_info(adev->dev, |
| 159 | if (err) | 159 | "psp v11.0: Failed to load firmware \"%s\"\n", fw_name); |
| 160 | goto out2; | 160 | } else { |
| 161 | 161 | err = amdgpu_ucode_validate(adev->psp.ta_fw); | |
| 162 | ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data; | 162 | if (err) |
| 163 | adev->psp.ta_xgmi_ucode_version = le32_to_cpu(ta_hdr->ta_xgmi_ucode_version); | 163 | goto out2; |
| 164 | adev->psp.ta_xgmi_ucode_size = le32_to_cpu(ta_hdr->ta_xgmi_size_bytes); | 164 | |
| 165 | adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr + | 165 | ta_hdr = (const struct ta_firmware_header_v1_0 *)adev->psp.ta_fw->data; |
| 166 | le32_to_cpu(ta_hdr->header.ucode_array_offset_bytes); | 166 | adev->psp.ta_xgmi_ucode_version = le32_to_cpu(ta_hdr->ta_xgmi_ucode_version); |
| 167 | adev->psp.ta_xgmi_ucode_size = le32_to_cpu(ta_hdr->ta_xgmi_size_bytes); | ||
| 168 | adev->psp.ta_xgmi_start_addr = (uint8_t *)ta_hdr + | ||
| 169 | le32_to_cpu(ta_hdr->header.ucode_array_offset_bytes); | ||
| 170 | } | ||
| 167 | 171 | ||
| 168 | return 0; | 172 | return 0; |
| 169 | 173 | ||
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c index fd0bfe140ee0..aa2f71cc1eba 100644 --- a/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c +++ b/drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c | |||
| @@ -78,7 +78,6 @@ static const struct soc15_reg_golden golden_settings_sdma_4[] = { | |||
| 78 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_RLC1_RB_WPTR_POLL_CNTL, 0x0000fff0, 0x00403000), | 78 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_RLC1_RB_WPTR_POLL_CNTL, 0x0000fff0, 0x00403000), |
| 79 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_PAGE, 0x000003ff, 0x000003c0), | 79 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_PAGE, 0x000003ff, 0x000003c0), |
| 80 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_WATERMK, 0xfc000000, 0x00000000), | 80 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_UTCL1_WATERMK, 0xfc000000, 0x00000000), |
| 81 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_CHICKEN_BITS, 0xfe931f07, 0x02831f07), | ||
| 82 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_CLK_CTRL, 0xffffffff, 0x3f000100), | 81 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_CLK_CTRL, 0xffffffff, 0x3f000100), |
| 83 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GFX_IB_CNTL, 0x800f0100, 0x00000100), | 82 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GFX_IB_CNTL, 0x800f0100, 0x00000100), |
| 84 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GFX_RB_WPTR_POLL_CNTL, 0x0000fff0, 0x00403000), | 83 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GFX_RB_WPTR_POLL_CNTL, 0x0000fff0, 0x00403000), |
| @@ -96,6 +95,7 @@ static const struct soc15_reg_golden golden_settings_sdma_4[] = { | |||
| 96 | static const struct soc15_reg_golden golden_settings_sdma_vg10[] = { | 95 | static const struct soc15_reg_golden golden_settings_sdma_vg10[] = { |
| 97 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG, 0x0018773f, 0x00104002), | 96 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG, 0x0018773f, 0x00104002), |
| 98 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG_READ, 0x0018773f, 0x00104002), | 97 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG_READ, 0x0018773f, 0x00104002), |
| 98 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_CHICKEN_BITS, 0xfe931f07, 0x02831d07), | ||
| 99 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG, 0x0018773f, 0x00104002), | 99 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG, 0x0018773f, 0x00104002), |
| 100 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG_READ, 0x0018773f, 0x00104002) | 100 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG_READ, 0x0018773f, 0x00104002) |
| 101 | }; | 101 | }; |
| @@ -103,6 +103,7 @@ static const struct soc15_reg_golden golden_settings_sdma_vg10[] = { | |||
| 103 | static const struct soc15_reg_golden golden_settings_sdma_vg12[] = { | 103 | static const struct soc15_reg_golden golden_settings_sdma_vg12[] = { |
| 104 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG, 0x0018773f, 0x00104001), | 104 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG, 0x0018773f, 0x00104001), |
| 105 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG_READ, 0x0018773f, 0x00104001), | 105 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG_READ, 0x0018773f, 0x00104001), |
| 106 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_CHICKEN_BITS, 0xfe931f07, 0x02831d07), | ||
| 106 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG, 0x0018773f, 0x00104001), | 107 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG, 0x0018773f, 0x00104001), |
| 107 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG_READ, 0x0018773f, 0x00104001) | 108 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG_READ, 0x0018773f, 0x00104001) |
| 108 | }; | 109 | }; |
| @@ -127,7 +128,7 @@ static const struct soc15_reg_golden golden_settings_sdma0_4_2_init[] = { | |||
| 127 | 128 | ||
| 128 | static const struct soc15_reg_golden golden_settings_sdma0_4_2[] = | 129 | static const struct soc15_reg_golden golden_settings_sdma0_4_2[] = |
| 129 | { | 130 | { |
| 130 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_CHICKEN_BITS, 0xfe931f07, 0x02831d07), | 131 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_CHICKEN_BITS, 0xfe931f07, 0x02831f07), |
| 131 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_CLK_CTRL, 0xffffffff, 0x3f000100), | 132 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_CLK_CTRL, 0xffffffff, 0x3f000100), |
| 132 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG, 0x0000773f, 0x00004002), | 133 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG, 0x0000773f, 0x00004002), |
| 133 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG_READ, 0x0000773f, 0x00004002), | 134 | SOC15_REG_GOLDEN_VALUE(SDMA0, 0, mmSDMA0_GB_ADDR_CONFIG_READ, 0x0000773f, 0x00004002), |
| @@ -157,7 +158,7 @@ static const struct soc15_reg_golden golden_settings_sdma0_4_2[] = | |||
| 157 | }; | 158 | }; |
| 158 | 159 | ||
| 159 | static const struct soc15_reg_golden golden_settings_sdma1_4_2[] = { | 160 | static const struct soc15_reg_golden golden_settings_sdma1_4_2[] = { |
| 160 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_CHICKEN_BITS, 0xfe931f07, 0x02831d07), | 161 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_CHICKEN_BITS, 0xfe931f07, 0x02831f07), |
| 161 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_CLK_CTRL, 0xffffffff, 0x3f000100), | 162 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_CLK_CTRL, 0xffffffff, 0x3f000100), |
| 162 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG, 0x0000773f, 0x00004002), | 163 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG, 0x0000773f, 0x00004002), |
| 163 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG_READ, 0x0000773f, 0x00004002), | 164 | SOC15_REG_GOLDEN_VALUE(SDMA1, 0, mmSDMA1_GB_ADDR_CONFIG_READ, 0x0000773f, 0x00004002), |
diff --git a/drivers/gpu/drm/amd/amdgpu/soc15.c b/drivers/gpu/drm/amd/amdgpu/soc15.c index 8849b74078d6..9b639974c70c 100644 --- a/drivers/gpu/drm/amd/amdgpu/soc15.c +++ b/drivers/gpu/drm/amd/amdgpu/soc15.c | |||
| @@ -729,11 +729,13 @@ static int soc15_common_early_init(void *handle) | |||
| 729 | case CHIP_RAVEN: | 729 | case CHIP_RAVEN: |
| 730 | adev->asic_funcs = &soc15_asic_funcs; | 730 | adev->asic_funcs = &soc15_asic_funcs; |
| 731 | if (adev->rev_id >= 0x8) | 731 | if (adev->rev_id >= 0x8) |
| 732 | adev->external_rev_id = adev->rev_id + 0x81; | 732 | adev->external_rev_id = adev->rev_id + 0x79; |
| 733 | else if (adev->pdev->device == 0x15d8) | 733 | else if (adev->pdev->device == 0x15d8) |
| 734 | adev->external_rev_id = adev->rev_id + 0x41; | 734 | adev->external_rev_id = adev->rev_id + 0x41; |
| 735 | else if (adev->rev_id == 1) | ||
| 736 | adev->external_rev_id = adev->rev_id + 0x20; | ||
| 735 | else | 737 | else |
| 736 | adev->external_rev_id = 0x1; | 738 | adev->external_rev_id = adev->rev_id + 0x01; |
| 737 | 739 | ||
| 738 | if (adev->rev_id >= 0x8) { | 740 | if (adev->rev_id >= 0x8) { |
| 739 | adev->cg_flags = AMD_CG_SUPPORT_GFX_MGCG | | 741 | adev->cg_flags = AMD_CG_SUPPORT_GFX_MGCG | |
