History

Merge tag 'amd-drm-fixes-6.3-2023-03-23' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes

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

Daniel Vetter committed 3 years ago

Commit 2e4e9de2 parents e37fef7 f9537b111 files · +72 −41Browse files

Unified · Split

11 files
  1. drivers/gpu/drm/amd/amdgpu/amdgpu.h +3 −2
  2. drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c +23 −18
  3. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +15 −0
  4. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +4 −1
  5. drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c +9 −0
  6. drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +14 −0
  7. drivers/gpu/drm/amd/amdgpu/nv.c +1 −1
  8. drivers/gpu/drm/amd/amdgpu/vi.c +1 −16
  9. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 −1
  10. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c +1 −2
  11. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 −0
drivers/gpu/drm/amd/amdgpu/amdgpu.h+3−2
@@ -1272,6 +1272,7 @@ void amdgpu_device_pci_config_reset(struct amdgpu_device *adev); · 1271 unmodified lines
1272int amdgpu_device_pci_reset(struct amdgpu_device *adev);1272int amdgpu_device_pci_reset(struct amdgpu_device *adev);
1273bool amdgpu_device_need_post(struct amdgpu_device *adev);1273bool amdgpu_device_need_post(struct amdgpu_device *adev);
1274bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev);1274bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev);
1275bool amdgpu_device_aspm_support_quirk(void);
1275 1276
1276void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes,1277void amdgpu_cs_report_moved_bytes(struct amdgpu_device *adev, u64 num_bytes,
1277 u64 num_vis_bytes);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
1391int amdgpu_acpi_pcie_notify_device_ready(struct amdgpu_device *adev);1392int amdgpu_acpi_pcie_notify_device_ready(struct amdgpu_device *adev);
1392 1393
1393void amdgpu_acpi_get_backlight_caps(struct amdgpu_dm_backlight_caps *caps);1394void amdgpu_acpi_get_backlight_caps(struct amdgpu_dm_backlight_caps *caps);
1395bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev);
1394void amdgpu_acpi_detect(void);1396void amdgpu_acpi_detect(void);
1395#else1397#else
1396static inline int amdgpu_acpi_init(struct amdgpu_device *adev) { return 0; }1398static inline int amdgpu_acpi_init(struct amdgpu_device *adev) { return 0; }
1397static inline void amdgpu_acpi_fini(struct amdgpu_device *adev) { }1399static inline void amdgpu_acpi_fini(struct amdgpu_device *adev) { }
1400static inline bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev) { return false; }
1398static inline void amdgpu_acpi_detect(void) { }1401static inline void amdgpu_acpi_detect(void) { }
1399static inline bool amdgpu_acpi_is_power_shift_control_supported(void) { return false; }1402static inline bool amdgpu_acpi_is_power_shift_control_supported(void) { return false; }
1400static inline int amdgpu_acpi_power_shift_control(struct amdgpu_device *adev,1403static 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#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND)1409#if defined(CONFIG_ACPI) && defined(CONFIG_SUSPEND)
1407bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev);1410bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev);
1408bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev);
1409bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);1411bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev);
1410#else1412#else
1411static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }1413static inline bool amdgpu_acpi_is_s0ix_active(struct amdgpu_device *adev) { return false; }
1412static inline bool amdgpu_acpi_should_gpu_reset(struct amdgpu_device *adev) { return false; }
1413static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false; }1414static inline bool amdgpu_acpi_is_s3_active(struct amdgpu_device *adev) { return false; }
1414#endif1415#endif
1415 1416
drivers/gpu/drm/amd/amdgpu/amdgpu_acpi.c+23−18
@@ -971,6 +971,29 @@ static bool amdgpu_atcs_pci_probe_handle(struct pci_dev *pdev) · 970 unmodified lines
971 return true;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 */
982bool 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 * amdgpu_acpi_detect - detect ACPI ATIF/ATCS methods998 * 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 (pm_suspend_target_state == PM_SUSPEND_MEM);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 */
1052bool 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 * amdgpu_acpi_is_s0ix_active1069 * amdgpu_acpi_is_s0ix_active
1065 *1070 *
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+15−0
@@ -80,6 +80,10 @@ · 79 unmodified lines
80 80
81#include <drm/drm_drv.h>81#include <drm/drm_drv.h>
82 82
83#if IS_ENABLED(CONFIG_X86)
84#include <asm/intel-family.h>
85#endif
86
83MODULE_FIRMWARE("amdgpu/vega10_gpu_info.bin");87MODULE_FIRMWARE("amdgpu/vega10_gpu_info.bin");
84MODULE_FIRMWARE("amdgpu/vega12_gpu_info.bin");88MODULE_FIRMWARE("amdgpu/vega12_gpu_info.bin");
85MODULE_FIRMWARE("amdgpu/raven_gpu_info.bin");89MODULE_FIRMWARE("amdgpu/raven_gpu_info.bin");
@@ -1356,6 +1360,17 @@ bool amdgpu_device_should_use_aspm(struct amdgpu_device *adev) · 1270 unmodified lines
1356 return pcie_aspm_enabled(adev->pdev);1360 return pcie_aspm_enabled(adev->pdev);
1357}1361}
1358 1362
1363bool 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/* if we get transitioned to only one device, take VGA back */1374/* if we get transitioned to only one device, take VGA back */
1360/**1375/**
1361 * amdgpu_device_vga_set_decode - enable/disable vga decode1376 * amdgpu_device_vga_set_decode - enable/disable vga decode
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+4−1
@@ -2467,7 +2467,10 @@ static int amdgpu_pmops_freeze(struct device *dev) · 2466 unmodified lines
2467 adev->in_s4 = false;2467 adev->in_s4 = false;
2468 if (r)2468 if (r)
2469 return r;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
2473static int amdgpu_pmops_thaw(struct device *dev)2476static int amdgpu_pmops_thaw(struct device *dev)
drivers/gpu/drm/amd/amdgpu/amdgpu_fence.c+9−0
@@ -678,6 +678,15 @@ void amdgpu_fence_driver_clear_job_fences(struct amdgpu_ring *ring) · 677 unmodified lines
678 ptr = &ring->fence_drv.fences[i];678 ptr = &ring->fence_drv.fences[i];
679 old = rcu_dereference_protected(*ptr, 1);679 old = rcu_dereference_protected(*ptr, 1);
680 if (old && old->ops == &amdgpu_job_fence_ops) {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 RCU_INIT_POINTER(*ptr, NULL);690 RCU_INIT_POINTER(*ptr, NULL);
682 dma_fence_put(old);691 dma_fence_put(old);
683 }692 }
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c+14−0
@@ -1287,6 +1287,11 @@ static int gfx_v11_0_sw_init(void *handle) · 1286 unmodified lines
1287 break;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 /* EOP Event */1295 /* EOP Event */
1291 r = amdgpu_irq_add_id(adev, SOC21_IH_CLIENTID_GRBM_CP,1296 r = amdgpu_irq_add_id(adev, SOC21_IH_CLIENTID_GRBM_CP,
1292 GFX_11_0_0__SRCID__CP_EOP_INTERRUPT,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 return false;4660 return false;
4656}4661}
4657 4662
4663static 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
4658static uint64_t gfx_v11_0_get_gpu_clock_counter(struct amdgpu_device *adev)4671static uint64_t gfx_v11_0_get_gpu_clock_counter(struct amdgpu_device *adev)
4659{4672{
4660 uint64_t clock;4673 uint64_t clock;
@@ -6166,6 +6179,7 @@ static const struct amd_ip_funcs gfx_v11_0_ip_funcs = { · 1505 unmodified lines
6166 .wait_for_idle = gfx_v11_0_wait_for_idle,6179 .wait_for_idle = gfx_v11_0_wait_for_idle,
6167 .soft_reset = gfx_v11_0_soft_reset,6180 .soft_reset = gfx_v11_0_soft_reset,
6168 .check_soft_reset = gfx_v11_0_check_soft_reset,6181 .check_soft_reset = gfx_v11_0_check_soft_reset,
6182 .post_soft_reset = gfx_v11_0_post_soft_reset,
6169 .set_clockgating_state = gfx_v11_0_set_clockgating_state,6183 .set_clockgating_state = gfx_v11_0_set_clockgating_state,
6170 .set_powergating_state = gfx_v11_0_set_powergating_state,6184 .set_powergating_state = gfx_v11_0_set_powergating_state,
6171 .get_clockgating_state = gfx_v11_0_get_clockgating_state,6185 .get_clockgating_state = gfx_v11_0_get_clockgating_state,
drivers/gpu/drm/amd/amdgpu/nv.c+1−1
@@ -578,7 +578,7 @@ static void nv_pcie_gen3_enable(struct amdgpu_device *adev) · 577 unmodified lines
578 578
579static void nv_program_aspm(struct amdgpu_device *adev)579static 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 return;582 return;
583 583
584 if (!(adev->flags & AMD_IS_APU) &&584 if (!(adev->flags & AMD_IS_APU) &&
drivers/gpu/drm/amd/amdgpu/vi.c+1−16
@@ -81,10 +81,6 @@ · 80 unmodified lines
81#include "mxgpu_vi.h"81#include "mxgpu_vi.h"
82#include "amdgpu_dm.h"82#include "amdgpu_dm.h"
83 83
84#if IS_ENABLED(CONFIG_X86)
85#include <asm/intel-family.h>
86#endif
87
88#define ixPCIE_LC_L1_PM_SUBSTATE 0x100100C684#define ixPCIE_LC_L1_PM_SUBSTATE 0x100100C6
89#define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK 0x00000001L85#define PCIE_LC_L1_PM_SUBSTATE__LC_L1_SUBSTATES_OVERRIDE_EN_MASK 0x00000001L
90#define PCIE_LC_L1_PM_SUBSTATE__LC_PCI_PM_L1_2_OVERRIDE_MASK 0x00000002L86#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 WREG32_PCIE(ixPCIE_LC_CNTL, data);1134 WREG32_PCIE(ixPCIE_LC_CNTL, data);
1139}1135}
1140 1136
1141static 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
1152static void vi_program_aspm(struct amdgpu_device *adev)1137static void vi_program_aspm(struct amdgpu_device *adev)
1153{1138{
1154 u32 data, data1, orig;1139 u32 data, data1, orig;
1155 bool bL1SS = false;1140 bool bL1SS = false;
1156 bool bClkReqSupport = true;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 return;1144 return;
1160 1145
1161 if (adev->flags & AMD_IS_APU ||1146 if (adev->flags & AMD_IS_APU ||
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+0−1
@@ -7244,7 +7244,6 @@ void amdgpu_dm_connector_init_helper(struct amdgpu_display_manager *dm, · 7243 unmodified lines
7244 if (!aconnector->mst_root)7244 if (!aconnector->mst_root)
7245 drm_connector_attach_max_bpc_property(&aconnector->base, 8, 16);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 aconnector->base.state->max_bpc = 16;7247 aconnector->base.state->max_bpc = 16;
7249 aconnector->base.state->max_requested_bpc = aconnector->base.state->max_bpc;7248 aconnector->base.state->max_requested_bpc = aconnector->base.state->max_bpc;
7250 7249
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_dccg.c+1−2
@@ -271,8 +271,7 @@ static void dccg32_set_dpstreamclk( · 270 unmodified lines
271 dccg32_set_dtbclk_p_src(dccg, src, otg_inst);271 dccg32_set_dtbclk_p_src(dccg, src, otg_inst);
272 272
273 /* enabled to select one of the DTBCLKs for pipe */273 /* enabled to select one of the DTBCLKs for pipe */
274 switch (otg_inst)274 switch (dp_hpo_inst) {
275 {
276 case 0:275 case 0:
277 REG_UPDATE_2(DPSTREAMCLK_CNTL,276 REG_UPDATE_2(DPSTREAMCLK_CNTL,
278 DPSTREAMCLK0_EN,277 DPSTREAMCLK0_EN,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c+1−0
@@ -2186,6 +2186,7 @@ static bool dcn32_resource_construct( · 2185 unmodified lines
2186 dc->caps.edp_dsc_support = true;2186 dc->caps.edp_dsc_support = true;
2187 dc->caps.extended_aux_timeout_support = true;2187 dc->caps.extended_aux_timeout_support = true;
2188 dc->caps.dmcub_support = true;2188 dc->caps.dmcub_support = true;
2189 dc->caps.seamless_odm = true;
2189 2190
2190 /* Color pipeline capabilities */2191 /* Color pipeline capabilities */
2191 dc->caps.color.dpp.dcn_arch = 1;2192 dc->caps.color.dpp.dcn_arch = 1;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t