amd-drm-fixes-6.3-2023-03-23: amdgpu: - S4 fix - Soft reset fixes - SR-IOV fix - Remove an out of date comment in the DC code - ASPM fix - DCN 3.2 fixes
Unified · Split
| @@ -1272,6 +1272,7 @@ void amdgpu_device_pci_config_reset(struct amdgpu_device *adev); · 1271 unmodified lines | ||
| 1272 | 1272 | int amdgpu_device_pci_reset(struct amdgpu_device *adev); |
| 1273 | 1273 | bool amdgpu_device_need_post(struct amdgpu_device *adev); |
| 1274 | 1274 | bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev); |
| 1275 | +bool amdgpu_device_aspm_support_quirk(void); | |
| 1275 | 1276 | |
| 1276 | 1277 | void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes, |
| 1277 | 1278 | u64 num_vis_bytes); |
| @@ -1391,10 +1392,12 @@ int amdgpu_acpi_smart_shift_update(struct drm_device *dev, enum amdgpu_ss ss_sta · 113 unmodified lines | ||
| 1391 | 1392 | int amdgpu_acpi_pcie_notify_device_ready(struct amdgpu_device *adev); |
| 1392 | 1393 | |
| 1393 | 1394 | void amdgpu_acpi_get_backlight_caps(struct amdgpu_dm_backlight_caps *caps); |
| 1395 | +bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev); | |
| 1394 | 1396 | void amdgpu_acpi_detect(void); |
| 1395 | 1397 | #else |
| 1396 | 1398 | static inline int amdgpu_acpi_init(struct amdgpu_device *adev) { return 0; } |
| 1397 | 1399 | static inline void amdgpu_acpi_fini(struct amdgpu_device *adev) { } |
| 1400 | +static inline bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev) { return false; } | |
| 1398 | 1401 | static inline void amdgpu_acpi_detect(void) { } |
| 1399 | 1402 | static inline bool amdgpu_acpi_is_power_shift_control_supported(void) { return false; } |
| 1400 | 1403 | static inline int amdgpu_acpi_power_shift_control(struct amdgpu_device *adev, |
| @@ -1405,11 +1408,9 @@ static inline int amdgpu_acpi_smart_shift_update(struct drm_device *dev, · 4 unmodified lines | ||
| 1405 | 1408 | |
| 1406 | 1409 | #if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND) |
| 1407 | 1410 | bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev); |
| 1408 | −bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev); | |
| 1409 | 1411 | bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev); |
| 1410 | 1412 | #else |
| 1411 | 1413 | static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; } |
| 1412 | −static inline bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev) { return false; } | |
| 1413 | 1414 | static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false; } |
| 1414 | 1415 | #endif |
| 1415 | 1416 | |
| @@ -971,6 +971,29 @@ static bool amdgpu_atcs_pci_probe_handle(struct pci_dev *pdev) · 970 unmodified lines | ||
| 971 | 971 | return true; |
| 972 | 972 | } |
| 973 | 973 | |
| 974 | + | |
| 975 | +/** | |
| 976 | + * amdgpu_acpi_should_gpu_reset | |
| 977 | + * | |
| 978 | + * @adev: amdgpu_device_pointer | |
| 979 | + * | |
| 980 | + * returns true if should reset GPU, false if not | |
| 981 | + */ | |
| 982 | +bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev) | |
| 983 | +{ | |
| 984 | + if (adev->flags & AMD_IS_APU) | |
| 985 | + return false; | |
| 986 | + | |
| 987 | + if (amdgpu_sriov_vf(adev)) | |
| 988 | + return false; | |
| 989 | + | |
| 990 | +#if IS_ENABLED(CONFIG_SUSPEND) | |
| 991 | + return pm_suspend_target_state != PM_SUSPEND_TO_IDLE; | |
| 992 | +#else | |
| 993 | + return true; | |
| 994 | +#endif | |
| 995 | +} | |
| 996 | + | |
| 974 | 997 | /* |
| 975 | 998 | * amdgpu_acpi_detect - detect ACPI ATIF/ATCS methods |
| 976 | 999 | * |
| @@ -1042,24 +1065,6 @@ bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) · 65 unmodified lines | ||
| 1042 | 1065 | (pm_suspend_target_state == PM_SUSPEND_MEM); |
| 1043 | 1066 | } |
| 1044 | 1067 | |
| 1045 | −/** | |
| 1046 | − * amdgpu_acpi_should_gpu_reset | |
| 1047 | − * | |
| 1048 | − * @adev: amdgpu_device_pointer | |
| 1049 | − * | |
| 1050 | − * returns true if should reset GPU, false if not | |
| 1051 | − */ | |
| 1052 | −bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev) | |
| 1053 | −{ | |
| 1054 | − if (adev->flags & AMD_IS_APU) | |
| 1055 | − return false; | |
| 1056 | − | |
| 1057 | − if (amdgpu_sriov_vf(adev)) | |
| 1058 | − return false; | |
| 1059 | − | |
| 1060 | − return pm_suspend_target_state != PM_SUSPEND_TO_IDLE; | |
| 1061 | −} | |
| 1062 | − | |
| 1063 | 1068 | /** |
| 1064 | 1069 | * amdgpu_acpi_is_s0ix_active |
| 1065 | 1070 | * |
| @@ -80,6 +80,10 @@ · 79 unmodified lines | ||
| 80 | 80 | |
| 81 | 81 | #include <drm/drm_drv.h> |
| 82 | 82 | |
| 83 | +#if IS_ENABLED(CONFIG_X86) | |
| 84 | +#include <asm/intel-family.h> | |
| 85 | +#endif | |
| 86 | + | |
| 83 | 87 | MODULE_FIRMWARE("amdgpu/vega10_gpu_info.bin"); |
| 84 | 88 | MODULE_FIRMWARE("amdgpu/vega12_gpu_info.bin"); |
| 85 | 89 | MODULE_FIRMWARE("amdgpu/raven_gpu_info.bin"); |
| @@ -1356,6 +1360,17 @@ bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev) · 1270 unmodified lines | ||
| 1356 | 1360 | return pcie_aspm_enabled(adev->pdev); |
| 1357 | 1361 | } |
| 1358 | 1362 | |
| 1363 | +bool amdgpu_device_aspm_support_quirk(void) | |
| 1364 | +{ | |
| 1365 | +#if IS_ENABLED(CONFIG_X86) | |
| 1366 | + struct cpuinfo_x86 *c = &cpu_data(0); | |
| 1367 | + | |
| 1368 | + return !(c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE); | |
| 1369 | +#else | |
| 1370 | + return true; | |
| 1371 | +#endif | |
| 1372 | +} | |
| 1373 | + | |
| 1359 | 1374 | /* if we get transitioned to only one device, take VGA back */ |
| 1360 | 1375 | /** |
| 1361 | 1376 | * amdgpu_device_vga_set_decode - enable/disable vga decode |
| @@ -2467,7 +2467,10 @@ static int amdgpu_pmops_freeze(struct device *dev) · 2466 unmodified lines | ||
| 2467 | 2467 | adev->in_s4 = false; |
| 2468 | 2468 | if (r) |
| 2469 | 2469 | return r; |
| 2470 | − return amdgpu_asic_reset(adev); | |
| 2470 | + | |
| 2471 | + if (amdgpu_acpi_should_gpu_reset(adev)) | |
| 2472 | + return amdgpu_asic_reset(adev); | |
| 2473 | + return 0; | |
| 2471 | 2474 | } |
| 2472 | 2475 | |
| 2473 | 2476 | static int amdgpu_pmops_thaw(struct device *dev) |
| @@ -678,6 +678,15 @@ void amdgpu_fence_driver_clear_job_fences(struct amdgpu_ring *ring) · 677 unmodified lines | ||
| 678 | 678 | ptr = &ring->fence_drv.fences[i]; |
| 679 | 679 | old = rcu_dereference_protected(*ptr, 1); |
| 680 | 680 | if (old && old->ops == &amdgpu_job_fence_ops) { |
| 681 | + struct amdgpu_job *job; | |
| 682 | + | |
| 683 | + /* For non-scheduler bad job, i.e. failed ib test, we need to signal | |
| 684 | + * it right here or we won't be able to track them in fence_drv | |
| 685 | + * and they will remain unsignaled during sa_bo free. | |
| 686 | + */ | |
| 687 | + job = container_of(old, struct amdgpu_job, hw_fence); | |
| 688 | + if (!job->base.s_fence && !dma_fence_is_signaled(old)) | |
| 689 | + dma_fence_signal(old); | |
| 681 | 690 | RCU_INIT_POINTER(*ptr, NULL); |
| 682 | 691 | dma_fence_put(old); |
| 683 | 692 | } |
| @@ -1287,6 +1287,11 @@ static int gfx_v11_0_sw_init(void *handle) · 1286 unmodified lines | ||
| 1287 | 1287 | break; |
| 1288 | 1288 | } |
| 1289 | 1289 | |
| 1290 | + /* Enable CG flag in one VF mode for enabling RLC safe mode enter/exit */ | |
| 1291 | + if (adev->ip_versions[GC_HWIP][0] == IP_VERSION(11, 0, 3) && | |
| 1292 | + amdgpu_sriov_is_pp_one_vf(adev)) | |
| 1293 | + adev->cg_flags = AMD_CG_SUPPORT_GFX_CGCG; | |
| 1294 | + | |
| 1290 | 1295 | /* EOP Event */ |
| 1291 | 1296 | r = amdgpu_irq_add_id(adev, SOC21_IH_CLIENTID_GRBM_CP, |
| 1292 | 1297 | GFX_11_0_0__SRCID__CP_EOP_INTERRUPT, |
| @@ -4655,6 +4660,14 @@ static bool gfx_v11_0_check_soft_reset(void *handle) · 3362 unmodified lines | ||
| 4655 | 4660 | return false; |
| 4656 | 4661 | } |
| 4657 | 4662 | |
| 4663 | +static int gfx_v11_0_post_soft_reset(void *handle) | |
| 4664 | +{ | |
| 4665 | + /** | |
| 4666 | + * GFX soft reset will impact MES, need resume MES when do GFX soft reset | |
| 4667 | + */ | |
| 4668 | + return amdgpu_mes_resume((struct amdgpu_device *)handle); | |
| 4669 | +} | |
| 4670 | + | |
| 4658 | 4671 | static uint64_t gfx_v11_0_get_gpu_clock_counter(struct amdgpu_device *adev) |
| 4659 | 4672 | { |
| 4660 | 4673 | uint64_t clock; |
| @@ -6166,6 +6179,7 @@ static const struct amd_ip_funcs gfx_v11_0_ip_funcs = { · 1505 unmodified lines | ||
| 6166 | 6179 | .wait_for_idle = gfx_v11_0_wait_for_idle, |
| 6167 | 6180 | .soft_reset = gfx_v11_0_soft_reset, |
| 6168 | 6181 | .check_soft_reset = gfx_v11_0_check_soft_reset, |
| 6182 | + .post_soft_reset = gfx_v11_0_post_soft_reset, | |
| 6169 | 6183 | .set_clockgating_state = gfx_v11_0_set_clockgating_state, |
| 6170 | 6184 | .set_powergating_state = gfx_v11_0_set_powergating_state, |
| 6171 | 6185 | .get_clockgating_state = gfx_v11_0_get_clockgating_state, |
| @@ -578,7 +578,7 @@ static void nv_pcie_gen3_enable(struct amdgpu_device *adev) · 577 unmodified lines | ||
| 578 | 578 | |
| 579 | 579 | static void nv_program_aspm(struct amdgpu_device *adev) |
| 580 | 580 | { |
| 581 | − if (!amdgpu_device_should_use_aspm(adev)) | |
| 581 | + if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_aspm_support_quirk()) | |
| 582 | 582 | return; |
| 583 | 583 | |
| 584 | 584 | if (!(adev->flags & AMD_IS_APU) && |
| @@ -81,10 +81,6 @@ · 80 unmodified lines | ||
| 81 | 81 | #include "mxgpu_vi.h" |
| 82 | 82 | #include "amdgpu_dm.h" |
| 83 | 83 | |
| 84 | −#if IS_ENABLED(CONFIG_X86) | |
| 85 | −#include <asm/intel-family.h> | |
| 86 | −#endif | |
| 87 | − | |
| 88 | 84 | #define ixPCIE_LC_L1_PM_SUBSTATE 0x100100C6 |
| 89 | 85 | #define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK 0x00000001L |
| 90 | 86 | #define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK 0x00000002L |
| @@ -1138,24 +1134,13 @@ static void vi_enable_aspm(struct amdgpu_device *adev) · 1047 unmodified lines | ||
| 1138 | 1134 | WREG32_PCIE(ixPCIE_LC_CNTL, data); |
| 1139 | 1135 | } |
| 1140 | 1136 | |
| 1141 | −static bool aspm_support_quirk_check(void) | |
| 1142 | −{ | |
| 1143 | −#if IS_ENABLED(CONFIG_X86) | |
| 1144 | − struct cpuinfo_x86 *c = &cpu_data(0); | |
| 1145 | − | |
| 1146 | − return !(c->x86 == 6 && c->x86_model == INTEL_FAM6_ALDERLAKE); | |
| 1147 | −#else | |
| 1148 | − return true; | |
| 1149 | −#endif | |
| 1150 | −} | |
| 1151 | − | |
| 1152 | 1137 | static void vi_program_aspm(struct amdgpu_device *adev) |
| 1153 | 1138 | { |
| 1154 | 1139 | u32 data, data1, orig; |
| 1155 | 1140 | bool bL1SS = false; |
| 1156 | 1141 | bool bClkReqSupport = true; |
| 1157 | 1142 | |
| 1158 | − if (!amdgpu_device_should_use_aspm(adev) || !aspm_support_quirk_check()) | |
| 1143 | + if (!amdgpu_device_should_use_aspm(adev) || !amdgpu_device_aspm_support_quirk()) | |
| 1159 | 1144 | return; |
| 1160 | 1145 | |
| 1161 | 1146 | if (adev->flags & AMD_IS_APU || |
| @@ -7244,7 +7244,6 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, · 7243 unmodified lines | ||
| 7244 | 7244 | if (!aconnector->mst_root) |
| 7245 | 7245 | drm_connector_attach_max_bpc_property(&aconnector->base, 8, 16); |
| 7246 | 7246 | |
| 7247 | − /* This defaults to the max in the range, but we want 8bpc for non-edp. */ | |
| 7248 | 7247 | aconnector->base.state->max_bpc = 16; |
| 7249 | 7248 | aconnector->base.state->max_requested_bpc = aconnector->base.state->max_bpc; |
| 7250 | 7249 | |
| @@ -271,8 +271,7 @@ static void dccg32_set_dpstreamclk( · 270 unmodified lines | ||
| 271 | 271 | dccg32_set_dtbclk_p_src(dccg, src, otg_inst); |
| 272 | 272 | |
| 273 | 273 | /* enabled to select one of the DTBCLKs for pipe */ |
| 274 | − switch (otg_inst) | |
| 275 | − { | |
| 274 | + switch (dp_hpo_inst) { | |
| 276 | 275 | case 0: |
| 277 | 276 | REG_UPDATE_2(DPSTREAMCLK_CNTL, |
| 278 | 277 | DPSTREAMCLK0_EN, |
| @@ -2186,6 +2186,7 @@ static bool dcn32_resource_construct( · 2185 unmodified lines | ||
| 2186 | 2186 | dc->caps.edp_dsc_support = true; |
| 2187 | 2187 | dc->caps.extended_aux_timeout_support = true; |
| 2188 | 2188 | dc->caps.dmcub_support = true; |
| 2189 | + dc->caps.seamless_odm = true; | |
| 2189 | 2190 | |
| 2190 | 2191 | /* Color pipeline capabilities */ |
| 2191 | 2192 | dc->caps.color.dpp.dcn_arch = 1; |