History

Merge tag 'amd-drm-next-6.3-2023-01-06' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-next-6.3-2023-01-06: amdgpu: - secure display support for multiple displays - DML optimizations - DCN 3.2 updates - PSR updates - DP 2.1 updates - SR-IOV RAS updates - VCN RAS support - SMU 13.x updates - Switch 1 element arrays to flexible arrays - Add RAS support for DF 4.3 - Stack size improvements - S0ix rework - Soft reset fix - Allow 0 as a vram limit on APUs - Display fixes - Misc code cleanups - Documentation fixes - Handle profiling modes for SMU13.x amdkfd: - Error handling fixes - PASID fixes radeon: - Switch 1 element arrays to flexible arrays drm: - Add DP adaptive sync DPCD definitions UAPI: - Add new INFO queries for peak and min sclk/mclk for profile modes on newer chips Proposed mesa patch: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/278

Dave Airlie committed 3 years ago

Commit 45be2042 parents 03a0a10 f6e856e138 files · +1979 −999Browse files

Unified · Split

138 files
  1. drivers/gpu/drm/amd/amdgpu/Makefile +2 −1
  2. drivers/gpu/drm/amd/amdgpu/amdgpu.h +10 −4
  3. drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c +21 −1
  4. drivers/gpu/drm/amd/amdgpu/amdgpu_device.c +31 −41
  5. drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +4 −0
  6. drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +1 −1
  7. drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c +32 −3
  8. drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c +5 −2
  9. drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +8 −1
  10. drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +26 −2
  11. drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +1 −0
  12. drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +16 −10
  13. drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +132 −55
  14. drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h +2 −1
  15. drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c +6 −3
  16. drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c +4 −4
  17. drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.h +1 −1
  18. drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c +8 −15
  19. drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c +26 −18
  20. drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c +5 −2
  21. drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c +3 −1
  22. drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c +20 −6
  23. drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c +2 −1
  24. drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h +1 −0
  25. drivers/gpu/drm/amd/amdgpu/dce_v10_0.c +3 −3
  26. drivers/gpu/drm/amd/amdgpu/dce_v11_0.c +3 −3
  27. drivers/gpu/drm/amd/amdgpu/dce_v6_0.c +3 −3
  28. drivers/gpu/drm/amd/amdgpu/dce_v8_0.c +3 −3
  29. drivers/gpu/drm/amd/amdgpu/df_v4_3.c +61 −0
  30. drivers/gpu/drm/amd/amdgpu/df_v4_3.h +31 −0
  31. drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +23 −10
  32. drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c +2 −1
  33. drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c +2 −1
  34. drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c +2 −1
  35. drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c +2 −1
  36. drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c +1 −1
  37. drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c +1 −1
  38. drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c +1 −1
  39. drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c +1 −1
  40. drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c +1 −1
  41. drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c +27 −12
  42. drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +14 −2
  43. drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c +1 −1
  44. drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +1 −4
  45. drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +1 −4
  46. drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c +30 −9
  47. drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +6 −2
  48. drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c +1 −1
  49. drivers/gpu/drm/amd/amdgpu/mmhub_v1_7.c +1 −1
  50. drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c +1 −1
  51. drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c +1 −1
  52. drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c +1 −1
  53. drivers/gpu/drm/amd/amdgpu/mmhub_v3_0_1.c +1 −1
  54. drivers/gpu/drm/amd/amdgpu/mmhub_v3_0_2.c +1 −1
  55. drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.c +1 −1
  56. drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c +6 −0
  57. drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h +1 −0
  58. drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c +6 −0
  59. drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h +1 −0
  60. drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c +0 −8
  61. drivers/gpu/drm/amd/amdgpu/ta_secureDisplay_if.h +12 −12
  62. drivers/gpu/drm/amd/amdgpu/umc_v8_10.c +4 −20
  63. drivers/gpu/drm/amd/amdkfd/kfd_device.c +0 −11
  64. drivers/gpu/drm/amd/amdkfd/kfd_topology.c +1 −1
  65. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +252 −112
  66. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h +4 −3
  67. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c +87 −74
  68. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h +11 −15
  69. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +24 −86
  70. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.h +14 −0
  71. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +26 −0
  72. drivers/gpu/drm/amd/display/dc/core/dc.c +54 −52
  73. drivers/gpu/drm/amd/display/dc/core/dc_link.c +0 −9
  74. drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c +0 −1
  75. drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c +67 −70
  76. drivers/gpu/drm/amd/display/dc/core/dc_resource.c +51 −3
  77. drivers/gpu/drm/amd/display/dc/core/dc_stat.c +1 −0
  78. drivers/gpu/drm/amd/display/dc/core/dc_stream.c +8 −1
  79. drivers/gpu/drm/amd/display/dc/dc.h +2 −1
  80. drivers/gpu/drm/amd/display/dc/dc_dp_types.h +3 −1
  81. drivers/gpu/drm/amd/display/dc/dc_link.h +9 −6
  82. drivers/gpu/drm/amd/display/dc/dc_stream.h +1 −2
  83. drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c +13 −0
  84. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c +0 −1
  85. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c +86 −0
  86. drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c +3 −0
  87. drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c +2 −1
  88. drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_link_encoder.c +4 −1
  89. drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c +0 −40
  90. drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.h +0 −4
  91. drivers/gpu/drm/amd/display/dc/dcn31/dcn31_init.c +2 −2
  92. drivers/gpu/drm/amd/display/dc/dcn31/dcn31_optc.c +1 −28
  93. drivers/gpu/drm/amd/display/dc/dcn31/dcn31_optc.h +1 −4
  94. drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dio_stream_encoder.c +3 −3
  95. drivers/gpu/drm/amd/display/dc/dcn314/dcn314_init.c +2 −2
  96. drivers/gpu/drm/amd/display/dc/dcn314/dcn314_optc.c +1 −2
  97. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c +38 −1
  98. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h +2 −0
  99. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c +1 −0
  100. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c +1 −0
  101. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.h +1 −0
  102. drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c +15 −1
  103. drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c +1 −0
  104. drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +21 −4
  105. drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c +20 −17
  106. drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c +3 −3
  107. drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c +1 −1
  108. drivers/gpu/drm/amd/display/dc/dml/display_mode_lib.h +1 −0
  109. drivers/gpu/drm/amd/display/dc/inc/core_types.h +9 −9
  110. drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h +1 −0
  111. drivers/gpu/drm/amd/display/dc/inc/resource.h +9 −0
  112. drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c +0 −5
  113. drivers/gpu/drm/amd/display/dc/link/link_hwss_hpo_dp.c +0 −37
  114. drivers/gpu/drm/amd/display/dmub/dmub_srv.h +3 −0
  115. drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +83 −0
  116. drivers/gpu/drm/amd/display/dmub/src/dmub_srv_stat.c +21 −0
  117. drivers/gpu/drm/amd/display/include/dpcd_defs.h +4 −1
  118. drivers/gpu/drm/amd/display/include/link_service_types.h +6 −1
  119. drivers/gpu/drm/amd/include/asic_reg/df/df_4_3_offset.h +30 −0
  120. drivers/gpu/drm/amd/include/asic_reg/df/df_4_3_sh_mask.h +157 −0
  121. drivers/gpu/drm/amd/include/kgd_pp_interface.h +2 −0
  122. drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c +8 −2
  123. drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c +13 −3
  124. drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c +63 −13
  125. drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c +14 −2
  126. drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c +26 −5
  127. drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c +22 −0
  128. drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c +7 −13
  129. drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h +2 −0
  130. drivers/gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c +4 −6
  131. drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +8 −0
  132. drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h +0 −5
  133. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c +2 −41
  134. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c +4 −2
  135. drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c +1 −0
  136. drivers/gpu/drm/radeon/atombios.h +5 −5
  137. include/drm/display/drm_dp.h +6 −0
  138. include/uapi/drm/amdgpu_drm.h +6 −0
drivers/gpu/drm/amd/amdgpu/Makefile+2−1
@@ -81,7 +81,8 @@ amdgpu-y += \ · 80 unmodified lines
8181 # add DF block
8282 amdgpu-y += \
8383 df_v1_7.o \
84− df_v3_6.o
84+ df_v3_6.o \
85+ df_v4_3.o
8586
8687 # add GMC block
8788 amdgpu-y += \
drivers/gpu/drm/amd/amdgpu/amdgpu.h+10−4
@@ -149,7 +149,7 @@ struct amdgpu_watchdog_timer · 148 unmodified lines
149149 * Modules parameters.
150150 */
151151 extern int amdgpu_modeset;
152−extern int amdgpu_vram_limit;
152+extern unsigned int amdgpu_vram_limit;
153153 extern int amdgpu_vis_vram_limit;
154154 extern int amdgpu_gart_size;
155155 extern int amdgpu_gtt_size;
@@ -194,6 +194,7 @@ extern int amdgpu_emu_mode; · 38 unmodified lines
194194 extern uint amdgpu_smu_memory_pool_size;
195195 extern int amdgpu_smu_pptable_id;
196196 extern uint amdgpu_dc_feature_mask;
197+extern uint amdgpu_freesync_vid_mode;
197198 extern uint amdgpu_dc_debug_mask;
198199 extern uint amdgpu_dc_visual_confirm;
199200 extern uint amdgpu_dm_abm_level;
@@ -607,7 +608,7 @@ int amdgpu_cs_wait_fences_ioctl(struct drm_device *dev, void *data, · 407 unmodified lines
607608 struct drm_file *filp);
608609
609610 /* VRAM scratch page for HDP bug, default vram page */
610−struct amdgpu_vram_scratch {
611+struct amdgpu_mem_scratch {
611612 struct amdgpu_bo *robj;
612613 volatile uint32_t *ptr;
613614 u64 gpu_addr;
@@ -754,6 +755,11 @@ struct amdgpu_mqd { · 140 unmodified lines
754755 #define AMDGPU_PRODUCT_NAME_LEN 64
755756 struct amdgpu_reset_domain;
756757
758+/*
759+ * Non-zero (true) if the GPU has VRAM. Zero (false) otherwise.
760+ */
761+#define AMDGPU_HAS_VRAM(_adev) ((_adev)->gmc.real_vram_size)
762+
757763 struct amdgpu_device {
758764 struct device *dev;
759765 struct pci_dev *pdev;
@@ -847,7 +853,7 @@ struct amdgpu_device { · 87 unmodified lines
847853
848854 /* memory management */
849855 struct amdgpu_mman mman;
850− struct amdgpu_vram_scratch vram_scratch;
856+ struct amdgpu_mem_scratch mem_scratch;
851857 struct amdgpu_wb wb;
852858 atomic64_t num_bytes_moved;
853859 atomic64_t num_evictions;
@@ -869,7 +875,7 @@ struct amdgpu_device { · 15 unmodified lines
869875 struct amdgpu_vkms_output *amdgpu_vkms_output;
870876 struct amdgpu_mode_info mode_info;
871877 /* For pre-DCE11. DCE11 and later are in "struct amdgpu_device->dm" */
872− struct work_struct hotplug_work;
878+ struct delayed_work hotplug_work;
873879 struct amdgpu_irq_src crtc_irq;
874880 struct amdgpu_irq_src vline0_irq;
875881 struct amdgpu_irq_src vupdate_irq;
drivers/gpu/drm/amd/amdgpu/amdgpu_connectors.c+21−1
@@ -996,13 +996,33 @@ amdgpu_connector_dvi_detect(struct drm_connector *connector, bool force) · 995 unmodified lines
996996 }
997997 }
998998
999+ if (amdgpu_connector->detected_hpd_without_ddc) {
1000+ force = true;
1001+ amdgpu_connector->detected_hpd_without_ddc = false;
1002+ }
1003+
9991004 if (!force && amdgpu_connector_check_hpd_status_unchanged(connector)) {
10001005 ret = connector->status;
10011006 goto exit;
10021007 }
10031008
1004− if (amdgpu_connector->ddc_bus)
1009+ if (amdgpu_connector->ddc_bus) {
10051010 dret = amdgpu_display_ddc_probe(amdgpu_connector, false);
1011+
1012+ /* Sometimes the pins required for the DDC probe on DVI
1013+ * connectors don't make contact at the same time that the ones
1014+ * for HPD do. If the DDC probe fails even though we had an HPD
1015+ * signal, try again later
1016+ */
1017+ if (!dret && !force &&
1018+ amdgpu_display_hpd_sense(adev, amdgpu_connector->hpd.hpd)) {
1019+ DRM_DEBUG_KMS("hpd detected without ddc, retrying in 1 second\n");
1020+ amdgpu_connector->detected_hpd_without_ddc = true;
1021+ schedule_delayed_work(&adev->hotplug_work,
1022+ msecs_to_jiffies(1000));
1023+ goto exit;
1024+ }
1025+ }
10061026 if (dret) {
10071027 amdgpu_connector->detected_by_load = false;
10081028 amdgpu_connector_free_edid(connector);
drivers/gpu/drm/amd/amdgpu/amdgpu_device.c+31−41
@@ -924,32 +924,33 @@ static int amdgpu_device_asic_init(struct amdgpu_device *adev) · 923 unmodified lines
924924 }
925925
926926 /**
927− * amdgpu_device_vram_scratch_init - allocate the VRAM scratch page
927+ * amdgpu_device_mem_scratch_init - allocate the VRAM scratch page
928928 *
929929 * @adev: amdgpu_device pointer
930930 *
931931 * Allocates a scratch page of VRAM for use by various things in the
932932 * driver.
933933 */
934−static int amdgpu_device_vram_scratch_init(struct amdgpu_device *adev)
934+static int amdgpu_device_mem_scratch_init(struct amdgpu_device *adev)
935935 {
936− return amdgpu_bo_create_kernel(adev, AMDGPU_GPU_PAGE_SIZE,
937− PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM,
938− &adev->vram_scratch.robj,
939− &adev->vram_scratch.gpu_addr,
940− (void **)&adev->vram_scratch.ptr);
936+ return amdgpu_bo_create_kernel(adev, AMDGPU_GPU_PAGE_SIZE, PAGE_SIZE,
937+ AMDGPU_GEM_DOMAIN_VRAM |
938+ AMDGPU_GEM_DOMAIN_GTT,
939+ &adev->mem_scratch.robj,
940+ &adev->mem_scratch.gpu_addr,
941+ (void **)&adev->mem_scratch.ptr);
941942 }
942943
943944 /**
944− * amdgpu_device_vram_scratch_fini - Free the VRAM scratch page
945+ * amdgpu_device_mem_scratch_fini - Free the VRAM scratch page
945946 *
946947 * @adev: amdgpu_device pointer
947948 *
948949 * Frees the VRAM scratch page.
949950 */
950−static void amdgpu_device_vram_scratch_fini(struct amdgpu_device *adev)
951+static void amdgpu_device_mem_scratch_fini(struct amdgpu_device *adev)
951952 {
952− amdgpu_bo_free_kernel(&adev->vram_scratch.robj, NULL, NULL);
953+ amdgpu_bo_free_kernel(&adev->mem_scratch.robj, NULL, NULL);
953954 }
954955
955956 /**
@@ -2390,9 +2391,9 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev) · 1434 unmodified lines
23902391 if (amdgpu_sriov_vf(adev))
23912392 amdgpu_virt_exchange_data(adev);
23922393
2393− r = amdgpu_device_vram_scratch_init(adev);
2394+ r = amdgpu_device_mem_scratch_init(adev);
23942395 if (r) {
2395− DRM_ERROR("amdgpu_vram_scratch_init failed %d\n", r);
2396+ DRM_ERROR("amdgpu_mem_scratch_init failed %d\n", r);
23962397 goto init_failed;
23972398 }
23982399 r = adev->ip_blocks[i].version->funcs->hw_init((void *)adev);
@@ -2410,8 +2411,9 @@ static int amdgpu_device_ip_init(struct amdgpu_device *adev) · 11 unmodified lines
24102411 /* right after GMC hw init, we create CSA */
24112412 if (amdgpu_mcbp) {
24122413 r = amdgpu_allocate_static_csa(adev, &adev->virt.csa_obj,
2413− AMDGPU_GEM_DOMAIN_VRAM,
2414− AMDGPU_CSA_SIZE);
2414+ AMDGPU_GEM_DOMAIN_VRAM |
2415+ AMDGPU_GEM_DOMAIN_GTT,
2416+ AMDGPU_CSA_SIZE);
24152417 if (r) {
24162418 DRM_ERROR("allocate CSA failed %d\n", r);
24172419 goto init_failed;
@@ -2581,9 +2583,10 @@ int amdgpu_device_set_cg_state(struct amdgpu_device *adev, · 163 unmodified lines
25812583 i = state == AMD_CG_STATE_GATE ? j : adev->num_ip_blocks - j - 1;
25822584 if (!adev->ip_blocks[i].status.late_initialized)
25832585 continue;
2584− /* skip CG for GFX on S0ix */
2586+ /* skip CG for GFX, SDMA on S0ix */
25852587 if (adev->in_s0ix &&
2586− adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX)
2588+ (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX ||
2589+ adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SDMA))
25872590 continue;
25882591 /* skip CG for VCE/UVD, it's handled specially */
25892592 if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD &&
@@ -2617,9 +2620,10 @@ int amdgpu_device_set_pg_state(struct amdgpu_device *adev, · 27 unmodified lines
26172620 i = state == AMD_PG_STATE_GATE ? j : adev->num_ip_blocks - j - 1;
26182621 if (!adev->ip_blocks[i].status.late_initialized)
26192622 continue;
2620− /* skip PG for GFX on S0ix */
2623+ /* skip PG for GFX, SDMA on S0ix */
26212624 if (adev->in_s0ix &&
2622− adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX)
2625+ (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_GFX ||
2626+ adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SDMA))
26232627 continue;
26242628 /* skip CG for VCE/UVD, it's handled specially */
26252629 if (adev->ip_blocks[i].version->type != AMD_IP_BLOCK_TYPE_UVD &&
@@ -2871,7 +2875,7 @@ static int amdgpu_device_ip_fini(struct amdgpu_device *adev) · 245 unmodified lines
28712875 amdgpu_ucode_free_bo(adev);
28722876 amdgpu_free_static_csa(&adev->virt.csa_obj);
28732877 amdgpu_device_wb_fini(adev);
2874− amdgpu_device_vram_scratch_fini(adev);
2878+ amdgpu_device_mem_scratch_fini(adev);
28752879 amdgpu_ib_pool_fini(adev);
28762880 }
28772881
@@ -3027,6 +3031,12 @@ static int amdgpu_device_ip_suspend_phase2(struct amdgpu_device *adev) · 149 unmodified lines
30273031 adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_MES))
30283032 continue;
30293033
3034+ /* SDMA 5.x+ is part of GFX power domain so it's covered by GFXOFF */
3035+ if (adev->in_s0ix &&
3036+ (adev->ip_versions[SDMA0_HWIP][0] >= IP_VERSION(5, 0, 0)) &&
3037+ (adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SDMA))
3038+ continue;
3039+
30303040 /* XXX handle errors */
30313041 r = adev->ip_blocks[i].version->funcs->suspend(adev);
30323042 /* XXX handle errors */
@@ -3227,15 +3237,6 @@ static int amdgpu_device_ip_resume_phase2(struct amdgpu_device *adev) · 194 unmodified lines
32273237 return r;
32283238 }
32293239 adev->ip_blocks[i].status.hw = true;
3230−
3231− if (adev->in_s0ix && adev->ip_blocks[i].version->type == AMD_IP_BLOCK_TYPE_SMC) {
3232− /* disable gfxoff for IP resume. The gfxoff will be re-enabled in
3233− * amdgpu_device_resume() after IP resume.
3234− */
3235− amdgpu_gfx_off_ctrl(adev, false);
3236− DRM_DEBUG("will disable gfxoff for re-initializing other blocks\n");
3237− }
3238−
32393240 }
32403241
32413242 return 0;
@@ -4221,13 +4222,6 @@ exit: · 979 unmodified lines
42214222 /* Make sure IB tests flushed */
42224223 flush_delayed_work(&adev->delayed_init_work);
42234224
4224− if (adev->in_s0ix) {
4225− /* re-enable gfxoff after IP resume. This re-enables gfxoff after
4226− * it was disabled for IP resume in amdgpu_device_ip_resume_phase2().
4227− */
4228− amdgpu_gfx_off_ctrl(adev, true);
4229− DRM_DEBUG("will enable gfxoff for the mission mode\n");
4230− }
42314225 if (fbcon)
42324226 drm_fb_helper_set_suspend_unlocked(adev_to_drm(adev)->fb_helper, false);
42334227
@@ -4608,11 +4602,6 @@ bool amdgpu_device_should_recover_gpu(struct amdgpu_device *adev) · 374 unmodified lines
46084602 if (!amdgpu_ras_is_poison_mode_supported(adev))
46094603 return true;
46104604
4611− if (!amdgpu_device_ip_check_soft_reset(adev)) {
4612− dev_info(adev->dev,"Timeout, but no hardware hang detected.\n");
4613− return false;
4614− }
4615−
46164605 if (amdgpu_sriov_vf(adev))
46174606 return true;
46184607
@@ -4737,7 +4726,8 @@ int amdgpu_device_pre_asic_reset(struct amdgpu_device *adev, · 118 unmodified lines
47374726 if (!need_full_reset)
47384727 need_full_reset = amdgpu_device_ip_need_full_reset(adev);
47394728
4740− if (!need_full_reset && amdgpu_gpu_recovery) {
4729+ if (!need_full_reset && amdgpu_gpu_recovery &&
4730+ amdgpu_device_ip_check_soft_reset(adev)) {
47414731 amdgpu_device_ip_pre_soft_reset(adev);
47424732 r = amdgpu_device_ip_soft_reset(adev);
47434733 amdgpu_device_ip_post_soft_reset(adev);
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c+4−0
@@ -33,6 +33,7 @@ · 32 unmodified lines
3333 #include "gmc_v9_0.h"
3434 #include "df_v1_7.h"
3535 #include "df_v3_6.h"
36+#include "df_v4_3.h"
3637 #include "nbio_v6_1.h"
3738 #include "nbio_v7_0.h"
3839 #include "nbio_v7_4.h"
@@ -2329,6 +2330,9 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev) · 2290 unmodified lines
23292330 case IP_VERSION(3, 5, 2):
23302331 adev->df.funcs = &df_v1_7_funcs;
23312332 break;
2333+ case IP_VERSION(4, 3, 0):
2334+ adev->df.funcs = &df_v4_3_funcs;
2335+ break;
23322336 default:
23332337 break;
23342338 }
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c+1−1
@@ -63,7 +63,7 @@ · 62 unmodified lines
6363 void amdgpu_display_hotplug_work_func(struct work_struct *work)
6464 {
6565 struct amdgpu_device *adev = container_of(work, struct amdgpu_device,
66− hotplug_work);
66+ hotplug_work.work);
6767 struct drm_device *dev = adev_to_drm(adev);
6868 struct drm_mode_config *mode_config = &dev->mode_config;
6969 struct drm_connector *connector;
drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c+32−3
@@ -105,13 +105,15 @@ · 104 unmodified lines
105105 * - 3.46.0 - To enable hot plug amdgpu tests in libdrm
106106 * - 3.47.0 - Add AMDGPU_GEM_CREATE_DISCARDABLE and AMDGPU_VM_NOALLOC flags
107107 * - 3.48.0 - Add IP discovery version info to HW INFO
108− * 3.49.0 - Add gang submit into CS IOCTL
108+ * - 3.49.0 - Add gang submit into CS IOCTL
109+ * - 3.50.0 - Update AMDGPU_INFO_DEV_INFO IOCTL for minimum engine and memory clock
110+ * Update AMDGPU_INFO_SENSOR IOCTL for PEAK_PSTATE engine and memory clock
109111 */
110112 #define KMS_DRIVER_MAJOR 3
111−#define KMS_DRIVER_MINOR 49
113+#define KMS_DRIVER_MINOR 50
112114 #define KMS_DRIVER_PATCHLEVEL 0
113115
114−int amdgpu_vram_limit;
116+unsigned int amdgpu_vram_limit = UINT_MAX;
115117 int amdgpu_vis_vram_limit;
116118 int amdgpu_gart_size = -1; /* auto */
117119 int amdgpu_gtt_size = -1; /* auto */
@@ -181,6 +183,7 @@ int amdgpu_mes_kiq; · 63 unmodified lines
181183 int amdgpu_noretry = -1;
182184 int amdgpu_force_asic_type = -1;
183185 int amdgpu_tmz = -1; /* auto */
186+uint amdgpu_freesync_vid_mode;
184187 int amdgpu_reset_method = -1; /* auto */
185188 int amdgpu_num_kcq = -1;
186189 int amdgpu_smartshift_bias;
@@ -879,6 +882,32 @@ module_param_named(backlight, amdgpu_backlight, bint, 0444); · 692 unmodified lines
879882 MODULE_PARM_DESC(tmz, "Enable TMZ feature (-1 = auto (default), 0 = off, 1 = on)");
880883 module_param_named(tmz, amdgpu_tmz, int, 0444);
881884
885+/**
886+ * DOC: freesync_video (uint)
887+ * Enable the optimization to adjust front porch timing to achieve seamless
888+ * mode change experience when setting a freesync supported mode for which full
889+ * modeset is not needed.
890+ *
891+ * The Display Core will add a set of modes derived from the base FreeSync
892+ * video mode into the corresponding connector's mode list based on commonly
893+ * used refresh rates and VRR range of the connected display, when users enable
894+ * this feature. From the userspace perspective, they can see a seamless mode
895+ * change experience when the change between different refresh rates under the
896+ * same resolution. Additionally, userspace applications such as Video playback
897+ * can read this modeset list and change the refresh rate based on the video
898+ * frame rate. Finally, the userspace can also derive an appropriate mode for a
899+ * particular refresh rate based on the FreeSync Mode and add it to the
900+ * connector's mode list.
901+ *
902+ * Note: This is an experimental feature.
903+ *
904+ * The default value: 0 (off).
905+ */
906+MODULE_PARM_DESC(
907+ freesync_video,
908+ "Enable freesync modesetting optimization feature (0 = off (default), 1 = on)");
909+module_param_named(freesync_video, amdgpu_freesync_vid_mode, uint, 0444);
910+
882911 /**
883912 * DOC: reset_method (int)
884913 * GPU reset method (-1 = auto (default), 0 = legacy, 1 = mode0, 2 = mode1, 3 = mode2, 4 = baco)
drivers/gpu/drm/amd/amdgpu/amdgpu_gfx.c+5−2
@@ -372,8 +372,11 @@ int amdgpu_gfx_mqd_sw_init(struct amdgpu_device *adev, · 371 unmodified lines
372372 * KIQ MQD no matter SRIOV or Bare-metal
373373 */
374374 r = amdgpu_bo_create_kernel(adev, mqd_size, PAGE_SIZE,
375− AMDGPU_GEM_DOMAIN_VRAM, &ring->mqd_obj,
376− &ring->mqd_gpu_addr, &ring->mqd_ptr);
375+ AMDGPU_GEM_DOMAIN_VRAM |
376+ AMDGPU_GEM_DOMAIN_GTT,
377+ &ring->mqd_obj,
378+ &ring->mqd_gpu_addr,
379+ &ring->mqd_ptr);
377380 if (r) {
378381 dev_warn(adev->dev, "failed to create ring mqd ob (%d)", r);
379382 return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c+8−1
@@ -202,13 +202,20 @@ uint64_t amdgpu_gmc_agp_addr(struct ttm_buffer_object *bo) · 201 unmodified lines
202202 void amdgpu_gmc_vram_location(struct amdgpu_device *adev, struct amdgpu_gmc *mc,
203203 u64 base)
204204 {
205+ uint64_t vis_limit = (uint64_t)amdgpu_vis_vram_limit << 20;
205206 uint64_t limit = (uint64_t)amdgpu_vram_limit << 20;
206207
207208 mc->vram_start = base;
208209 mc->vram_end = mc->vram_start + mc->mc_vram_size - 1;
209− if (limit && limit < mc->real_vram_size)
210+ if (limit < mc->real_vram_size)
210211 mc->real_vram_size = limit;
211212
213+ if (vis_limit && vis_limit < mc->visible_vram_size)
214+ mc->visible_vram_size = vis_limit;
215+
216+ if (mc->real_vram_size < mc->visible_vram_size)
217+ mc->visible_vram_size = mc->real_vram_size;
218+
212219 if (mc->xgmi.num_physical_nodes == 0) {
213220 mc->fb_start = mc->vram_start;
214221 mc->fb_end = mc->vram_end;
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c+26−2
@@ -785,9 +785,15 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) · 784 unmodified lines
785785 if (adev->pm.dpm_enabled) {
786786 dev_info->max_engine_clock = amdgpu_dpm_get_sclk(adev, false) * 10;
787787 dev_info->max_memory_clock = amdgpu_dpm_get_mclk(adev, false) * 10;
788+ dev_info->min_engine_clock = amdgpu_dpm_get_sclk(adev, true) * 10;
789+ dev_info->min_memory_clock = amdgpu_dpm_get_mclk(adev, true) * 10;
788790 } else {
789− dev_info->max_engine_clock = adev->clock.default_sclk * 10;
790− dev_info->max_memory_clock = adev->clock.default_mclk * 10;
791+ dev_info->max_engine_clock =
792+ dev_info->min_engine_clock =
793+ adev->clock.default_sclk * 10;
794+ dev_info->max_memory_clock =
795+ dev_info->min_memory_clock =
796+ adev->clock.default_mclk * 10;
791797 }
792798 dev_info->enabled_rb_pipes_mask = adev->gfx.config.backend_enable_mask;
793799 dev_info->num_rb_pipes = adev->gfx.config.max_backends_per_se *
@@ -1014,6 +1020,24 @@ int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) · 220 unmodified lines
10141020 }
10151021 ui32 /= 100;
10161022 break;
1023+ case AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_SCLK:
1024+ /* get peak pstate sclk in Mhz */
1025+ if (amdgpu_dpm_read_sensor(adev,
1026+ AMDGPU_PP_SENSOR_PEAK_PSTATE_SCLK,
1027+ (void *)&ui32, &ui32_size)) {
1028+ return -EINVAL;
1029+ }
1030+ ui32 /= 100;
1031+ break;
1032+ case AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_MCLK:
1033+ /* get peak pstate mclk in Mhz */
1034+ if (amdgpu_dpm_read_sensor(adev,
1035+ AMDGPU_PP_SENSOR_PEAK_PSTATE_MCLK,
1036+ (void *)&ui32, &ui32_size)) {
1037+ return -EINVAL;
1038+ }
1039+ ui32 /= 100;
1040+ break;
10171041 default:
10181042 DRM_DEBUG_KMS("Invalid request %d\n",
10191043 info->sensor_info.type);
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h+1−0
@@ -534,6 +534,7 @@ struct amdgpu_connector { · 533 unmodified lines
534534 void *con_priv;
535535 bool dac_load_detect;
536536 bool detected_by_load; /* if the connection status was determined by load */
537+ bool detected_hpd_without_ddc; /* if an HPD signal was detected on DVI, but ddc probing failed */
537538 uint16_t connector_object_id;
538539 struct amdgpu_hpd hpd;
539540 struct amdgpu_router router;
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c+16−10
@@ -66,7 +66,8 @@ static int psp_ring_init(struct psp_context *psp, · 65 unmodified lines
6666 /* allocate 4k Page of Local Frame Buffer memory for ring */
6767 ring->ring_size = 0x1000;
6868 ret = amdgpu_bo_create_kernel(adev, ring->ring_size, PAGE_SIZE,
69− AMDGPU_GEM_DOMAIN_VRAM,
69+ AMDGPU_GEM_DOMAIN_VRAM |
70+ AMDGPU_GEM_DOMAIN_GTT,
7071 &adev->firmware.rbuf,
7172 &ring->ring_mem_mc_addr,
7273 (void **)&ring->ring_mem);
@@ -797,9 +798,13 @@ static int psp_tmr_init(struct psp_context *psp) · 724 unmodified lines
797798
798799 if (!psp->tmr_bo) {
799800 pptr = amdgpu_sriov_vf(psp->adev) ? &tmr_buf : NULL;
800− ret = amdgpu_bo_create_kernel(psp->adev, tmr_size, PSP_TMR_ALIGNMENT,
801− AMDGPU_GEM_DOMAIN_VRAM,
802− &psp->tmr_bo, &psp->tmr_mc_addr, pptr);
801+ ret = amdgpu_bo_create_kernel(psp->adev, tmr_size,
802+ PSP_TMR_ALIGNMENT,
803+ AMDGPU_HAS_VRAM(psp->adev) ?
804+ AMDGPU_GEM_DOMAIN_VRAM :
805+ AMDGPU_GEM_DOMAIN_GTT,
806+ &psp->tmr_bo, &psp->tmr_mc_addr,
807+ pptr);
803808 }
804809
805810 return ret;
@@ -1092,7 +1097,8 @@ int psp_ta_init_shared_buf(struct psp_context *psp, · 286 unmodified lines
10921097 * physical) for ta to host memory
10931098 */
10941099 return amdgpu_bo_create_kernel(psp->adev, mem_ctx->shared_mem_size,
1095− PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM,
1100+ PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM |
1101+ AMDGPU_GEM_DOMAIN_GTT,
10961102 &mem_ctx->shared_bo,
10971103 &mem_ctx->shared_mc_addr,
10981104 &mem_ctx->shared_buf);
@@ -1901,7 +1907,7 @@ out_unlock: · 802 unmodified lines
19011907 static int psp_securedisplay_initialize(struct psp_context *psp)
19021908 {
19031909 int ret;
1904− struct securedisplay_cmd *securedisplay_cmd;
1910+ struct ta_securedisplay_cmd *securedisplay_cmd;
19051911
19061912 /*
19071913 * TODO: bypass the initialize in sriov for now
@@ -3444,10 +3450,10 @@ static ssize_t psp_usbc_pd_fw_sysfs_write(struct device *dev, · 1536 unmodified lines
34443450
34453451 /* LFB address which is aligned to 1MB boundary per PSP request */
34463452 ret = amdgpu_bo_create_kernel(adev, usbc_pd_fw->size, 0x100000,
3447− AMDGPU_GEM_DOMAIN_VRAM,
3448− &fw_buf_bo,
3449− &fw_pri_mc_addr,
3450− &fw_pri_cpu_addr);
3453+ AMDGPU_GEM_DOMAIN_VRAM |
3454+ AMDGPU_GEM_DOMAIN_GTT,
3455+ &fw_buf_bo, &fw_pri_mc_addr,
3456+ &fw_pri_cpu_addr);
34513457 if (ret)
34523458 goto rel_buf;
34533459
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c+132−55
@@ -706,13 +706,23 @@ static int __amdgpu_ras_feature_enable(struct amdgpu_device *adev, · 705 unmodified lines
706706 return 0;
707707 }
708708
709+static int amdgpu_ras_check_feature_allowed(struct amdgpu_device *adev,
710+ struct ras_common_if *head)
711+{
712+ if (amdgpu_ras_is_feature_allowed(adev, head) ||
713+ amdgpu_ras_is_poison_mode_supported(adev))
714+ return 1;
715+ else
716+ return 0;
717+}
718+
709719 /* wrapper of psp_ras_enable_features */
710720 int amdgpu_ras_feature_enable(struct amdgpu_device *adev,
711721 struct ras_common_if *head, bool enable)
712722 {
713723 struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
714724 union ta_ras_cmd_input *info;
715− int ret;
725+ int ret = 0;
716726
717727 if (!con)
718728 return -EINVAL;
@@ -736,7 +746,8 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev, · 17 unmodified lines
736746 }
737747
738748 /* Do not enable if it is not allowed. */
739− WARN_ON(enable && !amdgpu_ras_is_feature_allowed(adev, head));
749+ if (enable && !amdgpu_ras_check_feature_allowed(adev, head))
750+ goto out;
740751
741752 /* Only enable ras feature operation handle on host side */
742753 if (head->block == AMDGPU_RAS_BLOCK__GFX &&
@@ -754,7 +765,6 @@ int amdgpu_ras_feature_enable(struct amdgpu_device *adev, · 11 unmodified lines
754765
755766 /* setup the obj */
756767 __amdgpu_ras_feature_enable(adev, head, enable);
757− ret = 0;
758768 out:
759769 if (head->block == AMDGPU_RAS_BLOCK__GFX)
760770 kfree(info);
@@ -1087,6 +1097,10 @@ int amdgpu_ras_error_inject(struct amdgpu_device *adev, · 326 unmodified lines
10871097 info->head.block,
10881098 info->head.sub_block_index);
10891099
1100+ /* inject on guest isn't allowed, return success directly */
1101+ if (amdgpu_sriov_vf(adev))
1102+ return 0;
1103+
10901104 if (!obj)
10911105 return -EINVAL;
10921106
@@ -1122,11 +1136,54 @@ int amdgpu_ras_error_inject(struct amdgpu_device *adev, · 29 unmodified lines
11221136 }
11231137
11241138 /**
1125− * amdgpu_ras_query_error_count -- Get error counts of all IPs
1139+ * amdgpu_ras_query_error_count_helper -- Get error counter for specific IP
1140+ * @adev: pointer to AMD GPU device
1141+ * @ce_count: pointer to an integer to be set to the count of correctible errors.
1142+ * @ue_count: pointer to an integer to be set to the count of uncorrectible errors.
1143+ * @query_info: pointer to ras_query_if
1144+ *
1145+ * Return 0 for query success or do nothing, otherwise return an error
1146+ * on failures
1147+ */
1148+static int amdgpu_ras_query_error_count_helper(struct amdgpu_device *adev,
1149+ unsigned long *ce_count,
1150+ unsigned long *ue_count,
1151+ struct ras_query_if *query_info)
1152+{
1153+ int ret;
1154+
1155+ if (!query_info)
1156+ /* do nothing if query_info is not specified */
1157+ return 0;
1158+
1159+ ret = amdgpu_ras_query_error_status(adev, query_info);
1160+ if (ret)
1161+ return ret;
1162+
1163+ *ce_count += query_info->ce_count;
1164+ *ue_count += query_info->ue_count;
1165+
1166+ /* some hardware/IP supports read to clear
1167+ * no need to explictly reset the err status after the query call */
1168+ if (adev->ip_versions[MP0_HWIP][0] != IP_VERSION(11, 0, 2) &&
1169+ adev->ip_versions[MP0_HWIP][0] != IP_VERSION(11, 0, 4)) {
1170+ if (amdgpu_ras_reset_error_status(adev, query_info->head.block))
1171+ dev_warn(adev->dev,
1172+ "Failed to reset error counter and error status\n");
1173+ }
1174+
1175+ return 0;
1176+}
1177+
1178+/**
1179+ * amdgpu_ras_query_error_count -- Get error counts of all IPs or specific IP
11261180 * @adev: pointer to AMD GPU device
11271181 * @ce_count: pointer to an integer to be set to the count of correctible errors.
11281182 * @ue_count: pointer to an integer to be set to the count of uncorrectible
11291183 * errors.
1184+ * @query_info: pointer to ras_query_if if the query request is only for
1185+ * specific ip block; if info is NULL, then the qurey request is for
1186+ * all the ip blocks that support query ras error counters/status
11301187 *
11311188 * If set, @ce_count or @ue_count, count and return the corresponding
11321189 * error counts in those integer pointers. Return 0 if the device
@@ -1134,11 +1191,13 @@ int amdgpu_ras_error_inject(struct amdgpu_device *adev, · 1 unmodified line
11341191 */
11351192 int amdgpu_ras_query_error_count(struct amdgpu_device *adev,
11361193 unsigned long *ce_count,
1137− unsigned long *ue_count)
1194+ unsigned long *ue_count,
1195+ struct ras_query_if *query_info)
11381196 {
11391197 struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
11401198 struct ras_manager *obj;
11411199 unsigned long ce, ue;
1200+ int ret;
11421201
11431202 if (!adev->ras_enabled || !con)
11441203 return -EOPNOTSUPP;
@@ -1150,26 +1209,23 @@ int amdgpu_ras_query_error_count(struct amdgpu_device *adev, · 5 unmodified lines
11501209
11511210 ce = 0;
11521211 ue = 0;
1153− list_for_each_entry(obj, &con->head, node) {
1154− struct ras_query_if info = {
1155− .head = obj->head,
1156− };
1157− int res;
1158−
1159− res = amdgpu_ras_query_error_status(adev, &info);
1160− if (res)
1161− return res;
1212+ if (!query_info) {
1213+ /* query all the ip blocks that support ras query interface */
1214+ list_for_each_entry(obj, &con->head, node) {
1215+ struct ras_query_if info = {
1216+ .head = obj->head,
1217+ };
11621218
1163− if (adev->ip_versions[MP0_HWIP][0] != IP_VERSION(11, 0, 2) &&
1164− adev->ip_versions[MP0_HWIP][0] != IP_VERSION(11, 0, 4)) {
1165− if (amdgpu_ras_reset_error_status(adev, info.head.block))
1166− dev_warn(adev->dev, "Failed to reset error counter and error status");
1219+ ret = amdgpu_ras_query_error_count_helper(adev, &ce, &ue, &info);
11671220 }
1168−
1169− ce += info.ce_count;
1170− ue += info.ue_count;
1221+ } else {
1222+ /* query specific ip block */
1223+ ret = amdgpu_ras_query_error_count_helper(adev, &ce, &ue, query_info);
11711224 }
11721225
1226+ if (ret)
1227+ return ret;
1228+
11731229 if (ce_count)
11741230 *ce_count = ce;
11751231
@@ -2344,22 +2400,24 @@ static void amdgpu_ras_check_supported(struct amdgpu_device *adev) · 1168 unmodified lines
23442400
23452401 if (amdgpu_atomfirmware_sram_ecc_supported(adev)) {
23462402 dev_info(adev->dev, "SRAM ECC is active.\n");
2347− if (!amdgpu_sriov_vf(adev)) {
2403+ if (!amdgpu_sriov_vf(adev))
23482404 adev->ras_hw_enabled |= ~(1 << AMDGPU_RAS_BLOCK__UMC |
23492405 1 << AMDGPU_RAS_BLOCK__DF);
2350−
2351− if (adev->ip_versions[VCN_HWIP][0] == IP_VERSION(2, 6, 0) ||
2352− adev->ip_versions[VCN_HWIP][0] == IP_VERSION(4, 0, 0))
2353− adev->ras_hw_enabled |= (1 << AMDGPU_RAS_BLOCK__VCN |
2354− 1 << AMDGPU_RAS_BLOCK__JPEG);
2355− else
2356− adev->ras_hw_enabled &= ~(1 << AMDGPU_RAS_BLOCK__VCN |
2357− 1 << AMDGPU_RAS_BLOCK__JPEG);
2358− } else {
2406+ else
23592407 adev->ras_hw_enabled |= (1 << AMDGPU_RAS_BLOCK__PCIE_BIF |
23602408 1 << AMDGPU_RAS_BLOCK__SDMA |
23612409 1 << AMDGPU_RAS_BLOCK__GFX);
2362− }
2410+
2411+ /* VCN/JPEG RAS can be supported on both bare metal and
2412+ * SRIOV environment
2413+ */
2414+ if (adev->ip_versions[VCN_HWIP][0] == IP_VERSION(2, 6, 0) ||
2415+ adev->ip_versions[VCN_HWIP][0] == IP_VERSION(4, 0, 0))
2416+ adev->ras_hw_enabled |= (1 << AMDGPU_RAS_BLOCK__VCN |
2417+ 1 << AMDGPU_RAS_BLOCK__JPEG);
2418+ else
2419+ adev->ras_hw_enabled &= ~(1 << AMDGPU_RAS_BLOCK__VCN |
2420+ 1 << AMDGPU_RAS_BLOCK__JPEG);
23632421 } else {
23642422 dev_info(adev->dev, "SRAM ECC is not presented.\n");
23652423 }
@@ -2395,7 +2453,7 @@ static void amdgpu_ras_counte_dw(struct work_struct *work) · 29 unmodified lines
23952453
23962454 /* Cache new values.
23972455 */
2398− if (amdgpu_ras_query_error_count(adev, &ce_count, &ue_count) == 0) {
2456+ if (amdgpu_ras_query_error_count(adev, &ce_count, &ue_count, NULL) == 0) {
23992457 atomic_set(&con->ras_ce_count, ce_count);
24002458 atomic_set(&con->ras_ue_count, ue_count);
24012459 }
@@ -2405,11 +2463,42 @@ Out: · 3 unmodified lines
24052463 pm_runtime_put_autosuspend(dev->dev);
24062464 }
24072465
2466+static void amdgpu_ras_query_poison_mode(struct amdgpu_device *adev)
2467+{
2468+ struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
2469+ bool df_poison, umc_poison;
2470+
2471+ /* poison setting is useless on SRIOV guest */
2472+ if (amdgpu_sriov_vf(adev) || !con)
2473+ return;
2474+
2475+ /* Init poison supported flag, the default value is false */
2476+ if (adev->gmc.xgmi.connected_to_cpu) {
2477+ /* enabled by default when GPU is connected to CPU */
2478+ con->poison_supported = true;
2479+ } else if (adev->df.funcs &&
2480+ adev->df.funcs->query_ras_poison_mode &&
2481+ adev->umc.ras &&
2482+ adev->umc.ras->query_ras_poison_mode) {
2483+ df_poison =
2484+ adev->df.funcs->query_ras_poison_mode(adev);
2485+ umc_poison =
2486+ adev->umc.ras->query_ras_poison_mode(adev);
2487+
2488+ /* Only poison is set in both DF and UMC, we can support it */
2489+ if (df_poison && umc_poison)
2490+ con->poison_supported = true;
2491+ else if (df_poison != umc_poison)
2492+ dev_warn(adev->dev,
2493+ "Poison setting is inconsistent in DF/UMC(%d:%d)!\n",
2494+ df_poison, umc_poison);
2495+ }
2496+}
2497+
24082498 int amdgpu_ras_init(struct amdgpu_device *adev)
24092499 {
24102500 struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
24112501 int r;
2412− bool df_poison, umc_poison;
24132502
24142503 if (con)
24152504 return 0;
@@ -2484,26 +2573,7 @@ int amdgpu_ras_init(struct amdgpu_device *adev) · 68 unmodified lines
24842573 goto release_con;
24852574 }
24862575
2487− /* Init poison supported flag, the default value is false */
2488− if (adev->gmc.xgmi.connected_to_cpu) {
2489− /* enabled by default when GPU is connected to CPU */
2490− con->poison_supported = true;
2491− }
2492− else if (adev->df.funcs &&
2493− adev->df.funcs->query_ras_poison_mode &&
2494− adev->umc.ras &&
2495− adev->umc.ras->query_ras_poison_mode) {
2496− df_poison =
2497− adev->df.funcs->query_ras_poison_mode(adev);
2498− umc_poison =
2499− adev->umc.ras->query_ras_poison_mode(adev);
2500− /* Only poison is set in both DF and UMC, we can support it */
2501− if (df_poison && umc_poison)
2502− con->poison_supported = true;
2503− else if (df_poison != umc_poison)
2504− dev_warn(adev->dev, "Poison setting is inconsistent in DF/UMC(%d:%d)!\n",
2505− df_poison, umc_poison);
2506− }
2576+ amdgpu_ras_query_poison_mode(adev);
25072577
25082578 if (amdgpu_ras_fs_init(adev)) {
25092579 r = -EINVAL;
@@ -2564,6 +2634,7 @@ int amdgpu_ras_block_late_init(struct amdgpu_device *adev, · 54 unmodified lines
25642634 {
25652635 struct amdgpu_ras_block_object *ras_obj = NULL;
25662636 struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
2637+ struct ras_query_if *query_info;
25672638 unsigned long ue_count, ce_count;
25682639 int r;
25692640
@@ -2605,11 +2676,17 @@ int amdgpu_ras_block_late_init(struct amdgpu_device *adev, · 35 unmodified lines
26052676
26062677 /* Those are the cached values at init.
26072678 */
2608− if (amdgpu_ras_query_error_count(adev, &ce_count, &ue_count) == 0) {
2679+ query_info = kzalloc(sizeof(struct ras_query_if), GFP_KERNEL);
2680+ if (!query_info)
2681+ return -ENOMEM;
2682+ memcpy(&query_info->head, ras_block, sizeof(struct ras_common_if));
2683+
2684+ if (amdgpu_ras_query_error_count(adev, &ce_count, &ue_count, query_info) == 0) {
26092685 atomic_set(&con->ras_ce_count, ce_count);
26102686 atomic_set(&con->ras_ue_count, ue_count);
26112687 }
26122688
2689+ kfree(query_info);
26132690 return 0;
26142691
26152692 interrupt:
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.h+2−1
@@ -540,7 +540,8 @@ void amdgpu_ras_suspend(struct amdgpu_device *adev); · 539 unmodified lines
540540
541541 int amdgpu_ras_query_error_count(struct amdgpu_device *adev,
542542 unsigned long *ce_count,
543− unsigned long *ue_count);
543+ unsigned long *ue_count,
544+ struct ras_query_if *query_info);
544545
545546 /* error handling functions */
546547 int amdgpu_ras_add_bad_pages(struct amdgpu_device *adev,
drivers/gpu/drm/amd/amdgpu/amdgpu_rlc.c+6−3
@@ -93,7 +93,8 @@ int amdgpu_gfx_rlc_init_sr(struct amdgpu_device *adev, u32 dws) · 92 unmodified lines
9393
9494 /* allocate save restore block */
9595 r = amdgpu_bo_create_reserved(adev, dws * 4, PAGE_SIZE,
96− AMDGPU_GEM_DOMAIN_VRAM,
96+ AMDGPU_GEM_DOMAIN_VRAM |
97+ AMDGPU_GEM_DOMAIN_GTT,
9798 &adev->gfx.rlc.save_restore_obj,
9899 &adev->gfx.rlc.save_restore_gpu_addr,
99100 (void **)&adev->gfx.rlc.sr_ptr);
@@ -130,7 +131,8 @@ int amdgpu_gfx_rlc_init_csb(struct amdgpu_device *adev) · 30 unmodified lines
130131 /* allocate clear state block */
131132 adev->gfx.rlc.clear_state_size = dws = adev->gfx.rlc.funcs->get_csb_size(adev);
132133 r = amdgpu_bo_create_kernel(adev, dws * 4, PAGE_SIZE,
133− AMDGPU_GEM_DOMAIN_VRAM,
134+ AMDGPU_GEM_DOMAIN_VRAM |
135+ AMDGPU_GEM_DOMAIN_GTT,
134136 &adev->gfx.rlc.clear_state_obj,
135137 &adev->gfx.rlc.clear_state_gpu_addr,
136138 (void **)&adev->gfx.rlc.cs_ptr);
@@ -156,7 +158,8 @@ int amdgpu_gfx_rlc_init_cpt(struct amdgpu_device *adev) · 19 unmodified lines
156158 int r;
157159
158160 r = amdgpu_bo_create_reserved(adev, adev->gfx.rlc.cp_table_size,
159− PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM,
161+ PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM |
162+ AMDGPU_GEM_DOMAIN_GTT,
160163 &adev->gfx.rlc.cp_table_obj,
161164 &adev->gfx.rlc.cp_table_gpu_addr,
162165 (void **)&adev->gfx.rlc.cp_table_ptr);
drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c+4−4
@@ -77,11 +77,11 @@ void psp_securedisplay_parse_resp_status(struct psp_context *psp, · 76 unmodified lines
7777 }
7878 }
7979
80−void psp_prep_securedisplay_cmd_buf(struct psp_context *psp, struct securedisplay_cmd **cmd,
80+void psp_prep_securedisplay_cmd_buf(struct psp_context *psp, struct ta_securedisplay_cmd **cmd,
8181 enum ta_securedisplay_command command_id)
8282 {
83− *cmd = (struct securedisplay_cmd *)psp->securedisplay_context.context.mem_context.shared_buf;
84− memset(*cmd, 0, sizeof(struct securedisplay_cmd));
83+ *cmd = (struct ta_securedisplay_cmd *)psp->securedisplay_context.context.mem_context.shared_buf;
84+ memset(*cmd, 0, sizeof(struct ta_securedisplay_cmd));
8585 (*cmd)->status = TA_SECUREDISPLAY_STATUS__GENERIC_FAILURE;
8686 (*cmd)->cmd_id = command_id;
8787 }
@@ -93,7 +93,7 @@ static ssize_t amdgpu_securedisplay_debugfs_write(struct file *f, const char __u · 5 unmodified lines
9393 {
9494 struct amdgpu_device *adev = (struct amdgpu_device *)file_inode(f)->i_private;
9595 struct psp_context *psp = &adev->psp;
96− struct securedisplay_cmd *securedisplay_cmd;
96+ struct ta_securedisplay_cmd *securedisplay_cmd;
9797 struct drm_device *dev = adev_to_drm(adev);
9898 uint32_t phy_id;
9999 uint32_t op;
drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.h+1−1
@@ -30,7 +30,7 @@ · 29 unmodified lines
3030 void amdgpu_securedisplay_debugfs_init(struct amdgpu_device *adev);
3131 void psp_securedisplay_parse_resp_status(struct psp_context *psp,
3232 enum ta_securedisplay_status status);
33−void psp_prep_securedisplay_cmd_buf(struct psp_context *psp, struct securedisplay_cmd **cmd,
33+void psp_prep_securedisplay_cmd_buf(struct psp_context *psp, struct ta_securedisplay_cmd **cmd,
3434 enum ta_securedisplay_command command_id);
3535
3636 #endif
drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c+8−15
@@ -1679,10 +1679,10 @@ static int amdgpu_ttm_reserve_tmr(struct amdgpu_device *adev) · 1678 unmodified lines
16791679 /* reserve vram for mem train according to TMR location */
16801680 amdgpu_ttm_training_data_block_init(adev);
16811681 ret = amdgpu_bo_create_kernel_at(adev,
1682− ctx->c2p_train_data_offset,
1683− ctx->train_data_size,
1684− &ctx->c2p_bo,
1685− NULL);
1682+ ctx->c2p_train_data_offset,
1683+ ctx->train_data_size,
1684+ &ctx->c2p_bo,
1685+ NULL);
16861686 if (ret) {
16871687 DRM_ERROR("alloc c2p_bo failed(%d)!\n", ret);
16881688 amdgpu_ttm_training_reserve_vram_fini(adev);
@@ -1692,10 +1692,10 @@ static int amdgpu_ttm_reserve_tmr(struct amdgpu_device *adev) · 3 unmodified lines
16921692 }
16931693
16941694 ret = amdgpu_bo_create_kernel_at(adev,
1695− adev->gmc.real_vram_size - adev->mman.discovery_tmr_size,
1696− adev->mman.discovery_tmr_size,
1697− &adev->mman.discovery_memory,
1698− NULL);
1695+ adev->gmc.real_vram_size - adev->mman.discovery_tmr_size,
1696+ adev->mman.discovery_tmr_size,
1697+ &adev->mman.discovery_memory,
1698+ NULL);
16991699 if (ret) {
17001700 DRM_ERROR("alloc tmr failed(%d)!\n", ret);
17011701 amdgpu_bo_free_kernel(&adev->mman.discovery_memory, NULL, NULL);
@@ -1718,7 +1718,6 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) · 16 unmodified lines
17181718 {
17191719 uint64_t gtt_size;
17201720 int r;
1721− u64 vis_vram_limit;
17221721
17231722 mutex_init(&adev->mman.gtt_window_lock);
17241723
@@ -1741,12 +1740,6 @@ int amdgpu_ttm_init(struct amdgpu_device *adev) · 16 unmodified lines
17411740 return r;
17421741 }
17431742
1744− /* Reduce size of CPU-visible VRAM if requested */
1745− vis_vram_limit = (u64)amdgpu_vis_vram_limit * 1024 * 1024;
1746− if (amdgpu_vis_vram_limit > 0 &&
1747− vis_vram_limit <= adev->gmc.visible_vram_size)
1748− adev->gmc.visible_vram_size = vis_vram_limit;
1749−
17501743 /* Change the size here instead of the init above so only lpfn is affected */
17511744 amdgpu_ttm_set_buffer_funcs_status(adev, false);
17521745 #ifdef CONFIG_64BIT
drivers/gpu/drm/amd/amdgpu/amdgpu_umc.c+26−18
@@ -169,25 +169,33 @@ int amdgpu_umc_poison_handler(struct amdgpu_device *adev, bool reset) · 168 unmodified lines
169169 {
170170 int ret = AMDGPU_RAS_SUCCESS;
171171
172− if (!adev->gmc.xgmi.connected_to_cpu) {
173− struct ras_err_data err_data = {0, 0, 0, NULL};
174− struct ras_common_if head = {
175− .block = AMDGPU_RAS_BLOCK__UMC,
176− };
177− struct ras_manager *obj = amdgpu_ras_find_obj(adev, &head);
178−
179− ret = amdgpu_umc_do_page_retirement(adev, &err_data, NULL, reset);
180−
181− if (ret == AMDGPU_RAS_SUCCESS && obj) {
182− obj->err_data.ue_count += err_data.ue_count;
183− obj->err_data.ce_count += err_data.ce_count;
172+ if (!amdgpu_sriov_vf(adev)) {
173+ if (!adev->gmc.xgmi.connected_to_cpu) {
174+ struct ras_err_data err_data = {0, 0, 0, NULL};
175+ struct ras_common_if head = {
176+ .block = AMDGPU_RAS_BLOCK__UMC,
177+ };
178+ struct ras_manager *obj = amdgpu_ras_find_obj(adev, &head);
179+
180+ ret = amdgpu_umc_do_page_retirement(adev, &err_data, NULL, reset);
181+
182+ if (ret == AMDGPU_RAS_SUCCESS && obj) {
183+ obj->err_data.ue_count += err_data.ue_count;
184+ obj->err_data.ce_count += err_data.ce_count;
185+ }
186+ } else if (reset) {
187+ /* MCA poison handler is only responsible for GPU reset,
188+ * let MCA notifier do page retirement.
189+ */
190+ kgd2kfd_set_sram_ecc_flag(adev->kfd.dev);
191+ amdgpu_ras_reset_gpu(adev);
184192 }
185− } else if (reset) {
186− /* MCA poison handler is only responsible for GPU reset,
187− * let MCA notifier do page retirement.
188− */
189− kgd2kfd_set_sram_ecc_flag(adev->kfd.dev);
190− amdgpu_ras_reset_gpu(adev);
193+ } else {
194+ if (adev->virt.ops && adev->virt.ops->ras_poison_handler)
195+ adev->virt.ops->ras_poison_handler(adev);
196+ else
197+ dev_warn(adev->dev,
198+ "No ras_poison_handler interface in SRIOV!\n");
191199 }
192200
193201 return ret;
drivers/gpu/drm/amd/amdgpu/amdgpu_uvd.c+5−2
@@ -331,8 +331,11 @@ int amdgpu_uvd_sw_init(struct amdgpu_device *adev) · 330 unmodified lines
331331 if (adev->uvd.harvest_config & (1 << j))
332332 continue;
333333 r = amdgpu_bo_create_kernel(adev, bo_size, PAGE_SIZE,
334− AMDGPU_GEM_DOMAIN_VRAM, &adev->uvd.inst[j].vcpu_bo,
335− &adev->uvd.inst[j].gpu_addr, &adev->uvd.inst[j].cpu_addr);
334+ AMDGPU_GEM_DOMAIN_VRAM |
335+ AMDGPU_GEM_DOMAIN_GTT,
336+ &adev->uvd.inst[j].vcpu_bo,
337+ &adev->uvd.inst[j].gpu_addr,
338+ &adev->uvd.inst[j].cpu_addr);
336339 if (r) {
337340 dev_err(adev->dev, "(%d) failed to allocate UVD bo\n", r);
338341 return r;
drivers/gpu/drm/amd/amdgpu/amdgpu_vce.c+3−1
@@ -186,7 +186,9 @@ int amdgpu_vce_sw_init(struct amdgpu_device *adev, unsigned long size) · 185 unmodified lines
186186 (binary_id << 8));
187187
188188 r = amdgpu_bo_create_kernel(adev, size, PAGE_SIZE,
189− AMDGPU_GEM_DOMAIN_VRAM, &adev->vce.vcpu_bo,
189+ AMDGPU_GEM_DOMAIN_VRAM |
190+ AMDGPU_GEM_DOMAIN_GTT,
191+ &adev->vce.vcpu_bo,
190192 &adev->vce.gpu_addr, &adev->vce.cpu_addr);
191193 if (r) {
192194 dev_err(adev->dev, "(%d) failed to allocate VCE bo\n", r);
drivers/gpu/drm/amd/amdgpu/amdgpu_vcn.c+20−6
@@ -274,8 +274,11 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) · 273 unmodified lines
274274 continue;
275275
276276 r = amdgpu_bo_create_kernel(adev, bo_size, PAGE_SIZE,
277− AMDGPU_GEM_DOMAIN_VRAM, &adev->vcn.inst[i].vcpu_bo,
278− &adev->vcn.inst[i].gpu_addr, &adev->vcn.inst[i].cpu_addr);
277+ AMDGPU_GEM_DOMAIN_VRAM |
278+ AMDGPU_GEM_DOMAIN_GTT,
279+ &adev->vcn.inst[i].vcpu_bo,
280+ &adev->vcn.inst[i].gpu_addr,
281+ &adev->vcn.inst[i].cpu_addr);
279282 if (r) {
280283 dev_err(adev->dev, "(%d) failed to allocate vcn bo\n", r);
281284 return r;
@@ -296,8 +299,11 @@ int amdgpu_vcn_sw_init(struct amdgpu_device *adev) · 14 unmodified lines
296299
297300 if (adev->vcn.indirect_sram) {
298301 r = amdgpu_bo_create_kernel(adev, 64 * 2 * 4, PAGE_SIZE,
299− AMDGPU_GEM_DOMAIN_VRAM, &adev->vcn.inst[i].dpg_sram_bo,
300− &adev->vcn.inst[i].dpg_sram_gpu_addr, &adev->vcn.inst[i].dpg_sram_cpu_addr);
302+ AMDGPU_GEM_DOMAIN_VRAM |
303+ AMDGPU_GEM_DOMAIN_GTT,
304+ &adev->vcn.inst[i].dpg_sram_bo,
305+ &adev->vcn.inst[i].dpg_sram_gpu_addr,
306+ &adev->vcn.inst[i].dpg_sram_cpu_addr);
301307 if (r) {
302308 dev_err(adev->dev, "VCN %d (%d) failed to allocate DPG bo\n", i, r);
303309 return r;
@@ -1250,8 +1256,16 @@ int amdgpu_vcn_process_poison_irq(struct amdgpu_device *adev, · 946 unmodified lines
12501256 if (!ras_if)
12511257 return 0;
12521258
1253− ih_data.head = *ras_if;
1254− amdgpu_ras_interrupt_dispatch(adev, &ih_data);
1259+ if (!amdgpu_sriov_vf(adev)) {
1260+ ih_data.head = *ras_if;
1261+ amdgpu_ras_interrupt_dispatch(adev, &ih_data);
1262+ } else {
1263+ if (adev->virt.ops && adev->virt.ops->ras_poison_handler)
1264+ adev->virt.ops->ras_poison_handler(adev);
1265+ else
1266+ dev_warn(adev->dev,
1267+ "No ras_poison_handler interface in SRIOV for VCN!\n");
1268+ }
12551269
12561270 return 0;
12571271 }
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.c+2−1
@@ -232,7 +232,8 @@ int amdgpu_virt_alloc_mm_table(struct amdgpu_device *adev) · 231 unmodified lines
232232 return 0;
233233
234234 r = amdgpu_bo_create_kernel(adev, PAGE_SIZE, PAGE_SIZE,
235− AMDGPU_GEM_DOMAIN_VRAM,
235+ AMDGPU_GEM_DOMAIN_VRAM |
236+ AMDGPU_GEM_DOMAIN_GTT,
236237 &adev->virt.mm_table.bo,
237238 &adev->virt.mm_table.gpu_addr,
238239 (void *)&adev->virt.mm_table.cpu_addr);
drivers/gpu/drm/amd/amdgpu/amdgpu_virt.h+1−0
@@ -88,6 +88,7 @@ struct amdgpu_virt_ops { · 87 unmodified lines
8888 int (*wait_reset)(struct amdgpu_device *adev);
8989 void (*trans_msg)(struct amdgpu_device *adev, enum idh_request req,
9090 u32 data1, u32 data2, u32 data3);
91+ void (*ras_poison_handler)(struct amdgpu_device *adev);
9192 };
9293
9394 /*
drivers/gpu/drm/amd/amdgpu/dce_v10_0.c+3−3
@@ -2837,7 +2837,7 @@ static int dce_v10_0_sw_init(void *handle) · 2836 unmodified lines
28372837 if (r)
28382838 return r;
28392839
2840− INIT_WORK(&adev->hotplug_work,
2840+ INIT_DELAYED_WORK(&adev->hotplug_work,
28412841 amdgpu_display_hotplug_work_func);
28422842
28432843 drm_kms_helper_poll_init(adev_to_drm(adev));
@@ -2902,7 +2902,7 @@ static int dce_v10_0_hw_fini(void *handle) · 58 unmodified lines
29022902
29032903 dce_v10_0_pageflip_interrupt_fini(adev);
29042904
2905− flush_work(&adev->hotplug_work);
2905+ flush_delayed_work(&adev->hotplug_work);
29062906
29072907 return 0;
29082908 }
@@ -3302,7 +3302,7 @@ static int dce_v10_0_hpd_irq(struct amdgpu_device *adev, · 393 unmodified lines
33023302
33033303 if (disp_int & mask) {
33043304 dce_v10_0_hpd_int_ack(adev, hpd);
3305− schedule_work(&adev->hotplug_work);
3305+ schedule_delayed_work(&adev->hotplug_work, 0);
33063306 DRM_DEBUG("IH: HPD%d\n", hpd + 1);
33073307 }
33083308
drivers/gpu/drm/amd/amdgpu/dce_v11_0.c+3−3
@@ -2956,7 +2956,7 @@ static int dce_v11_0_sw_init(void *handle) · 2955 unmodified lines
29562956 if (r)
29572957 return r;
29582958
2959− INIT_WORK(&adev->hotplug_work,
2959+ INIT_DELAYED_WORK(&adev->hotplug_work,
29602960 amdgpu_display_hotplug_work_func);
29612961
29622962 drm_kms_helper_poll_init(adev_to_drm(adev));
@@ -3032,7 +3032,7 @@ static int dce_v11_0_hw_fini(void *handle) · 69 unmodified lines
30323032
30333033 dce_v11_0_pageflip_interrupt_fini(adev);
30343034
3035− flush_work(&adev->hotplug_work);
3035+ flush_delayed_work(&adev->hotplug_work);
30363036
30373037 return 0;
30383038 }
@@ -3426,7 +3426,7 @@ static int dce_v11_0_hpd_irq(struct amdgpu_device *adev, · 387 unmodified lines
34263426
34273427 if (disp_int & mask) {
34283428 dce_v11_0_hpd_int_ack(adev, hpd);
3429− schedule_work(&adev->hotplug_work);
3429+ schedule_delayed_work(&adev->hotplug_work, 0);
34303430 DRM_DEBUG("IH: HPD%d\n", hpd + 1);
34313431 }
34323432
drivers/gpu/drm/amd/amdgpu/dce_v6_0.c+3−3
@@ -2715,7 +2715,7 @@ static int dce_v6_0_sw_init(void *handle) · 2714 unmodified lines
27152715 return r;
27162716
27172717 /* Pre-DCE11 */
2718− INIT_WORK(&adev->hotplug_work,
2718+ INIT_DELAYED_WORK(&adev->hotplug_work,
27192719 amdgpu_display_hotplug_work_func);
27202720
27212721 drm_kms_helper_poll_init(adev_to_drm(adev));
@@ -2776,7 +2776,7 @@ static int dce_v6_0_hw_fini(void *handle) · 54 unmodified lines
27762776
27772777 dce_v6_0_pageflip_interrupt_fini(adev);
27782778
2779− flush_work(&adev->hotplug_work);
2779+ flush_delayed_work(&adev->hotplug_work);
27802780
27812781 return 0;
27822782 }
@@ -3103,7 +3103,7 @@ static int dce_v6_0_hpd_irq(struct amdgpu_device *adev, · 320 unmodified lines
31033103 tmp = RREG32(mmDC_HPD1_INT_CONTROL + hpd_offsets[hpd]);
31043104 tmp |= DC_HPD1_INT_CONTROL__DC_HPD1_INT_ACK_MASK;
31053105 WREG32(mmDC_HPD1_INT_CONTROL + hpd_offsets[hpd], tmp);
3106− schedule_work(&adev->hotplug_work);
3106+ schedule_delayed_work(&adev->hotplug_work, 0);
31073107 DRM_DEBUG("IH: HPD%d\n", hpd + 1);
31083108 }
31093109
drivers/gpu/drm/amd/amdgpu/dce_v8_0.c+3−3
@@ -2739,7 +2739,7 @@ static int dce_v8_0_sw_init(void *handle) · 2738 unmodified lines
27392739 return r;
27402740
27412741 /* Pre-DCE11 */
2742− INIT_WORK(&adev->hotplug_work,
2742+ INIT_DELAYED_WORK(&adev->hotplug_work,
27432743 amdgpu_display_hotplug_work_func);
27442744
27452745 drm_kms_helper_poll_init(adev_to_drm(adev));
@@ -2802,7 +2802,7 @@ static int dce_v8_0_hw_fini(void *handle) · 56 unmodified lines
28022802
28032803 dce_v8_0_pageflip_interrupt_fini(adev);
28042804
2805− flush_work(&adev->hotplug_work);
2805+ flush_delayed_work(&adev->hotplug_work);
28062806
28072807 return 0;
28082808 }
@@ -3195,7 +3195,7 @@ static int dce_v8_0_hpd_irq(struct amdgpu_device *adev, · 386 unmodified lines
31953195 tmp = RREG32(mmDC_HPD1_INT_CONTROL + hpd_offsets[hpd]);
31963196 tmp |= DC_HPD1_INT_CONTROL__DC_HPD1_INT_ACK_MASK;
31973197 WREG32(mmDC_HPD1_INT_CONTROL + hpd_offsets[hpd], tmp);
3198− schedule_work(&adev->hotplug_work);
3198+ schedule_delayed_work(&adev->hotplug_work, 0);
31993199 DRM_DEBUG("IH: HPD%d\n", hpd + 1);
32003200 }
32013201
drivers/gpu/drm/amd/amdgpu/df_v4_3.c+61−0
@@ -0,0 +1,61 @@
1+/*
2+ * Copyright 2022 Advanced Micro Devices, Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in
12+ * all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+ * OTHER DEALINGS IN THE SOFTWARE.
21+ *
22+ */
23+#include "amdgpu.h"
24+#include "df_v4_3.h"
25+
26+#include "df/df_4_3_offset.h"
27+#include "df/df_4_3_sh_mask.h"
28+
29+static bool df_v4_3_query_ras_poison_mode(struct amdgpu_device *adev)
30+{
31+ uint32_t hw_assert_msklo, hw_assert_mskhi;
32+ uint32_t v0, v1, v28, v31;
33+
34+ hw_assert_msklo = RREG32_SOC15(DF, 0,
35+ regDF_CS_UMC_AON0_HardwareAssertMaskLow);
36+ hw_assert_mskhi = RREG32_SOC15(DF, 0,
37+ regDF_NCS_PG0_HardwareAssertMaskHigh);
38+
39+ v0 = REG_GET_FIELD(hw_assert_msklo,
40+ DF_CS_UMC_AON0_HardwareAssertMaskLow, HWAssertMsk0);
41+ v1 = REG_GET_FIELD(hw_assert_msklo,
42+ DF_CS_UMC_AON0_HardwareAssertMaskLow, HWAssertMsk1);
43+ v28 = REG_GET_FIELD(hw_assert_mskhi,
44+ DF_NCS_PG0_HardwareAssertMaskHigh, HWAssertMsk28);
45+ v31 = REG_GET_FIELD(hw_assert_mskhi,
46+ DF_NCS_PG0_HardwareAssertMaskHigh, HWAssertMsk31);
47+
48+ if (v0 && v1 && v28 && v31)
49+ return true;
50+ else if (!v0 && !v1 && !v28 && !v31)
51+ return false;
52+ else {
53+ dev_warn(adev->dev, "DF poison setting is inconsistent(%d:%d:%d:%d)!\n",
54+ v0, v1, v28, v31);
55+ return false;
56+ }
57+}
58+
59+const struct amdgpu_df_funcs df_v4_3_funcs = {
60+ .query_ras_poison_mode = df_v4_3_query_ras_poison_mode,
61+};
drivers/gpu/drm/amd/amdgpu/df_v4_3.h+31−0
@@ -0,0 +1,31 @@
1+/*
2+ * Copyright 2022 Advanced Micro Devices, Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included in
12+ * all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
18+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
19+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
20+ * OTHER DEALINGS IN THE SOFTWARE.
21+ *
22+ */
23+
24+#ifndef __DF_V4_3_H__
25+#define __DF_V4_3_H__
26+
27+#include "soc15_common.h"
28+
29+extern const struct amdgpu_df_funcs df_v4_3_funcs;
30+
31+#endif
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c+23−10
@@ -987,10 +987,11 @@ static int gfx_v11_0_rlc_autoload_buffer_init(struct amdgpu_device *adev) · 986 unmodified lines
987987 total_size = gfx_v11_0_calc_toc_total_size(adev);
988988
989989 r = amdgpu_bo_create_reserved(adev, total_size, 64 * 1024,
990− AMDGPU_GEM_DOMAIN_VRAM,
991− &adev->gfx.rlc.rlc_autoload_bo,
992− &adev->gfx.rlc.rlc_autoload_gpu_addr,
993− (void **)&adev->gfx.rlc.rlc_autoload_ptr);
990+ AMDGPU_GEM_DOMAIN_VRAM |
991+ AMDGPU_GEM_DOMAIN_GTT,
992+ &adev->gfx.rlc.rlc_autoload_bo,
993+ &adev->gfx.rlc.rlc_autoload_gpu_addr,
994+ (void **)&adev->gfx.rlc.rlc_autoload_ptr);
994995
995996 if (r) {
996997 dev_err(adev->dev, "(%d) failed to create fw autoload bo\n", r);
@@ -2649,7 +2650,9 @@ static int gfx_v11_0_cp_gfx_load_pfp_microcode_rs64(struct amdgpu_device *adev) · 1652 unmodified lines
26492650
26502651 /* 64kb align */
26512652 r = amdgpu_bo_create_reserved(adev, fw_ucode_size,
2652− 64 * 1024, AMDGPU_GEM_DOMAIN_VRAM,
2653+ 64 * 1024,
2654+ AMDGPU_GEM_DOMAIN_VRAM |
2655+ AMDGPU_GEM_DOMAIN_GTT,
26532656 &adev->gfx.pfp.pfp_fw_obj,
26542657 &adev->gfx.pfp.pfp_fw_gpu_addr,
26552658 (void **)&adev->gfx.pfp.pfp_fw_ptr);
@@ -2660,7 +2663,9 @@ static int gfx_v11_0_cp_gfx_load_pfp_microcode_rs64(struct amdgpu_device *adev) · 4 unmodified lines
26602663 }
26612664
26622665 r = amdgpu_bo_create_reserved(adev, fw_data_size,
2663− 64 * 1024, AMDGPU_GEM_DOMAIN_VRAM,
2666+ 64 * 1024,
2667+ AMDGPU_GEM_DOMAIN_VRAM |
2668+ AMDGPU_GEM_DOMAIN_GTT,
26642669 &adev->gfx.pfp.pfp_fw_data_obj,
26652670 &adev->gfx.pfp.pfp_fw_data_gpu_addr,
26662671 (void **)&adev->gfx.pfp.pfp_fw_data_ptr);
@@ -2863,7 +2868,9 @@ static int gfx_v11_0_cp_gfx_load_me_microcode_rs64(struct amdgpu_device *adev) · 196 unmodified lines
28632868
28642869 /* 64kb align*/
28652870 r = amdgpu_bo_create_reserved(adev, fw_ucode_size,
2866− 64 * 1024, AMDGPU_GEM_DOMAIN_VRAM,
2871+ 64 * 1024,
2872+ AMDGPU_GEM_DOMAIN_VRAM |
2873+ AMDGPU_GEM_DOMAIN_GTT,
28672874 &adev->gfx.me.me_fw_obj,
28682875 &adev->gfx.me.me_fw_gpu_addr,
28692876 (void **)&adev->gfx.me.me_fw_ptr);
@@ -2874,7 +2881,9 @@ static int gfx_v11_0_cp_gfx_load_me_microcode_rs64(struct amdgpu_device *adev) · 4 unmodified lines
28742881 }
28752882
28762883 r = amdgpu_bo_create_reserved(adev, fw_data_size,
2877− 64 * 1024, AMDGPU_GEM_DOMAIN_VRAM,
2884+ 64 * 1024,
2885+ AMDGPU_GEM_DOMAIN_VRAM |
2886+ AMDGPU_GEM_DOMAIN_GTT,
28782887 &adev->gfx.me.me_fw_data_obj,
28792888 &adev->gfx.me.me_fw_data_gpu_addr,
28802889 (void **)&adev->gfx.me.me_fw_data_ptr);
@@ -3380,7 +3389,9 @@ static int gfx_v11_0_cp_compute_load_microcode_rs64(struct amdgpu_device *adev) · 499 unmodified lines
33803389 fw_data_size = le32_to_cpu(mec_hdr->data_size_bytes);
33813390
33823391 r = amdgpu_bo_create_reserved(adev, fw_ucode_size,
3383− 64 * 1024, AMDGPU_GEM_DOMAIN_VRAM,
3392+ 64 * 1024,
3393+ AMDGPU_GEM_DOMAIN_VRAM |
3394+ AMDGPU_GEM_DOMAIN_GTT,
33843395 &adev->gfx.mec.mec_fw_obj,
33853396 &adev->gfx.mec.mec_fw_gpu_addr,
33863397 (void **)&fw_ucode_ptr);
@@ -3391,7 +3402,9 @@ static int gfx_v11_0_cp_compute_load_microcode_rs64(struct amdgpu_device *adev) · 4 unmodified lines
33913402 }
33923403
33933404 r = amdgpu_bo_create_reserved(adev, fw_data_size,
3394− 64 * 1024, AMDGPU_GEM_DOMAIN_VRAM,
3405+ 64 * 1024,
3406+ AMDGPU_GEM_DOMAIN_VRAM |
3407+ AMDGPU_GEM_DOMAIN_GTT,
33953408 &adev->gfx.mec.mec_fw_data_obj,
33963409 &adev->gfx.mec.mec_fw_data_gpu_addr,
33973410 (void **)&fw_data_ptr);
drivers/gpu/drm/amd/amdgpu/gfx_v6_0.c+2−1
@@ -2375,7 +2375,8 @@ static int gfx_v6_0_rlc_init(struct amdgpu_device *adev) · 2374 unmodified lines
23752375 dws = adev->gfx.rlc.clear_state_size + (256 / 4);
23762376
23772377 r = amdgpu_bo_create_reserved(adev, dws * 4, PAGE_SIZE,
2378− AMDGPU_GEM_DOMAIN_VRAM,
2378+ AMDGPU_GEM_DOMAIN_VRAM |
2379+ AMDGPU_GEM_DOMAIN_GTT,
23792380 &adev->gfx.rlc.clear_state_obj,
23802381 &adev->gfx.rlc.clear_state_gpu_addr,
23812382 (void **)&adev->gfx.rlc.cs_ptr);
drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c+2−1
@@ -2772,7 +2772,8 @@ static int gfx_v7_0_mec_init(struct amdgpu_device *adev) · 2771 unmodified lines
27722772 * GFX7_MEC_HPD_SIZE * 2;
27732773
27742774 r = amdgpu_bo_create_reserved(adev, mec_hpd_size, PAGE_SIZE,
2775− AMDGPU_GEM_DOMAIN_VRAM,
2775+ AMDGPU_GEM_DOMAIN_VRAM |
2776+ AMDGPU_GEM_DOMAIN_GTT,
27762777 &adev->gfx.mec.hpd_eop_obj,
27772778 &adev->gfx.mec.hpd_eop_gpu_addr,
27782779 (void **)&hpd);
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c+2−1
@@ -1340,7 +1340,8 @@ static int gfx_v8_0_mec_init(struct amdgpu_device *adev) · 1339 unmodified lines
13401340 mec_hpd_size = adev->gfx.num_compute_rings * GFX8_MEC_HPD_SIZE;
13411341 if (mec_hpd_size) {
13421342 r = amdgpu_bo_create_reserved(adev, mec_hpd_size, PAGE_SIZE,
1343− AMDGPU_GEM_DOMAIN_VRAM,
1343+ AMDGPU_GEM_DOMAIN_VRAM |
1344+ AMDGPU_GEM_DOMAIN_GTT,
13441345 &adev->gfx.mec.hpd_eop_obj,
13451346 &adev->gfx.mec.hpd_eop_gpu_addr,
13461347 (void **)&hpd);
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c+2−1
@@ -1783,7 +1783,8 @@ static int gfx_v9_0_mec_init(struct amdgpu_device *adev) · 1782 unmodified lines
17831783 mec_hpd_size = adev->gfx.num_compute_rings * GFX9_MEC_HPD_SIZE;
17841784 if (mec_hpd_size) {
17851785 r = amdgpu_bo_create_reserved(adev, mec_hpd_size, PAGE_SIZE,
1786− AMDGPU_GEM_DOMAIN_VRAM,
1786+ AMDGPU_GEM_DOMAIN_VRAM |
1787+ AMDGPU_GEM_DOMAIN_GTT,
17871788 &adev->gfx.mec.hpd_eop_obj,
17881789 &adev->gfx.mec.hpd_eop_gpu_addr,
17891790 (void **)&hpd);
drivers/gpu/drm/amd/amdgpu/gfxhub_v1_0.c+1−1
@@ -120,7 +120,7 @@ static void gfxhub_v1_0_init_system_aperture_regs(struct amdgpu_device *adev) · 119 unmodified lines
120120 max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18);
121121
122122 /* Set default page address. */
123− value = amdgpu_gmc_vram_mc2pa(adev, adev->vram_scratch.gpu_addr);
123+ value = amdgpu_gmc_vram_mc2pa(adev, adev->mem_scratch.gpu_addr);
124124 WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,
125125 (u32)(value >> 12));
126126 WREG32_SOC15(GC, 0, mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB,
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_0.c+1−1
@@ -165,7 +165,7 @@ static void gfxhub_v2_0_init_system_aperture_regs(struct amdgpu_device *adev) · 164 unmodified lines
165165 max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18);
166166
167167 /* Set default page address. */
168− value = amdgpu_gmc_vram_mc2pa(adev, adev->vram_scratch.gpu_addr);
168+ value = amdgpu_gmc_vram_mc2pa(adev, adev->mem_scratch.gpu_addr);
169169 WREG32_SOC15(GC, 0, mmGCMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,
170170 (u32)(value >> 12));
171171 WREG32_SOC15(GC, 0, mmGCMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB,
drivers/gpu/drm/amd/amdgpu/gfxhub_v2_1.c+1−1
@@ -167,7 +167,7 @@ static void gfxhub_v2_1_init_system_aperture_regs(struct amdgpu_device *adev) · 166 unmodified lines
167167 max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18);
168168
169169 /* Set default page address. */
170− value = amdgpu_gmc_vram_mc2pa(adev, adev->vram_scratch.gpu_addr);
170+ value = amdgpu_gmc_vram_mc2pa(adev, adev->mem_scratch.gpu_addr);
171171 WREG32_SOC15(GC, 0, mmGCMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,
172172 (u32)(value >> 12));
173173 WREG32_SOC15(GC, 0, mmGCMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB,
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0.c+1−1
@@ -163,7 +163,7 @@ static void gfxhub_v3_0_init_system_aperture_regs(struct amdgpu_device *adev) · 162 unmodified lines
163163 adev->gmc.vram_end >> 18);
164164
165165 /* Set default page address. */
166− value = adev->vram_scratch.gpu_addr - adev->gmc.vram_start
166+ value = adev->mem_scratch.gpu_addr - adev->gmc.vram_start
167167 + adev->vm_manager.vram_base_offset;
168168 WREG32_SOC15(GC, 0, regGCMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,
169169 (u32)(value >> 12));
drivers/gpu/drm/amd/amdgpu/gfxhub_v3_0_3.c+1−1
@@ -169,7 +169,7 @@ static void gfxhub_v3_0_3_init_system_aperture_regs(struct amdgpu_device *adev) · 168 unmodified lines
169169 adev->gmc.vram_end >> 18);
170170
171171 /* Set default page address. */
172− value = adev->vram_scratch.gpu_addr - adev->gmc.vram_start
172+ value = adev->mem_scratch.gpu_addr - adev->gmc.vram_start
173173 + adev->vm_manager.vram_base_offset;
174174 WREG32_SOC15(GC, 0, regGCMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,
175175 (u32)(value >> 12));
drivers/gpu/drm/amd/amdgpu/gmc_v10_0.c+27−12
@@ -78,13 +78,25 @@ gmc_v10_0_vm_fault_interrupt_state(struct amdgpu_device *adev, · 77 unmodified lines
7878 /* MM HUB */
7979 amdgpu_gmc_set_vm_fault_masks(adev, AMDGPU_MMHUB_0, false);
8080 /* GFX HUB */
81− amdgpu_gmc_set_vm_fault_masks(adev, AMDGPU_GFXHUB_0, false);
81+ /* This works because this interrupt is only
82+ * enabled at init/resume and disabled in
83+ * fini/suspend, so the overall state doesn't
84+ * change over the course of suspend/resume.
85+ */
86+ if (!adev->in_s0ix)
87+ amdgpu_gmc_set_vm_fault_masks(adev, AMDGPU_GFXHUB_0, false);
8288 break;
8389 case AMDGPU_IRQ_STATE_ENABLE:
8490 /* MM HUB */
8591 amdgpu_gmc_set_vm_fault_masks(adev, AMDGPU_MMHUB_0, true);
8692 /* GFX HUB */
87− amdgpu_gmc_set_vm_fault_masks(adev, AMDGPU_GFXHUB_0, true);
93+ /* This works because this interrupt is only
94+ * enabled at init/resume and disabled in
95+ * fini/suspend, so the overall state doesn't
96+ * change over the course of suspend/resume.
97+ */
98+ if (!adev->in_s0ix)
99+ amdgpu_gmc_set_vm_fault_masks(adev, AMDGPU_GFXHUB_0, true);
88100 break;
89101 default:
90102 break;
@@ -835,10 +847,7 @@ static int gmc_v10_0_mc_init(struct amdgpu_device *adev) · 744 unmodified lines
835847 }
836848 #endif
837849
838− /* In case the PCI BAR is larger than the actual amount of vram */
839850 adev->gmc.visible_vram_size = adev->gmc.aper_size;
840− if (adev->gmc.visible_vram_size > adev->gmc.real_vram_size)
841− adev->gmc.visible_vram_size = adev->gmc.real_vram_size;
842851
843852 /* set the gart size */
844853 if (amdgpu_gart_size == -1) {
@@ -1061,9 +1070,12 @@ static int gmc_v10_0_gart_enable(struct amdgpu_device *adev) · 216 unmodified lines
10611070 }
10621071
10631072 amdgpu_gtt_mgr_recover(&adev->mman.gtt_mgr);
1064− r = adev->gfxhub.funcs->gart_enable(adev);
1065− if (r)
1066− return r;
1073+
1074+ if (!adev->in_s0ix) {
1075+ r = adev->gfxhub.funcs->gart_enable(adev);
1076+ if (r)
1077+ return r;
1078+ }
10671079
10681080 r = adev->mmhub.funcs->gart_enable(adev);
10691081 if (r)
@@ -1077,10 +1089,12 @@ static int gmc_v10_0_gart_enable(struct amdgpu_device *adev) · 7 unmodified lines
10771089 value = (amdgpu_vm_fault_stop == AMDGPU_VM_FAULT_STOP_ALWAYS) ?
10781090 false : true;
10791091
1080− adev->gfxhub.funcs->set_fault_enable_default(adev, value);
1092+ if (!adev->in_s0ix)
1093+ adev->gfxhub.funcs->set_fault_enable_default(adev, value);
10811094 adev->mmhub.funcs->set_fault_enable_default(adev, value);
10821095 gmc_v10_0_flush_gpu_tlb(adev, 0, AMDGPU_MMHUB_0, 0);
1083− gmc_v10_0_flush_gpu_tlb(adev, 0, AMDGPU_GFXHUB_0, 0);
1096+ if (!adev->in_s0ix)
1097+ gmc_v10_0_flush_gpu_tlb(adev, 0, AMDGPU_GFXHUB_0, 0);
10841098
10851099 DRM_INFO("PCIE GART of %uM enabled (table at 0x%016llX).\n",
10861100 (unsigned)(adev->gmc.gart_size >> 20),
@@ -1101,7 +1115,7 @@ static int gmc_v10_0_hw_init(void *handle) · 14 unmodified lines
11011115 * harvestable groups in gc_utcl2 need to be programmed before any GFX block
11021116 * register setup within GMC, or else system hang when harvesting SA.
11031117 */
1104− if (adev->gfxhub.funcs && adev->gfxhub.funcs->utcl2_harvest)
1118+ if (!adev->in_s0ix && adev->gfxhub.funcs && adev->gfxhub.funcs->utcl2_harvest)
11051119 adev->gfxhub.funcs->utcl2_harvest(adev);
11061120
11071121 r = gmc_v10_0_gart_enable(adev);
@@ -1129,7 +1143,8 @@ static int gmc_v10_0_hw_init(void *handle) · 21 unmodified lines
11291143 */
11301144 static void gmc_v10_0_gart_disable(struct amdgpu_device *adev)
11311145 {
1132− adev->gfxhub.funcs->gart_disable(adev);
1146+ if (!adev->in_s0ix)
1147+ adev->gfxhub.funcs->gart_disable(adev);
11331148 adev->mmhub.funcs->gart_disable(adev);
11341149 }
11351150
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c+14−2
@@ -64,13 +64,25 @@ gmc_v11_0_vm_fault_interrupt_state(struct amdgpu_device *adev, · 63 unmodified lines
6464 /* MM HUB */
6565 amdgpu_gmc_set_vm_fault_masks(adev, AMDGPU_MMHUB_0, false);
6666 /* GFX HUB */
67− amdgpu_gmc_set_vm_fault_masks(adev, AMDGPU_GFXHUB_0, false);
67+ /* This works because this interrupt is only
68+ * enabled at init/resume and disabled in
69+ * fini/suspend, so the overall state doesn't
70+ * change over the course of suspend/resume.
71+ */
72+ if (!adev->in_s0ix)
73+ amdgpu_gmc_set_vm_fault_masks(adev, AMDGPU_GFXHUB_0, false);
6874 break;
6975 case AMDGPU_IRQ_STATE_ENABLE:
7076 /* MM HUB */
7177 amdgpu_gmc_set_vm_fault_masks(adev, AMDGPU_MMHUB_0, true);
7278 /* GFX HUB */
73− amdgpu_gmc_set_vm_fault_masks(adev, AMDGPU_GFXHUB_0, true);
79+ /* This works because this interrupt is only
80+ * enabled at init/resume and disabled in
81+ * fini/suspend, so the overall state doesn't
82+ * change over the course of suspend/resume.
83+ */
84+ if (!adev->in_s0ix)
85+ amdgpu_gmc_set_vm_fault_masks(adev, AMDGPU_GFXHUB_0, true);
7486 break;
7587 default:
7688 break;
drivers/gpu/drm/amd/amdgpu/gmc_v6_0.c+1−1
@@ -258,7 +258,7 @@ static void gmc_v6_0_mc_program(struct amdgpu_device *adev) · 257 unmodified lines
258258 WREG32(mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR,
259259 adev->gmc.vram_end >> 12);
260260 WREG32(mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR,
261− adev->vram_scratch.gpu_addr >> 12);
261+ adev->mem_scratch.gpu_addr >> 12);
262262 WREG32(mmMC_VM_AGP_BASE, 0);
263263 WREG32(mmMC_VM_AGP_TOP, 0x0FFFFFFF);
264264 WREG32(mmMC_VM_AGP_BOT, 0x0FFFFFFF);
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c+1−4
@@ -292,7 +292,7 @@ static void gmc_v7_0_mc_program(struct amdgpu_device *adev) · 291 unmodified lines
292292 WREG32(mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR,
293293 adev->gmc.vram_end >> 12);
294294 WREG32(mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR,
295− adev->vram_scratch.gpu_addr >> 12);
295+ adev->mem_scratch.gpu_addr >> 12);
296296 WREG32(mmMC_VM_AGP_BASE, 0);
297297 WREG32(mmMC_VM_AGP_TOP, 0x0FFFFFFF);
298298 WREG32(mmMC_VM_AGP_BOT, 0x0FFFFFFF);
@@ -389,10 +389,7 @@ static int gmc_v7_0_mc_init(struct amdgpu_device *adev) · 90 unmodified lines
389389 }
390390 #endif
391391
392− /* In case the PCI BAR is larger than the actual amount of vram */
393392 adev->gmc.visible_vram_size = adev->gmc.aper_size;
394− if (adev->gmc.visible_vram_size > adev->gmc.real_vram_size)
395− adev->gmc.visible_vram_size = adev->gmc.real_vram_size;
396393
397394 /* set the gart size */
398395 if (amdgpu_gart_size == -1) {
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c+1−4
@@ -474,7 +474,7 @@ static void gmc_v8_0_mc_program(struct amdgpu_device *adev) · 473 unmodified lines
474474 WREG32(mmMC_VM_SYSTEM_APERTURE_HIGH_ADDR,
475475 adev->gmc.vram_end >> 12);
476476 WREG32(mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR,
477− adev->vram_scratch.gpu_addr >> 12);
477+ adev->mem_scratch.gpu_addr >> 12);
478478
479479 if (amdgpu_sriov_vf(adev)) {
480480 tmp = ((adev->gmc.vram_end >> 24) & 0xFFFF) << 16;
@@ -587,10 +587,7 @@ static int gmc_v8_0_mc_init(struct amdgpu_device *adev) · 106 unmodified lines
587587 }
588588 #endif
589589
590− /* In case the PCI BAR is larger than the actual amount of vram */
591590 adev->gmc.visible_vram_size = adev->gmc.aper_size;
592− if (adev->gmc.visible_vram_size > adev->gmc.real_vram_size)
593− adev->gmc.visible_vram_size = adev->gmc.real_vram_size;
594591
595592 /* set the gart size */
596593 if (amdgpu_gart_size == -1) {
drivers/gpu/drm/amd/amdgpu/gmc_v9_0.c+30−9
@@ -484,6 +484,14 @@ static int gmc_v9_0_vm_fault_interrupt_state(struct amdgpu_device *adev, · 483 unmodified lines
484484 for (i = 0; i < 16; i++) {
485485 reg = hub->vm_context0_cntl + i;
486486
487+ /* This works because this interrupt is only
488+ * enabled at init/resume and disabled in
489+ * fini/suspend, so the overall state doesn't
490+ * change over the course of suspend/resume.
491+ */
492+ if (adev->in_s0ix && (j == AMDGPU_GFXHUB_0))
493+ continue;
494+
487495 if (j == AMDGPU_GFXHUB_0)
488496 tmp = RREG32_SOC15_IP(GC, reg);
489497 else
@@ -504,6 +512,14 @@ static int gmc_v9_0_vm_fault_interrupt_state(struct amdgpu_device *adev, · 14 unmodified lines
504512 for (i = 0; i < 16; i++) {
505513 reg = hub->vm_context0_cntl + i;
506514
515+ /* This works because this interrupt is only
516+ * enabled at init/resume and disabled in
517+ * fini/suspend, so the overall state doesn't
518+ * change over the course of suspend/resume.
519+ */
520+ if (adev->in_s0ix && (j == AMDGPU_GFXHUB_0))
521+ continue;
522+
507523 if (j == AMDGPU_GFXHUB_0)
508524 tmp = RREG32_SOC15_IP(GC, reg);
509525 else
@@ -1536,10 +1552,7 @@ static int gmc_v9_0_mc_init(struct amdgpu_device *adev) · 1026 unmodified lines
15361552 }
15371553
15381554 #endif
1539− /* In case the PCI BAR is larger than the actual amount of vram */
15401555 adev->gmc.visible_vram_size = adev->gmc.aper_size;
1541− if (adev->gmc.visible_vram_size > adev->gmc.real_vram_size)
1542− adev->gmc.visible_vram_size = adev->gmc.real_vram_size;
15431556
15441557 /* set the gart size */
15451558 if (amdgpu_gart_size == -1) {
@@ -1862,9 +1875,12 @@ static int gmc_v9_0_gart_enable(struct amdgpu_device *adev) · 316 unmodified lines
18621875 }
18631876
18641877 amdgpu_gtt_mgr_recover(&adev->mman.gtt_mgr);
1865− r = adev->gfxhub.funcs->gart_enable(adev);
1866− if (r)
1867− return r;
1878+
1879+ if (!adev->in_s0ix) {
1880+ r = adev->gfxhub.funcs->gart_enable(adev);
1881+ if (r)
1882+ return r;
1883+ }
18681884
18691885 r = adev->mmhub.funcs->gart_enable(adev);
18701886 if (r)
@@ -1911,11 +1927,15 @@ static int gmc_v9_0_hw_init(void *handle) · 40 unmodified lines
19111927 value = true;
19121928
19131929 if (!amdgpu_sriov_vf(adev)) {
1914− adev->gfxhub.funcs->set_fault_enable_default(adev, value);
1930+ if (!adev->in_s0ix)
1931+ adev->gfxhub.funcs->set_fault_enable_default(adev, value);
19151932 adev->mmhub.funcs->set_fault_enable_default(adev, value);
19161933 }
1917− for (i = 0; i < adev->num_vmhubs; ++i)
1934+ for (i = 0; i < adev->num_vmhubs; ++i) {
1935+ if (adev->in_s0ix && (i == AMDGPU_GFXHUB_0))
1936+ continue;
19181937 gmc_v9_0_flush_gpu_tlb(adev, 0, i, 0);
1938+ }
19191939
19201940 if (adev->umc.funcs && adev->umc.funcs->init_registers)
19211941 adev->umc.funcs->init_registers(adev);
@@ -1939,7 +1959,8 @@ static int gmc_v9_0_hw_init(void *handle) · 17 unmodified lines
19391959 */
19401960 static void gmc_v9_0_gart_disable(struct amdgpu_device *adev)
19411961 {
1942− adev->gfxhub.funcs->gart_disable(adev);
1962+ if (!adev->in_s0ix)
1963+ adev->gfxhub.funcs->gart_disable(adev);
19431964 adev->mmhub.funcs->gart_disable(adev);
19441965 }
19451966
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c+6−2
@@ -549,7 +549,9 @@ static int mes_v11_0_allocate_ucode_buffer(struct amdgpu_device *adev, · 548 unmodified lines
549549 fw_size = le32_to_cpu(mes_hdr->mes_ucode_size_bytes);
550550
551551 r = amdgpu_bo_create_reserved(adev, fw_size,
552− PAGE_SIZE, AMDGPU_GEM_DOMAIN_VRAM,
552+ PAGE_SIZE,
553+ AMDGPU_GEM_DOMAIN_VRAM |
554+ AMDGPU_GEM_DOMAIN_GTT,
553555 &adev->mes.ucode_fw_obj[pipe],
554556 &adev->mes.ucode_fw_gpu_addr[pipe],
555557 (void **)&adev->mes.ucode_fw_ptr[pipe]);
@@ -582,7 +584,9 @@ static int mes_v11_0_allocate_ucode_data_buffer(struct amdgpu_device *adev, · 26 unmodified lines
582584 fw_size = le32_to_cpu(mes_hdr->mes_ucode_data_size_bytes);
583585
584586 r = amdgpu_bo_create_reserved(adev, fw_size,
585− 64 * 1024, AMDGPU_GEM_DOMAIN_VRAM,
587+ 64 * 1024,
588+ AMDGPU_GEM_DOMAIN_VRAM |
589+ AMDGPU_GEM_DOMAIN_GTT,
586590 &adev->mes.data_fw_obj[pipe],
587591 &adev->mes.data_fw_gpu_addr[pipe],
588592 (void **)&adev->mes.data_fw_ptr[pipe]);
drivers/gpu/drm/amd/amdgpu/mmhub_v1_0.c+1−1
@@ -114,7 +114,7 @@ static void mmhub_v1_0_init_system_aperture_regs(struct amdgpu_device *adev) · 113 unmodified lines
114114 return;
115115
116116 /* Set default page address. */
117− value = amdgpu_gmc_vram_mc2pa(adev, adev->vram_scratch.gpu_addr);
117+ value = amdgpu_gmc_vram_mc2pa(adev, adev->mem_scratch.gpu_addr);
118118 WREG32_SOC15(MMHUB, 0, mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,
119119 (u32)(value >> 12));
120120 WREG32_SOC15(MMHUB, 0, mmMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB,
drivers/gpu/drm/amd/amdgpu/mmhub_v1_7.c+1−1
@@ -134,7 +134,7 @@ static void mmhub_v1_7_init_system_aperture_regs(struct amdgpu_device *adev) · 133 unmodified lines
134134 }
135135
136136 /* Set default page address. */
137− value = amdgpu_gmc_vram_mc2pa(adev, adev->vram_scratch.gpu_addr);
137+ value = amdgpu_gmc_vram_mc2pa(adev, adev->mem_scratch.gpu_addr);
138138 WREG32_SOC15(MMHUB, 0, regMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,
139139 (u32)(value >> 12));
140140 WREG32_SOC15(MMHUB, 0, regMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB,
drivers/gpu/drm/amd/amdgpu/mmhub_v2_0.c+1−1
@@ -234,7 +234,7 @@ static void mmhub_v2_0_init_system_aperture_regs(struct amdgpu_device *adev) · 233 unmodified lines
234234 }
235235
236236 /* Set default page address. */
237− value = amdgpu_gmc_vram_mc2pa(adev, adev->vram_scratch.gpu_addr);
237+ value = amdgpu_gmc_vram_mc2pa(adev, adev->mem_scratch.gpu_addr);
238238 WREG32_SOC15(MMHUB, 0, mmMMMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,
239239 (u32)(value >> 12));
240240 WREG32_SOC15(MMHUB, 0, mmMMMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB,
drivers/gpu/drm/amd/amdgpu/mmhub_v2_3.c+1−1
@@ -164,7 +164,7 @@ static void mmhub_v2_3_init_system_aperture_regs(struct amdgpu_device *adev) · 163 unmodified lines
164164 max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18);
165165
166166 /* Set default page address. */
167− value = amdgpu_gmc_vram_mc2pa(adev, adev->vram_scratch.gpu_addr);
167+ value = amdgpu_gmc_vram_mc2pa(adev, adev->mem_scratch.gpu_addr);
168168 WREG32_SOC15(MMHUB, 0, mmMMMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,
169169 (u32)(value >> 12));
170170 WREG32_SOC15(MMHUB, 0, mmMMMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_MSB,
drivers/gpu/drm/amd/amdgpu/mmhub_v3_0.c+1−1
@@ -188,7 +188,7 @@ static void mmhub_v3_0_init_system_aperture_regs(struct amdgpu_device *adev) · 187 unmodified lines
188188 }
189189
190190 /* Set default page address. */
191− value = adev->vram_scratch.gpu_addr - adev->gmc.vram_start +
191+ value = adev->mem_scratch.gpu_addr - adev->gmc.vram_start +
192192 adev->vm_manager.vram_base_offset;
193193 WREG32_SOC15(MMHUB, 0, regMMMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,
194194 (u32)(value >> 12));
drivers/gpu/drm/amd/amdgpu/mmhub_v3_0_1.c+1−1
@@ -188,7 +188,7 @@ static void mmhub_v3_0_1_init_system_aperture_regs(struct amdgpu_device *adev) · 187 unmodified lines
188188 adev->gmc.vram_end >> 18);
189189
190190 /* Set default page address. */
191− value = adev->vram_scratch.gpu_addr - adev->gmc.vram_start +
191+ value = adev->mem_scratch.gpu_addr - adev->gmc.vram_start +
192192 adev->vm_manager.vram_base_offset;
193193 WREG32_SOC15(MMHUB, 0, regMMMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,
194194 (u32)(value >> 12));
drivers/gpu/drm/amd/amdgpu/mmhub_v3_0_2.c+1−1
@@ -181,7 +181,7 @@ static void mmhub_v3_0_2_init_system_aperture_regs(struct amdgpu_device *adev) · 180 unmodified lines
181181 }
182182
183183 /* Set default page address. */
184− value = adev->vram_scratch.gpu_addr - adev->gmc.vram_start +
184+ value = adev->mem_scratch.gpu_addr - adev->gmc.vram_start +
185185 adev->vm_manager.vram_base_offset;
186186 WREG32_SOC15(MMHUB, 0, regMMMC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,
187187 (u32)(value >> 12));
drivers/gpu/drm/amd/amdgpu/mmhub_v9_4.c+1−1
@@ -136,7 +136,7 @@ static void mmhub_v9_4_init_system_aperture_regs(struct amdgpu_device *adev, · 135 unmodified lines
136136 max(adev->gmc.fb_end, adev->gmc.agp_end) >> 18);
137137
138138 /* Set default page address. */
139− value = amdgpu_gmc_vram_mc2pa(adev, adev->vram_scratch.gpu_addr);
139+ value = amdgpu_gmc_vram_mc2pa(adev, adev->mem_scratch.gpu_addr);
140140 WREG32_SOC15_OFFSET(
141141 MMHUB, 0,
142142 mmVMSHAREDPF0_MC_VM_SYSTEM_APERTURE_DEFAULT_ADDR_LSB,
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.c+6−0
@@ -404,6 +404,11 @@ static int xgpu_ai_request_init_data(struct amdgpu_device *adev) · 403 unmodified lines
404404 return xgpu_ai_send_access_requests(adev, IDH_REQ_GPU_INIT_DATA);
405405 }
406406
407+static void xgpu_ai_ras_poison_handler(struct amdgpu_device *adev)
408+{
409+ xgpu_ai_send_access_requests(adev, IDH_RAS_POISON);
410+}
411+
407412 const struct amdgpu_virt_ops xgpu_ai_virt_ops = {
408413 .req_full_gpu = xgpu_ai_request_full_gpu_access,
409414 .rel_full_gpu = xgpu_ai_release_full_gpu_access,
@@ -411,4 +416,5 @@ const struct amdgpu_virt_ops xgpu_ai_virt_ops = { · 1 unmodified line
411416 .wait_reset = NULL,
412417 .trans_msg = xgpu_ai_mailbox_trans_msg,
413418 .req_init_data = xgpu_ai_request_init_data,
419+ .ras_poison_handler = xgpu_ai_ras_poison_handler,
414420 };
drivers/gpu/drm/amd/amdgpu/mxgpu_ai.h+1−0
@@ -39,6 +39,7 @@ enum idh_request { · 38 unmodified lines
3939
4040 IDH_LOG_VF_ERROR = 200,
4141 IDH_READY_TO_RESET = 201,
42+ IDH_RAS_POISON = 202,
4243 };
4344
4445 enum idh_event {
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.c+6−0
@@ -426,6 +426,11 @@ void xgpu_nv_mailbox_put_irq(struct amdgpu_device *adev) · 425 unmodified lines
426426 amdgpu_irq_put(adev, &adev->virt.rcv_irq, 0);
427427 }
428428
429+static void xgpu_nv_ras_poison_handler(struct amdgpu_device *adev)
430+{
431+ xgpu_nv_send_access_requests(adev, IDH_RAS_POISON);
432+}
433+
429434 const struct amdgpu_virt_ops xgpu_nv_virt_ops = {
430435 .req_full_gpu = xgpu_nv_request_full_gpu_access,
431436 .rel_full_gpu = xgpu_nv_release_full_gpu_access,
@@ -433,4 +438,5 @@ const struct amdgpu_virt_ops xgpu_nv_virt_ops = { · 1 unmodified line
433438 .reset_gpu = xgpu_nv_request_reset,
434439 .wait_reset = NULL,
435440 .trans_msg = xgpu_nv_mailbox_trans_msg,
441+ .ras_poison_handler = xgpu_nv_ras_poison_handler,
436442 };
drivers/gpu/drm/amd/amdgpu/mxgpu_nv.h+1−0
@@ -39,6 +39,7 @@ enum idh_request { · 38 unmodified lines
3939
4040 IDH_LOG_VF_ERROR = 200,
4141 IDH_READY_TO_RESET = 201,
42+ IDH_RAS_POISON = 202,
4243 };
4344
4445 enum idh_event {
drivers/gpu/drm/amd/amdgpu/sdma_v5_2.c+0−8
@@ -809,12 +809,6 @@ static int sdma_v5_2_start(struct amdgpu_device *adev) · 808 unmodified lines
809809 msleep(1000);
810810 }
811811
812− /* TODO: check whether can submit a doorbell request to raise
813− * a doorbell fence to exit gfxoff.
814− */
815− if (adev->in_s0ix)
816− amdgpu_gfx_off_ctrl(adev, false);
817−
818812 sdma_v5_2_soft_reset(adev);
819813 /* unhalt the MEs */
820814 sdma_v5_2_enable(adev, true);
@@ -823,8 +817,6 @@ static int sdma_v5_2_start(struct amdgpu_device *adev) · 2 unmodified lines
823817
824818 /* start the gfx rings and rlc compute queues */
825819 r = sdma_v5_2_gfx_resume(adev);
826− if (adev->in_s0ix)
827− amdgpu_gfx_off_ctrl(adev, true);
828820 if (r)
829821 return r;
830822 r = sdma_v5_2_rlc_resume(adev);
drivers/gpu/drm/amd/amdgpu/ta_secureDisplay_if.h+12−12
@@ -55,10 +55,10 @@ enum ta_securedisplay_status { · 54 unmodified lines
5555 TA_SECUREDISPLAY_STATUS__MAX = 0x7FFFFFFF,/* Maximum Value for status*/
5656 };
5757
58−/** @enum ta_securedisplay_max_phy
58+/** @enum ta_securedisplay_phy_ID
5959 * Physical ID number to use for reading corresponding DIO Scratch register for ROI
6060 */
61−enum ta_securedisplay_max_phy {
61+enum ta_securedisplay_phy_ID {
6262 TA_SECUREDISPLAY_PHY0 = 0,
6363 TA_SECUREDISPLAY_PHY1 = 1,
6464 TA_SECUREDISPLAY_PHY2 = 2,
@@ -139,16 +139,16 @@ union ta_securedisplay_cmd_output { · 74 unmodified lines
139139 uint32_t reserved[4];
140140 };
141141
142−/** @struct securedisplay_cmd
143− * Secure Display Command which is shared buffer memory
144− */
145−struct securedisplay_cmd {
146− uint32_t cmd_id; /* +0 Bytes Command ID */
147− enum ta_securedisplay_status status; /* +4 Bytes Status of Secure Display TA */
148− uint32_t reserved[2]; /* +8 Bytes Reserved */
149− union ta_securedisplay_cmd_input securedisplay_in_message; /* +16 Bytes Input Buffer */
150− union ta_securedisplay_cmd_output securedisplay_out_message;/* +32 Bytes Output Buffer */
151− /**@note Total 48 Bytes */
142+/** @struct ta_securedisplay_cmd
143+* Secure display command which is shared buffer memory
144+*/
145+struct ta_securedisplay_cmd {
146+ uint32_t cmd_id; /**< +0 Bytes Command ID */
147+ enum ta_securedisplay_status status; /**< +4 Bytes Status code returned by the secure display TA */
148+ uint32_t reserved[2]; /**< +8 Bytes Reserved */
149+ union ta_securedisplay_cmd_input securedisplay_in_message; /**< +16 Bytes Command input buffer */
150+ union ta_securedisplay_cmd_output securedisplay_out_message; /**< +32 Bytes Command output buffer */
151+ /**@note Total 48 Bytes */
152152 };
153153
154154 #endif //_TA_SECUREDISPLAY_IF_H
drivers/gpu/drm/amd/amdgpu/umc_v8_10.c+4−20
@@ -340,29 +340,13 @@ static void umc_v8_10_err_cnt_init(struct amdgpu_device *adev) · 339 unmodified lines
340340 }
341341 }
342342
343−static uint32_t umc_v8_10_query_ras_poison_mode_per_channel(
344− struct amdgpu_device *adev,
345− uint32_t umc_reg_offset)
346−{
347− uint32_t ecc_ctrl_addr, ecc_ctrl;
348−
349− ecc_ctrl_addr =
350− SOC15_REG_OFFSET(UMC, 0, regUMCCH0_0_GeccCtrl);
351− ecc_ctrl = RREG32_PCIE((ecc_ctrl_addr +
352− umc_reg_offset) * 4);
353−
354− return REG_GET_FIELD(ecc_ctrl, UMCCH0_0_GeccCtrl, UCFatalEn);
355−}
356−
357343 static bool umc_v8_10_query_ras_poison_mode(struct amdgpu_device *adev)
358344 {
359− uint32_t umc_reg_offset = 0;
360−
361− /* Enabling fatal error in umc node0 instance0 channel0 will be
362− * considered as fatal error mode
345+ /*
346+ * Force return true, because UMCCH0_0_GeccCtrl
347+ * is not accessible from host side
363348 */
364− umc_reg_offset = get_umc_v8_10_reg_offset(adev, 0, 0, 0);
365− return !umc_v8_10_query_ras_poison_mode_per_channel(adev, umc_reg_offset);
349+ return true;
366350 }
367351
368352 const struct amdgpu_ras_block_hw_ops umc_v8_10_ras_hw_ops = {
drivers/gpu/drm/amd/amdkfd/kfd_device.c+0−11
@@ -262,23 +262,12 @@ struct kfd_dev *kgd2kfd_probe(struct amdgpu_device *adev, bool vf) · 261 unmodified lines
262262 f2g = &gfx_v8_kfd2kgd;
263263 break;
264264 case CHIP_FIJI:
265− gfx_target_version = 80003;
266− f2g = &gfx_v8_kfd2kgd;
267− break;
268265 case CHIP_POLARIS10:
269266 gfx_target_version = 80003;
270267 f2g = &gfx_v8_kfd2kgd;
271268 break;
272269 case CHIP_POLARIS11:
273− gfx_target_version = 80003;
274− if (!vf)
275− f2g = &gfx_v8_kfd2kgd;
276− break;
277270 case CHIP_POLARIS12:
278− gfx_target_version = 80003;
279− if (!vf)
280− f2g = &gfx_v8_kfd2kgd;
281− break;
282271 case CHIP_VEGAM:
283272 gfx_target_version = 80003;
284273 if (!vf)
drivers/gpu/drm/amd/amdkfd/kfd_topology.c+1−1
@@ -801,7 +801,7 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev, · 800 unmodified lines
801801
802802 p2plink->attr.name = "properties";
803803 p2plink->attr.mode = KFD_SYSFS_FILE_MODE;
804− sysfs_attr_init(&iolink->attr);
804+ sysfs_attr_init(&p2plink->attr);
805805 ret = sysfs_create_file(p2plink->kobj, &p2plink->attr);
806806 if (ret < 0)
807807 return ret;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+252−112
@@ -210,7 +210,7 @@ static void amdgpu_dm_destroy_drm_device(struct amdgpu_display_manager *dm); · 209 unmodified lines
210210
211211 static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm,
212212 struct amdgpu_dm_connector *amdgpu_dm_connector,
213− uint32_t link_index,
213+ u32 link_index,
214214 struct amdgpu_encoder *amdgpu_encoder);
215215 static int amdgpu_dm_encoder_init(struct drm_device *dev,
216216 struct amdgpu_encoder *aencoder,
@@ -262,7 +262,7 @@ static u32 dm_vblank_get_counter(struct amdgpu_device *adev, int crtc) · 45 unmodified lines
262262 static int dm_crtc_get_scanoutpos(struct amdgpu_device *adev, int crtc,
263263 u32 *vbl, u32 *position)
264264 {
265− uint32_t v_blank_start, v_blank_end, h_position, v_position;
265+ u32 v_blank_start, v_blank_end, h_position, v_position;
266266
267267 if ((crtc < 0) || (crtc >= adev->mode_info.num_crtc))
268268 return -EINVAL;
@@ -361,7 +361,7 @@ static void dm_pflip_high_irq(void *interrupt_params) · 92 unmodified lines
361361 struct amdgpu_device *adev = irq_params->adev;
362362 unsigned long flags;
363363 struct drm_pending_vblank_event *e;
364− uint32_t vpos, hpos, v_blank_start, v_blank_end;
364+ u32 vpos, hpos, v_blank_start, v_blank_end;
365365 bool vrr_active;
366366
367367 amdgpu_crtc = get_crtc_by_otg_inst(adev, irq_params->irq_src - IRQ_TYPE_PFLIP);
@@ -648,7 +648,7 @@ static void dmub_hpd_callback(struct amdgpu_device *adev, · 280 unmodified lines
648648 struct drm_connector *connector;
649649 struct drm_connector_list_iter iter;
650650 struct dc_link *link;
651− uint8_t link_index = 0;
651+ u8 link_index = 0;
652652 struct drm_device *dev;
653653
654654 if (adev == NULL)
@@ -749,7 +749,7 @@ static void dm_dmub_outbox1_low_irq(void *interrupt_params) · 94 unmodified lines
749749 struct amdgpu_device *adev = irq_params->adev;
750750 struct amdgpu_display_manager *dm = &adev->dm;
751751 struct dmcub_trace_buf_entry entry = { 0 };
752− uint32_t count = 0;
752+ u32 count = 0;
753753 struct dmub_hpd_work *dmub_hpd_wrk;
754754 struct dc_link *plink = NULL;
755755
@@ -1015,7 +1015,7 @@ static int dm_dmub_hw_init(struct amdgpu_device *adev) · 259 unmodified lines
10151015 struct dmub_srv_hw_params hw_params;
10161016 enum dmub_status status;
10171017 const unsigned char *fw_inst_const, *fw_bss_data;
1018− uint32_t i, fw_inst_const_size, fw_bss_data_size;
1018+ u32 i, fw_inst_const_size, fw_bss_data_size;
10191019 bool has_hw_support;
10201020
10211021 if (!dmub_srv)
@@ -1176,10 +1176,10 @@ static void dm_dmub_hw_resume(struct amdgpu_device *adev) · 154 unmodified lines
11761176
11771177 static void mmhub_read_system_context(struct amdgpu_device *adev, struct dc_phy_addr_space_config *pa_config)
11781178 {
1179− uint64_t pt_base;
1180− uint32_t logical_addr_low;
1181− uint32_t logical_addr_high;
1182− uint32_t agp_base, agp_bot, agp_top;
1179+ u64 pt_base;
1180+ u32 logical_addr_low;
1181+ u32 logical_addr_high;
1182+ u32 agp_base, agp_bot, agp_top;
11831183 PHYSICAL_ADDRESS_LOC page_table_start, page_table_end, page_table_base;
11841184
11851185 memset(pa_config, 0, sizeof(*pa_config));
@@ -1642,7 +1642,10 @@ static int amdgpu_dm_init(struct amdgpu_device *adev) · 456 unmodified lines
16421642 }
16431643 #endif
16441644 #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
1645− adev->dm.crc_rd_wrk = amdgpu_dm_crtc_secure_display_create_work();
1645+ adev->dm.secure_display_ctxs = amdgpu_dm_crtc_secure_display_create_contexts(adev);
1646+ if (!adev->dm.secure_display_ctxs) {
1647+ DRM_ERROR("amdgpu: failed to initialize secure_display_ctxs.\n");
1648+ }
16461649 #endif
16471650 if (dc_is_dmub_outbox_supported(adev->dm.dc)) {
16481651 init_completion(&adev->dm.dmub_aux_transfer_done);
@@ -1737,10 +1740,15 @@ static void amdgpu_dm_fini(struct amdgpu_device *adev) · 88 unmodified lines
17371740 amdgpu_dm_destroy_drm_device(&adev->dm);
17381741
17391742 #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
1740− if (adev->dm.crc_rd_wrk) {
1741− flush_work(&adev->dm.crc_rd_wrk->notify_ta_work);
1742− kfree(adev->dm.crc_rd_wrk);
1743− adev->dm.crc_rd_wrk = NULL;
1743+ if (adev->dm.secure_display_ctxs) {
1744+ for (i = 0; i < adev->dm.dc->caps.max_links; i++) {
1745+ if (adev->dm.secure_display_ctxs[i].crtc) {
1746+ flush_work(&adev->dm.secure_display_ctxs[i].notify_ta_work);
1747+ flush_work(&adev->dm.secure_display_ctxs[i].forward_roi_work);
1748+ }
1749+ }
1750+ kfree(adev->dm.secure_display_ctxs);
1751+ adev->dm.secure_display_ctxs = NULL;
17441752 }
17451753 #endif
17461754 #ifdef CONFIG_DRM_AMD_DC_HDCP
@@ -2080,7 +2088,9 @@ static int dm_dmub_sw_init(struct amdgpu_device *adev) · 333 unmodified lines
20802088 * TODO: Move this into GART.
20812089 */
20822090 r = amdgpu_bo_create_kernel(adev, region_info.fb_size, PAGE_SIZE,
2083− AMDGPU_GEM_DOMAIN_VRAM, &adev->dm.dmub_bo,
2091+ AMDGPU_GEM_DOMAIN_VRAM |
2092+ AMDGPU_GEM_DOMAIN_GTT,
2093+ &adev->dm.dmub_bo,
20842094 &adev->dm.dmub_bo_gpu_addr,
20852095 &adev->dm.dmub_bo_cpu_addr);
20862096 if (r)
@@ -2165,6 +2175,8 @@ static int detect_mst_link_for_all_connectors(struct drm_device *dev) · 78 unmodified lines
21652175 DRM_ERROR("DM_MST: Failed to start MST\n");
21662176 aconnector->dc_link->type =
21672177 dc_connection_single;
2178+ ret = dm_helpers_dp_mst_stop_top_mgr(aconnector->dc_link->ctx,
2179+ aconnector->dc_link);
21682180 break;
21692181 }
21702182 }
@@ -2486,7 +2498,7 @@ struct amdgpu_dm_connector * · 315 unmodified lines
24862498 amdgpu_dm_find_first_crtc_matching_connector(struct drm_atomic_state *state,
24872499 struct drm_crtc *crtc)
24882500 {
2489− uint32_t i;
2501+ u32 i;
24902502 struct drm_connector_state *new_con_state;
24912503 struct drm_connector *connector;
24922504 struct drm_crtc *crtc_from_state;
@@ -2734,12 +2746,14 @@ static int dm_resume(void *handle) · 241 unmodified lines
27342746 drm_for_each_connector_iter(connector, &iter) {
27352747 aconnector = to_amdgpu_dm_connector(connector);
27362748
2749+ if (!aconnector->dc_link)
2750+ continue;
2751+
27372752 /*
27382753 * this is the case when traversing through already created
27392754 * MST connectors, should be skipped
27402755 */
2741− if (aconnector->dc_link &&
2742− aconnector->dc_link->type == dc_connection_mst_branch)
2756+ if (aconnector->dc_link->type == dc_connection_mst_branch)
27432757 continue;
27442758
27452759 mutex_lock(&aconnector->hpd_lock);
@@ -3117,8 +3131,8 @@ static void handle_hpd_irq(void *param) · 371 unmodified lines
31173131
31183132 static void dm_handle_mst_sideband_msg(struct amdgpu_dm_connector *aconnector)
31193133 {
3120− uint8_t esi[DP_PSR_ERROR_STATUS - DP_SINK_COUNT_ESI] = { 0 };
3121− uint8_t dret;
3134+ u8 esi[DP_PSR_ERROR_STATUS - DP_SINK_COUNT_ESI] = { 0 };
3135+ u8 dret;
31223136 bool new_irq_handled = false;
31233137 int dpcd_addr;
31243138 int dpcd_bytes_to_read;
@@ -3146,7 +3160,7 @@ static void dm_handle_mst_sideband_msg(struct amdgpu_dm_connector *aconnector) · 21 unmodified lines
31463160
31473161 while (dret == dpcd_bytes_to_read &&
31483162 process_count < max_process_count) {
3149− uint8_t retry;
3163+ u8 retry;
31503164 dret = 0;
31513165
31523166 process_count++;
@@ -3165,7 +3179,7 @@ static void dm_handle_mst_sideband_msg(struct amdgpu_dm_connector *aconnector) · 12 unmodified lines
31653179 dpcd_bytes_to_read - 1;
31663180
31673181 for (retry = 0; retry < 3; retry++) {
3168− uint8_t wret;
3182+ u8 wret;
31693183
31703184 wret = drm_dp_dpcd_write(
31713185 &aconnector->dm_dp_aux.aux,
@@ -4179,12 +4193,12 @@ static void amdgpu_set_panel_orientation(struct drm_connector *connector); · 1007 unmodified lines
41794193 static int amdgpu_dm_initialize_drm_device(struct amdgpu_device *adev)
41804194 {
41814195 struct amdgpu_display_manager *dm = &adev->dm;
4182− int32_t i;
4196+ s32 i;
41834197 struct amdgpu_dm_connector *aconnector = NULL;
41844198 struct amdgpu_encoder *aencoder = NULL;
41854199 struct amdgpu_mode_info *mode_info = &adev->mode_info;
4186− uint32_t link_cnt;
4187− int32_t primary_planes;
4200+ u32 link_cnt;
4201+ s32 primary_planes;
41884202 enum dc_connection_type new_connection_type = dc_connection_none;
41894203 const struct dc_plane_cap *plane;
41904204 bool psr_feature_enabled = false;
@@ -4701,7 +4715,7 @@ fill_plane_color_attributes(const struct drm_plane_state *plane_state, · 510 unmodified lines
47014715 static int
47024716 fill_dc_plane_info_and_addr(struct amdgpu_device *adev,
47034717 const struct drm_plane_state *plane_state,
4704− const uint64_t tiling_flags,
4718+ const u64 tiling_flags,
47054719 struct dc_plane_info *plane_info,
47064720 struct dc_plane_address *address,
47074721 bool tmz_surface,
@@ -4876,7 +4890,7 @@ static int fill_dc_plane_attributes(struct amdgpu_device *adev, · 168 unmodified lines
48764890
48774891 static inline void fill_dc_dirty_rect(struct drm_plane *plane,
48784892 struct rect *dirty_rect, int32_t x,
4879− int32_t y, int32_t width, int32_t height,
4893+ s32 y, s32 width, s32 height,
48804894 int *i, bool ffu)
48814895 {
48824896 if (*i > DC_MAX_DIRTY_RECTS)
@@ -4932,11 +4946,11 @@ static void fill_dc_dirty_rects(struct drm_plane *plane, · 49 unmodified lines
49324946 {
49334947 struct dm_crtc_state *dm_crtc_state = to_dm_crtc_state(crtc_state);
49344948 struct rect *dirty_rects = flip_addrs->dirty_rects;
4935− uint32_t num_clips;
4949+ u32 num_clips;
49364950 struct drm_mode_rect *clips;
49374951 bool bb_changed;
49384952 bool fb_changed;
4939− uint32_t i = 0;
4953+ u32 i = 0;
49404954
49414955 /*
49424956 * Cursor plane has it's own dirty rect update interface. See
@@ -5082,7 +5096,7 @@ static enum dc_color_depth · 139 unmodified lines
50825096 convert_color_depth_from_display_info(const struct drm_connector *connector,
50835097 bool is_y420, int requested_bpc)
50845098 {
5085− uint8_t bpc;
5099+ u8 bpc;
50865100
50875101 if (is_y420) {
50885102 bpc = 8;
@@ -5626,8 +5640,8 @@ static void apply_dsc_policy_for_edp(struct amdgpu_dm_connector *aconnector, · 537 unmodified lines
56265640 uint32_t max_dsc_target_bpp_limit_override)
56275641 {
56285642 const struct dc_link_settings *verified_link_cap = NULL;
5629− uint32_t link_bw_in_kbps;
5630− uint32_t edp_min_bpp_x16, edp_max_bpp_x16;
5643+ u32 link_bw_in_kbps;
5644+ u32 edp_min_bpp_x16, edp_max_bpp_x16;
56315645 struct dc *dc = sink->ctx->dc;
56325646 struct dc_dsc_bw_range bw_range = {0};
56335647 struct dc_dsc_config dsc_cfg = {0};
@@ -5684,11 +5698,11 @@ static void apply_dsc_policy_for_stream(struct amdgpu_dm_connector *aconnector, · 50 unmodified lines
56845698 struct dsc_dec_dpcd_caps *dsc_caps)
56855699 {
56865700 struct drm_connector *drm_connector = &aconnector->base;
5687− uint32_t link_bandwidth_kbps;
5701+ u32 link_bandwidth_kbps;
56885702 struct dc *dc = sink->ctx->dc;
5689− uint32_t max_supported_bw_in_kbps, timing_bw_in_kbps;
5690− uint32_t dsc_max_supported_bw_in_kbps;
5691− uint32_t max_dsc_target_bpp_limit_override =
5703+ u32 max_supported_bw_in_kbps, timing_bw_in_kbps;
5704+ u32 dsc_max_supported_bw_in_kbps;
5705+ u32 max_dsc_target_bpp_limit_override =
56925706 drm_connector->display_info.max_dsc_bpp;
56935707
56945708 link_bandwidth_kbps = dc_link_bandwidth_kbps(aconnector->dc_link,
@@ -5835,7 +5849,8 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector, · 140 unmodified lines
58355849 */
58365850 DRM_DEBUG_DRIVER("No preferred mode found\n");
58375851 } else {
5838− recalculate_timing = is_freesync_video_mode(&mode, aconnector);
5852+ recalculate_timing = amdgpu_freesync_vid_mode &&
5853+ is_freesync_video_mode(&mode, aconnector);
58395854 if (recalculate_timing) {
58405855 freesync_mode = get_highest_refresh_rate_mode(aconnector, false);
58415856 drm_mode_copy(&saved_mode, &mode);
@@ -6909,7 +6924,7 @@ static uint add_fs_modes(struct amdgpu_dm_connector *aconnector) · 1067 unmodified lines
69096924 const struct drm_display_mode *m;
69106925 struct drm_display_mode *new_mode;
69116926 uint i;
6912− uint32_t new_modes_count = 0;
6927+ u32 new_modes_count = 0;
69136928
69146929 /* Standard FPS values
69156930 *
@@ -6923,7 +6938,7 @@ static uint add_fs_modes(struct amdgpu_dm_connector *aconnector) · 7 unmodified lines
69236938 * 60 - Commonly used
69246939 * 48,72,96,120 - Multiples of 24
69256940 */
6926− static const uint32_t common_rates[] = {
6941+ static const u32 common_rates[] = {
69276942 23976, 24000, 25000, 29970, 30000,
69286943 48000, 50000, 60000, 72000, 96000, 120000
69296944 };
@@ -6939,8 +6954,8 @@ static uint add_fs_modes(struct amdgpu_dm_connector *aconnector) · 9 unmodified lines
69396954 return 0;
69406955
69416956 for (i = 0; i < ARRAY_SIZE(common_rates); i++) {
6942− uint64_t target_vtotal, target_vtotal_diff;
6943− uint64_t num, den;
6957+ u64 target_vtotal, target_vtotal_diff;
6958+ u64 num, den;
69446959
69456960 if (drm_mode_vrefresh(m) * 1000 < common_rates[i])
69466961 continue;
@@ -6986,7 +7001,7 @@ static void amdgpu_dm_connector_add_freesync_modes(struct drm_connector *connect · 39 unmodified lines
69867001 struct amdgpu_dm_connector *amdgpu_dm_connector =
69877002 to_amdgpu_dm_connector(connector);
69887003
6989− if (!edid)
7004+ if (!(amdgpu_freesync_vid_mode && edid))
69907005 return;
69917006
69927007 if (amdgpu_dm_connector->max_vfreq - amdgpu_dm_connector->min_vfreq > 10)
@@ -7182,7 +7197,7 @@ create_i2c(struct ddc_service *ddc_service, · 189 unmodified lines
71827197 */
71837198 static int amdgpu_dm_connector_init(struct amdgpu_display_manager *dm,
71847199 struct amdgpu_dm_connector *aconnector,
7185− uint32_t link_index,
7200+ u32 link_index,
71867201 struct amdgpu_encoder *aencoder)
71877202 {
71887203 int res = 0;
@@ -7367,27 +7382,55 @@ is_scaling_state_different(const struct dm_connector_state *dm_state, · 178 unmodified lines
73677382 }
73687383
73697384 #ifdef CONFIG_DRM_AMD_DC_HDCP
7370−static bool is_content_protection_different(struct drm_connector_state *state,
7371− const struct drm_connector_state *old_state,
7372− const struct drm_connector *connector, struct hdcp_workqueue *hdcp_w)
7385+static bool is_content_protection_different(struct drm_crtc_state *new_crtc_state,
7386+ struct drm_crtc_state *old_crtc_state,
7387+ struct drm_connector_state *new_conn_state,
7388+ struct drm_connector_state *old_conn_state,
7389+ const struct drm_connector *connector,
7390+ struct hdcp_workqueue *hdcp_w)
73737391 {
73747392 struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
73757393 struct dm_connector_state *dm_con_state = to_dm_connector_state(connector->state);
73767394
7377− /* Handle: Type0/1 change */
7378− if (old_state->hdcp_content_type != state->hdcp_content_type &&
7379− state->content_protection != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
7380− state->content_protection = DRM_MODE_CONTENT_PROTECTION_DESIRED;
7395+ pr_debug("[HDCP_DM] connector->index: %x connect_status: %x dpms: %x\n",
7396+ connector->index, connector->status, connector->dpms);
7397+ pr_debug("[HDCP_DM] state protection old: %x new: %x\n",
7398+ old_conn_state->content_protection, new_conn_state->content_protection);
7399+
7400+ if (old_crtc_state)
7401+ pr_debug("[HDCP_DM] old crtc en: %x a: %x m: %x a-chg: %x c-chg: %x\n",
7402+ old_crtc_state->enable,
7403+ old_crtc_state->active,
7404+ old_crtc_state->mode_changed,
7405+ old_crtc_state->active_changed,
7406+ old_crtc_state->connectors_changed);
7407+
7408+ if (new_crtc_state)
7409+ pr_debug("[HDCP_DM] NEW crtc en: %x a: %x m: %x a-chg: %x c-chg: %x\n",
7410+ new_crtc_state->enable,
7411+ new_crtc_state->active,
7412+ new_crtc_state->mode_changed,
7413+ new_crtc_state->active_changed,
7414+ new_crtc_state->connectors_changed);
7415+
7416+ /* hdcp content type change */
7417+ if (old_conn_state->hdcp_content_type != new_conn_state->hdcp_content_type &&
7418+ new_conn_state->content_protection != DRM_MODE_CONTENT_PROTECTION_UNDESIRED) {
7419+ new_conn_state->content_protection = DRM_MODE_CONTENT_PROTECTION_DESIRED;
7420+ pr_debug("[HDCP_DM] Type0/1 change %s :true\n", __func__);
73817421 return true;
73827422 }
73837423
7384− /* CP is being re enabled, ignore this
7385− *
7386− * Handles: ENABLED -> DESIRED
7387− */
7388− if (old_state->content_protection == DRM_MODE_CONTENT_PROTECTION_ENABLED &&
7389− state->content_protection == DRM_MODE_CONTENT_PROTECTION_DESIRED) {
7390− state->content_protection = DRM_MODE_CONTENT_PROTECTION_ENABLED;
7424+ /* CP is being re enabled, ignore this */
7425+ if (old_conn_state->content_protection == DRM_MODE_CONTENT_PROTECTION_ENABLED &&
7426+ new_conn_state->content_protection == DRM_MODE_CONTENT_PROTECTION_DESIRED) {
7427+ if (new_crtc_state && new_crtc_state->mode_changed) {
7428+ new_conn_state->content_protection = DRM_MODE_CONTENT_PROTECTION_DESIRED;
7429+ pr_debug("[HDCP_DM] ENABLED->DESIRED & mode_changed %s :true\n", __func__);
7430+ return true;
7431+ };
7432+ new_conn_state->content_protection = DRM_MODE_CONTENT_PROTECTION_ENABLED;
7433+ pr_debug("[HDCP_DM] ENABLED -> DESIRED %s :false\n", __func__);
73917434 return false;
73927435 }
73937436
@@ -7395,9 +7438,9 @@ static bool is_content_protection_different(struct drm_connector_state *state, · 1 unmodified line
73957438 *
73967439 * Handles: UNDESIRED -> ENABLED
73977440 */
7398− if (old_state->content_protection == DRM_MODE_CONTENT_PROTECTION_UNDESIRED &&
7399− state->content_protection == DRM_MODE_CONTENT_PROTECTION_ENABLED)
7400− state->content_protection = DRM_MODE_CONTENT_PROTECTION_DESIRED;
7441+ if (old_conn_state->content_protection == DRM_MODE_CONTENT_PROTECTION_UNDESIRED &&
7442+ new_conn_state->content_protection == DRM_MODE_CONTENT_PROTECTION_ENABLED)
7443+ new_conn_state->content_protection = DRM_MODE_CONTENT_PROTECTION_DESIRED;
74017444
74027445 /* Stream removed and re-enabled
74037446 *
@@ -7407,10 +7450,12 @@ static bool is_content_protection_different(struct drm_connector_state *state, · 3 unmodified lines
74077450 *
74087451 * Handles: DESIRED -> DESIRED (Special case)
74097452 */
7410− if (!(old_state->crtc && old_state->crtc->enabled) &&
7411− state->crtc && state->crtc->enabled &&
7453+ if (!(old_conn_state->crtc && old_conn_state->crtc->enabled) &&
7454+ new_conn_state->crtc && new_conn_state->crtc->enabled &&
74127455 connector->state->content_protection == DRM_MODE_CONTENT_PROTECTION_DESIRED) {
74137456 dm_con_state->update_hdcp = false;
7457+ pr_debug("[HDCP_DM] DESIRED->DESIRED (Stream removed and re-enabled) %s :true\n",
7458+ __func__);
74147459 return true;
74157460 }
74167461
@@ -7422,35 +7467,42 @@ static bool is_content_protection_different(struct drm_connector_state *state, · 5 unmodified lines
74227467 *
74237468 * Handles: DESIRED -> DESIRED (Special case)
74247469 */
7425− if (dm_con_state->update_hdcp && state->content_protection == DRM_MODE_CONTENT_PROTECTION_DESIRED &&
7426− connector->dpms == DRM_MODE_DPMS_ON && aconnector->dc_sink != NULL) {
7470+ if (dm_con_state->update_hdcp &&
7471+ new_conn_state->content_protection == DRM_MODE_CONTENT_PROTECTION_DESIRED &&
7472+ connector->dpms == DRM_MODE_DPMS_ON && aconnector->dc_sink != NULL) {
74277473 dm_con_state->update_hdcp = false;
7474+ pr_debug("[HDCP_DM] DESIRED->DESIRED (Hot-plug, headless s3, dpms) %s :true\n",
7475+ __func__);
74287476 return true;
74297477 }
74307478
7431− /*
7432− * Handles: UNDESIRED -> UNDESIRED
7433− * DESIRED -> DESIRED
7434− * ENABLED -> ENABLED
7435− */
7436− if (old_state->content_protection == state->content_protection)
7479+ if (old_conn_state->content_protection == new_conn_state->content_protection) {
7480+ if (new_conn_state->content_protection >= DRM_MODE_CONTENT_PROTECTION_DESIRED) {
7481+ if (new_crtc_state && new_crtc_state->mode_changed) {
7482+ pr_debug("[HDCP_DM] DESIRED->DESIRED or ENABLE->ENABLE mode_change %s :true\n",
7483+ __func__);
7484+ return true;
7485+ };
7486+ pr_debug("[HDCP_DM] DESIRED->DESIRED & ENABLE->ENABLE %s :false\n",
7487+ __func__);
7488+ return false;
7489+ };
7490+
7491+ pr_debug("[HDCP_DM] UNDESIRED->UNDESIRED %s :false\n", __func__);
74377492 return false;
7493+ }
74387494
7439− /*
7440− * Handles: UNDESIRED -> DESIRED
7441− * DESIRED -> UNDESIRED
7442− * ENABLED -> UNDESIRED
7443− */
7444− if (state->content_protection != DRM_MODE_CONTENT_PROTECTION_ENABLED)
7495+ if (new_conn_state->content_protection != DRM_MODE_CONTENT_PROTECTION_ENABLED) {
7496+ pr_debug("[HDCP_DM] UNDESIRED->DESIRED or DESIRED->UNDESIRED or ENABLED->UNDESIRED %s :true\n",
7497+ __func__);
74457498 return true;
7499+ }
74467500
7447− /*
7448− * Handles: DESIRED -> ENABLED
7449− */
7501+ pr_debug("[HDCP_DM] DESIRED->ENABLED %s :false\n", __func__);
74507502 return false;
74517503 }
7452−
74537504 #endif
7505+
74547506 static void remove_stream(struct amdgpu_device *adev,
74557507 struct amdgpu_crtc *acrtc,
74567508 struct dc_stream_state *stream)
@@ -7666,8 +7718,8 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, · 209 unmodified lines
76667718 struct drm_crtc *pcrtc,
76677719 bool wait_for_vblank)
76687720 {
7669− uint32_t i;
7670− uint64_t timestamp_ns;
7721+ u32 i;
7722+ u64 timestamp_ns;
76717723 struct drm_plane *plane;
76727724 struct drm_plane_state *old_plane_state, *new_plane_state;
76737725 struct amdgpu_crtc *acrtc_attach = to_amdgpu_crtc(pcrtc);
@@ -7678,7 +7730,7 @@ static void amdgpu_dm_commit_planes(struct drm_atomic_state *state, · 4 unmodified lines
76787730 to_dm_crtc_state(drm_atomic_get_old_crtc_state(state, pcrtc));
76797731 int planes_count = 0, vpos, hpos;
76807732 unsigned long flags;
7681− uint32_t target_vblank, last_flip_vblank;
7733+ u32 target_vblank, last_flip_vblank;
76827734 bool vrr_active = amdgpu_dm_vrr_active(acrtc_state);
76837735 bool cursor_update = false;
76847736 bool pflip_present = false;
@@ -8116,7 +8168,7 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 431 unmodified lines
81168168 struct amdgpu_display_manager *dm = &adev->dm;
81178169 struct dm_atomic_state *dm_state;
81188170 struct dc_state *dc_state = NULL, *dc_state_temp = NULL;
8119− uint32_t i, j;
8171+ u32 i, j;
81208172 struct drm_crtc *crtc;
81218173 struct drm_crtc_state *old_crtc_state, *new_crtc_state;
81228174 unsigned long flags;
@@ -8290,10 +8342,61 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 167 unmodified lines
82908342 struct amdgpu_crtc *acrtc = to_amdgpu_crtc(dm_new_con_state->base.crtc);
82918343 struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
82928344
8345+ pr_debug("[HDCP_DM] -------------- i : %x ----------\n", i);
8346+
8347+ if (!connector)
8348+ continue;
8349+
8350+ pr_debug("[HDCP_DM] connector->index: %x connect_status: %x dpms: %x\n",
8351+ connector->index, connector->status, connector->dpms);
8352+ pr_debug("[HDCP_DM] state protection old: %x new: %x\n",
8353+ old_con_state->content_protection, new_con_state->content_protection);
8354+
8355+ if (aconnector->dc_sink) {
8356+ if (aconnector->dc_sink->sink_signal != SIGNAL_TYPE_VIRTUAL &&
8357+ aconnector->dc_sink->sink_signal != SIGNAL_TYPE_NONE) {
8358+ pr_debug("[HDCP_DM] pipe_ctx dispname=%s\n",
8359+ aconnector->dc_sink->edid_caps.display_name);
8360+ }
8361+ }
8362+
82938363 new_crtc_state = NULL;
8364+ old_crtc_state = NULL;
82948365
8295− if (acrtc)
8366+ if (acrtc) {
82968367 new_crtc_state = drm_atomic_get_new_crtc_state(state, &acrtc->base);
8368+ old_crtc_state = drm_atomic_get_old_crtc_state(state, &acrtc->base);
8369+ }
8370+
8371+ if (old_crtc_state)
8372+ pr_debug("old crtc en: %x a: %x m: %x a-chg: %x c-chg: %x\n",
8373+ old_crtc_state->enable,
8374+ old_crtc_state->active,
8375+ old_crtc_state->mode_changed,
8376+ old_crtc_state->active_changed,
8377+ old_crtc_state->connectors_changed);
8378+
8379+ if (new_crtc_state)
8380+ pr_debug("NEW crtc en: %x a: %x m: %x a-chg: %x c-chg: %x\n",
8381+ new_crtc_state->enable,
8382+ new_crtc_state->active,
8383+ new_crtc_state->mode_changed,
8384+ new_crtc_state->active_changed,
8385+ new_crtc_state->connectors_changed);
8386+ }
8387+
8388+ for_each_oldnew_connector_in_state(state, connector, old_con_state, new_con_state, i) {
8389+ struct dm_connector_state *dm_new_con_state = to_dm_connector_state(new_con_state);
8390+ struct amdgpu_crtc *acrtc = to_amdgpu_crtc(dm_new_con_state->base.crtc);
8391+ struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
8392+
8393+ new_crtc_state = NULL;
8394+ old_crtc_state = NULL;
8395+
8396+ if (acrtc) {
8397+ new_crtc_state = drm_atomic_get_new_crtc_state(state, &acrtc->base);
8398+ old_crtc_state = drm_atomic_get_old_crtc_state(state, &acrtc->base);
8399+ }
82978400
82988401 dm_new_crtc_state = to_dm_crtc_state(new_crtc_state);
82998402
@@ -8305,11 +8408,44 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 5 unmodified lines
83058408 continue;
83068409 }
83078410
8308− if (is_content_protection_different(new_con_state, old_con_state, connector, adev->dm.hdcp_workqueue))
8411+ if (is_content_protection_different(new_crtc_state, old_crtc_state, new_con_state,
8412+ old_con_state, connector, adev->dm.hdcp_workqueue)) {
8413+ /* when display is unplugged from mst hub, connctor will
8414+ * be destroyed within dm_dp_mst_connector_destroy. connector
8415+ * hdcp perperties, like type, undesired, desired, enabled,
8416+ * will be lost. So, save hdcp properties into hdcp_work within
8417+ * amdgpu_dm_atomic_commit_tail. if the same display is
8418+ * plugged back with same display index, its hdcp properties
8419+ * will be retrieved from hdcp_work within dm_dp_mst_get_modes
8420+ */
8421+
8422+ bool enable_encryption = false;
8423+
8424+ if (new_con_state->content_protection == DRM_MODE_CONTENT_PROTECTION_DESIRED)
8425+ enable_encryption = true;
8426+
8427+ if (aconnector->dc_link && aconnector->dc_sink &&
8428+ aconnector->dc_link->type == dc_connection_mst_branch) {
8429+ struct hdcp_workqueue *hdcp_work = adev->dm.hdcp_workqueue;
8430+ struct hdcp_workqueue *hdcp_w =
8431+ &hdcp_work[aconnector->dc_link->link_index];
8432+
8433+ hdcp_w->hdcp_content_type[connector->index] =
8434+ new_con_state->hdcp_content_type;
8435+ hdcp_w->content_protection[connector->index] =
8436+ new_con_state->content_protection;
8437+ }
8438+
8439+ if (new_crtc_state && new_crtc_state->mode_changed &&
8440+ new_con_state->content_protection >= DRM_MODE_CONTENT_PROTECTION_DESIRED)
8441+ enable_encryption = true;
8442+
8443+ DRM_INFO("[HDCP_DM] hdcp_update_display enable_encryption = %x\n", enable_encryption);
8444+
83098445 hdcp_update_display(
83108446 adev->dm.hdcp_workqueue, aconnector->dc_link->link_index, aconnector,
8311− new_con_state->hdcp_content_type,
8312− new_con_state->content_protection == DRM_MODE_CONTENT_PROTECTION_DESIRED);
8447+ new_con_state->hdcp_content_type, enable_encryption);
8448+ }
83138449 }
83148450 #endif
83158451
@@ -8407,9 +8543,6 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 91 unmodified lines
84078543 struct amdgpu_crtc *acrtc = to_amdgpu_crtc(crtc);
84088544 #ifdef CONFIG_DEBUG_FS
84098545 enum amdgpu_dm_pipe_crc_source cur_crc_src;
8410−#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
8411− struct crc_rd_work *crc_rd_wrk;
8412−#endif
84138546 #endif
84148547 /* Count number of newly disabled CRTCs for dropping PM refs later. */
84158548 if (old_crtc_state->active && !new_crtc_state->active)
@@ -8422,9 +8555,6 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 6 unmodified lines
84228555 update_stream_irq_parameters(dm, dm_new_crtc_state);
84238556
84248557 #ifdef CONFIG_DEBUG_FS
8425−#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
8426− crc_rd_wrk = dm->crc_rd_wrk;
8427−#endif
84288558 spin_lock_irqsave(&adev_to_drm(adev)->event_lock, flags);
84298559 cur_crc_src = acrtc->dm_irq_params.crc_src;
84308560 spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags);
@@ -8453,10 +8583,12 @@ static void amdgpu_dm_atomic_commit_tail(struct drm_atomic_state *state) · 22 unmodified lines
84538583 if (amdgpu_dm_crc_window_is_activated(crtc)) {
84548584 spin_lock_irqsave(&adev_to_drm(adev)->event_lock, flags);
84558585 acrtc->dm_irq_params.window_param.update_win = true;
8586+
8587+ /**
8588+ * It takes 2 frames for HW to stably generate CRC when
8589+ * resuming from suspend, so we set skip_frame_cnt 2.
8590+ */
84568591 acrtc->dm_irq_params.window_param.skip_frame_cnt = 2;
8457− spin_lock_irq(&crc_rd_wrk->crc_rd_work_lock);
8458− crc_rd_wrk->crtc = crtc;
8459− spin_unlock_irq(&crc_rd_wrk->crc_rd_work_lock);
84608592 spin_unlock_irqrestore(&adev_to_drm(adev)->event_lock, flags);
84618593 }
84628594 #endif
@@ -8679,15 +8811,22 @@ static void get_freesync_config_for_crtc( · 216 unmodified lines
86798811 struct drm_display_mode *mode = &new_crtc_state->base.mode;
86808812 int vrefresh = drm_mode_vrefresh(mode);
86818813 bool fs_vid_mode = false;
8814+ bool drr_active = false;
86828815
86838816 new_crtc_state->vrr_supported = new_con_state->freesync_capable &&
86848817 vrefresh >= aconnector->min_vfreq &&
86858818 vrefresh <= aconnector->max_vfreq;
86868819
8687− if (new_crtc_state->vrr_supported) {
8820+ drr_active = new_crtc_state->vrr_supported &&
8821+ new_crtc_state->freesync_config.state != VRR_STATE_DISABLED &&
8822+ new_crtc_state->freesync_config.state != VRR_STATE_INACTIVE &&
8823+ new_crtc_state->freesync_config.state != VRR_STATE_UNSUPPORTED;
8824+
8825+ if (drr_active)
86888826 new_crtc_state->stream->ignore_msa_timing_param = true;
8689− fs_vid_mode = new_crtc_state->freesync_config.state == VRR_STATE_ACTIVE_FIXED;
86908827
8828+ if (new_crtc_state->vrr_supported) {
8829+ fs_vid_mode = new_crtc_state->freesync_config.state == VRR_STATE_ACTIVE_FIXED;
86918830 config.min_refresh_in_uhz = aconnector->min_vfreq * 1000000;
86928831 config.max_refresh_in_uhz = aconnector->max_vfreq * 1000000;
86938832 config.vsif_supported = true;
@@ -8747,7 +8886,7 @@ is_timing_unchanged_for_freesync(struct drm_crtc_state *old_crtc_state, · 53 unmodified lines
87478886 }
87488887
87498888 static void set_freesync_fixed_config(struct dm_crtc_state *dm_new_crtc_state) {
8750− uint64_t num, den, res;
8889+ u64 num, den, res;
87518890 struct drm_crtc_state *new_crtc_state = &dm_new_crtc_state->base;
87528891
87538892 dm_new_crtc_state->freesync_config.state = VRR_STATE_ACTIVE_FIXED;
@@ -8850,7 +8989,8 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm, · 96 unmodified lines
88508989 * TODO: Refactor this function to allow this check to work
88518990 * in all conditions.
88528991 */
8853− if (dm_new_crtc_state->stream &&
8992+ if (amdgpu_freesync_vid_mode &&
8993+ dm_new_crtc_state->stream &&
88548994 is_timing_unchanged_for_freesync(new_crtc_state, old_crtc_state))
88558995 goto skip_modeset;
88568996
@@ -8885,7 +9025,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm, · 28 unmodified lines
88859025 if (!dm_old_crtc_state->stream)
88869026 goto skip_modeset;
88879027
8888− if (dm_new_crtc_state->stream &&
9028+ if (amdgpu_freesync_vid_mode && dm_new_crtc_state->stream &&
88899029 is_timing_unchanged_for_freesync(new_crtc_state,
88909030 old_crtc_state)) {
88919031 new_crtc_state->mode_changed = false;
@@ -8897,7 +9037,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm, · 5 unmodified lines
88979037 set_freesync_fixed_config(dm_new_crtc_state);
88989038
88999039 goto skip_modeset;
8900− } else if (aconnector &&
9040+ } else if (amdgpu_freesync_vid_mode && aconnector &&
89019041 is_freesync_video_mode(&new_crtc_state->mode,
89029042 aconnector)) {
89039043 struct drm_display_mode *high_mode;
@@ -9883,7 +10023,7 @@ fail: · 979 unmodified lines
988310023 static bool is_dp_capable_without_timing_msa(struct dc *dc,
988410024 struct amdgpu_dm_connector *amdgpu_dm_connector)
988510025 {
9886− uint8_t dpcd_data;
10026+ u8 dpcd_data;
988710027 bool capable = false;
988810028
988910029 if (amdgpu_dm_connector->dc_link &&
@@ -9902,7 +10042,7 @@ static bool is_dp_capable_without_timing_msa(struct dc *dc, · 12 unmodified lines
990210042 static bool dm_edid_parser_send_cea(struct amdgpu_display_manager *dm,
990310043 unsigned int offset,
990410044 unsigned int total_length,
9905− uint8_t *data,
10045+ u8 *data,
990610046 unsigned int length,
990710047 struct amdgpu_hdmi_vsdb_info *vsdb)
990810048 {
@@ -9957,7 +10097,7 @@ static bool dm_edid_parser_send_cea(struct amdgpu_display_manager *dm, · 48 unmodified lines
995710097 }
995810098
995910099 static bool parse_edid_cea_dmcu(struct amdgpu_display_manager *dm,
9960− uint8_t *edid_ext, int len,
10100+ u8 *edid_ext, int len,
996110101 struct amdgpu_hdmi_vsdb_info *vsdb_info)
996210102 {
996310103 int i;
@@ -9998,7 +10138,7 @@ static bool parse_edid_cea_dmcu(struct amdgpu_display_manager *dm, · 34 unmodified lines
999810138 }
999910139
1000010140 static bool parse_edid_cea_dmub(struct amdgpu_display_manager *dm,
10001− uint8_t *edid_ext, int len,
10141+ u8 *edid_ext, int len,
1000210142 struct amdgpu_hdmi_vsdb_info *vsdb_info)
1000310143 {
1000410144 int i;
@@ -10014,7 +10154,7 @@ static bool parse_edid_cea_dmub(struct amdgpu_display_manager *dm, · 9 unmodified lines
1001410154 }
1001510155
1001610156 static bool parse_edid_cea(struct amdgpu_dm_connector *aconnector,
10017− uint8_t *edid_ext, int len,
10157+ u8 *edid_ext, int len,
1001810158 struct amdgpu_hdmi_vsdb_info *vsdb_info)
1001910159 {
1002010160 struct amdgpu_device *adev = drm_to_adev(aconnector->base.dev);
@@ -10028,7 +10168,7 @@ static bool parse_edid_cea(struct amdgpu_dm_connector *aconnector, · 7 unmodified lines
1002810168 static int parse_hdmi_amd_vsdb(struct amdgpu_dm_connector *aconnector,
1002910169 struct edid *edid, struct amdgpu_hdmi_vsdb_info *vsdb_info)
1003010170 {
10031− uint8_t *edid_ext = NULL;
10171+ u8 *edid_ext = NULL;
1003210172 int i;
1003310173 bool valid_vsdb_found = false;
1003410174
@@ -10204,7 +10344,7 @@ void amdgpu_dm_trigger_timing_sync(struct drm_device *dev) · 169 unmodified lines
1020410344 }
1020510345
1020610346 void dm_write_reg_func(const struct dc_context *ctx, uint32_t address,
10207− uint32_t value, const char *func_name)
10347+ u32 value, const char *func_name)
1020810348 {
1020910349 #ifdef DM_CHECK_ADDR_0
1021010350 if (address == 0) {
@@ -10219,7 +10359,7 @@ void dm_write_reg_func(const struct dc_context *ctx, uint32_t address, · 8 unmodified lines
1021910359 uint32_t dm_read_reg_func(const struct dc_context *ctx, uint32_t address,
1022010360 const char *func_name)
1022110361 {
10222− uint32_t value;
10362+ u32 value;
1022310363 #ifdef DM_CHECK_ADDR_0
1022410364 if (address == 0) {
1022510365 DC_ERR("invalid register read; address = 0\n");
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.h+4−3
@@ -494,11 +494,12 @@ struct amdgpu_display_manager { · 493 unmodified lines
494494
495495 #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
496496 /**
497− * @crc_rd_wrk:
497+ * @secure_display_ctxs:
498498 *
499− * Work to be executed in a separate thread to communicate with PSP.
499+ * Store the ROI information and the work_struct to command dmub and psp for
500+ * all crtcs.
500501 */
501− struct crc_rd_work *crc_rd_wrk;
502+ struct secure_display_context *secure_display_ctxs;
502503 #endif
503504 /**
504505 * @hpd_rx_offload_wq:
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.c+87−74
@@ -101,35 +101,44 @@ static void amdgpu_dm_set_crc_window_default(struct drm_crtc *crtc) · 100 unmodified lines
101101
102102 static void amdgpu_dm_crtc_notify_ta_to_read(struct work_struct *work)
103103 {
104− struct crc_rd_work *crc_rd_wrk;
105− struct amdgpu_device *adev;
104+ struct secure_display_context *secure_display_ctx;
106105 struct psp_context *psp;
107− struct securedisplay_cmd *securedisplay_cmd;
106+ struct ta_securedisplay_cmd *securedisplay_cmd;
108107 struct drm_crtc *crtc;
109− uint8_t phy_id;
108+ struct dc_stream_state *stream;
109+ uint8_t phy_inst;
110110 int ret;
111111
112− crc_rd_wrk = container_of(work, struct crc_rd_work, notify_ta_work);
113− spin_lock_irq(&crc_rd_wrk->crc_rd_work_lock);
114− crtc = crc_rd_wrk->crtc;
112+ secure_display_ctx = container_of(work, struct secure_display_context, notify_ta_work);
113+ crtc = secure_display_ctx->crtc;
115114
116115 if (!crtc) {
117− spin_unlock_irq(&crc_rd_wrk->crc_rd_work_lock);
118116 return;
119117 }
120118
121− adev = drm_to_adev(crtc->dev);
122− psp = &adev->psp;
123− phy_id = crc_rd_wrk->phy_inst;
124− spin_unlock_irq(&crc_rd_wrk->crc_rd_work_lock);
119+ psp = &drm_to_adev(crtc->dev)->psp;
120+
121+ if (!psp->securedisplay_context.context.initialized) {
122+ DRM_DEBUG_DRIVER("Secure Display fails to notify PSP TA\n");
123+ return;
124+ }
125+
126+ stream = to_amdgpu_crtc(crtc)->dm_irq_params.stream;
127+ phy_inst = stream->link->link_enc_hw_inst;
125128
129+ /* need lock for multiple crtcs to use the command buffer */
126130 mutex_lock(&psp->securedisplay_context.mutex);
127131
128132 psp_prep_securedisplay_cmd_buf(psp, &securedisplay_cmd,
129133 TA_SECUREDISPLAY_COMMAND__SEND_ROI_CRC);
130− securedisplay_cmd->securedisplay_in_message.send_roi_crc.phy_id =
131− phy_id;
134+
135+ securedisplay_cmd->securedisplay_in_message.send_roi_crc.phy_id = phy_inst;
136+
137+ /* PSP TA is expected to finish data transmission over I2C within current frame,
138+ * even there are up to 4 crtcs request to send in this frame.
139+ */
132140 ret = psp_securedisplay_invoke(psp, TA_SECUREDISPLAY_COMMAND__SEND_ROI_CRC);
141+
133142 if (!ret) {
134143 if (securedisplay_cmd->status != TA_SECUREDISPLAY_STATUS__SUCCESS) {
135144 psp_securedisplay_parse_resp_status(psp, securedisplay_cmd->status);
@@ -142,17 +151,23 @@ static void amdgpu_dm_crtc_notify_ta_to_read(struct work_struct *work) · 6 unmodified lines
142151 static void
143152 amdgpu_dm_forward_crc_window(struct work_struct *work)
144153 {
145− struct crc_fw_work *crc_fw_wrk;
154+ struct secure_display_context *secure_display_ctx;
146155 struct amdgpu_display_manager *dm;
156+ struct drm_crtc *crtc;
157+ struct dc_stream_state *stream;
147158
148− crc_fw_wrk = container_of(work, struct crc_fw_work, forward_roi_work);
149− dm = crc_fw_wrk->dm;
159+ secure_display_ctx = container_of(work, struct secure_display_context, forward_roi_work);
160+ crtc = secure_display_ctx->crtc;
161+
162+ if (!crtc)
163+ return;
164+
165+ dm = &drm_to_adev(crtc->dev)->dm;
166+ stream = to_amdgpu_crtc(crtc)->dm_irq_params.stream;
150167
151168 mutex_lock(&dm->dc_lock);
152− dc_stream_forward_crc_window(dm->dc, &crc_fw_wrk->rect, crc_fw_wrk->stream, crc_fw_wrk->is_stop_cmd);
169+ dc_stream_forward_crc_window(stream, &secure_display_ctx->rect, false);
153170 mutex_unlock(&dm->dc_lock);
154−
155− kfree(crc_fw_wrk);
156171 }
157172
158173 bool amdgpu_dm_crc_window_is_activated(struct drm_crtc *crtc)
@@ -189,6 +204,9 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc, · 30 unmodified lines
189204 struct dm_crtc_state *dm_crtc_state,
190205 enum amdgpu_dm_pipe_crc_source source)
191206 {
207+#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
208+ int i;
209+#endif
192210 struct amdgpu_device *adev = drm_to_adev(crtc->dev);
193211 struct dc_stream_state *stream_state = dm_crtc_state->stream;
194212 bool enable = amdgpu_dm_is_valid_crc_source(source);
@@ -200,21 +218,18 @@ int amdgpu_dm_crtc_configure_crc_source(struct drm_crtc *crtc, · 5 unmodified lines
200218
201219 mutex_lock(&adev->dm.dc_lock);
202220
203− /* Enable CRTC CRC generation if necessary. */
221+ /* Enable or disable CRTC CRC generation */
204222 if (dm_is_crc_source_crtc(source) || source == AMDGPU_DM_PIPE_CRC_SOURCE_NONE) {
205223 #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
224+ /* Disable secure_display if it was enabled */
206225 if (!enable) {
207− if (adev->dm.crc_rd_wrk) {
208− flush_work(&adev->dm.crc_rd_wrk->notify_ta_work);
209− spin_lock_irq(&adev->dm.crc_rd_wrk->crc_rd_work_lock);
210−
211− if (adev->dm.crc_rd_wrk->crtc == crtc) {
226+ for (i = 0; i < adev->dm.dc->caps.max_links; i++) {
227+ if (adev->dm.secure_display_ctxs[i].crtc == crtc) {
212228 /* stop ROI update on this crtc */
213− dc_stream_forward_crc_window(stream_state->ctx->dc,
214− NULL, stream_state, true);
215− adev->dm.crc_rd_wrk->crtc = NULL;
229+ flush_work(&adev->dm.secure_display_ctxs[i].notify_ta_work);
230+ flush_work(&adev->dm.secure_display_ctxs[i].forward_roi_work);
231+ dc_stream_forward_crc_window(stream_state, NULL, true);
216232 }
217− spin_unlock_irq(&adev->dm.crc_rd_wrk->crc_rd_work_lock);
218233 }
219234 }
220235 #endif
@@ -347,6 +362,7 @@ int amdgpu_dm_crtc_set_crc_source(struct drm_crtc *crtc, const char *src_name) · 126 unmodified lines
347362 }
348363
349364 #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
365+ /* Reset secure_display when we change crc source from debugfs */
350366 amdgpu_dm_set_crc_window_default(crtc);
351367 #endif
352368
@@ -456,14 +472,12 @@ void amdgpu_dm_crtc_handle_crc_irq(struct drm_crtc *crtc) · 103 unmodified lines
456472 #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
457473 void amdgpu_dm_crtc_handle_crc_window_irq(struct drm_crtc *crtc)
458474 {
459− struct dc_stream_state *stream_state;
460475 struct drm_device *drm_dev = NULL;
461476 enum amdgpu_dm_pipe_crc_source cur_crc_src;
462477 struct amdgpu_crtc *acrtc = NULL;
463478 struct amdgpu_device *adev = NULL;
464− struct crc_rd_work *crc_rd_wrk;
465− struct crc_fw_work *crc_fw_wrk;
466− unsigned long flags1, flags2;
479+ struct secure_display_context *secure_display_ctx = NULL;
480+ unsigned long flags1;
467481
468482 if (crtc == NULL)
469483 return;
@@ -473,75 +487,74 @@ void amdgpu_dm_crtc_handle_crc_window_irq(struct drm_crtc *crtc) · 3 unmodified lines
473487 drm_dev = crtc->dev;
474488
475489 spin_lock_irqsave(&drm_dev->event_lock, flags1);
476− stream_state = acrtc->dm_irq_params.stream;
477490 cur_crc_src = acrtc->dm_irq_params.crc_src;
478491
479492 /* Early return if CRC capture is not enabled. */
480− if (!amdgpu_dm_is_valid_crc_source(cur_crc_src))
493+ if (!amdgpu_dm_is_valid_crc_source(cur_crc_src) ||
494+ !dm_is_crc_source_crtc(cur_crc_src))
481495 goto cleanup;
482496
483− if (!dm_is_crc_source_crtc(cur_crc_src))
497+ if (!acrtc->dm_irq_params.window_param.activated)
484498 goto cleanup;
485499
486− if (!acrtc->dm_irq_params.window_param.activated)
500+ if (acrtc->dm_irq_params.window_param.skip_frame_cnt) {
501+ acrtc->dm_irq_params.window_param.skip_frame_cnt -= 1;
487502 goto cleanup;
503+ }
488504
489− if (acrtc->dm_irq_params.window_param.update_win) {
490− if (acrtc->dm_irq_params.window_param.skip_frame_cnt) {
491− acrtc->dm_irq_params.window_param.skip_frame_cnt -= 1;
492− goto cleanup;
493− }
505+ secure_display_ctx = &adev->dm.secure_display_ctxs[acrtc->crtc_id];
506+ if (WARN_ON(secure_display_ctx->crtc != crtc)) {
507+ /* We have set the crtc when creating secure_display_context,
508+ * don't expect it to be changed here.
509+ */
510+ secure_display_ctx->crtc = crtc;
511+ }
494512
513+ if (acrtc->dm_irq_params.window_param.update_win) {
495514 /* prepare work for dmub to update ROI */
496− crc_fw_wrk = kzalloc(sizeof(*crc_fw_wrk), GFP_ATOMIC);
497− if (!crc_fw_wrk)
498− goto cleanup;
499−
500− INIT_WORK(&crc_fw_wrk->forward_roi_work, amdgpu_dm_forward_crc_window);
501− crc_fw_wrk->dm = &adev->dm;
502− crc_fw_wrk->stream = stream_state;
503− crc_fw_wrk->rect.x = acrtc->dm_irq_params.window_param.x_start;
504− crc_fw_wrk->rect.y = acrtc->dm_irq_params.window_param.y_start;
505− crc_fw_wrk->rect.width = acrtc->dm_irq_params.window_param.x_end -
515+ secure_display_ctx->rect.x = acrtc->dm_irq_params.window_param.x_start;
516+ secure_display_ctx->rect.y = acrtc->dm_irq_params.window_param.y_start;
517+ secure_display_ctx->rect.width = acrtc->dm_irq_params.window_param.x_end -
506518 acrtc->dm_irq_params.window_param.x_start;
507− crc_fw_wrk->rect.height = acrtc->dm_irq_params.window_param.y_end -
519+ secure_display_ctx->rect.height = acrtc->dm_irq_params.window_param.y_end -
508520 acrtc->dm_irq_params.window_param.y_start;
509− schedule_work(&crc_fw_wrk->forward_roi_work);
521+ schedule_work(&secure_display_ctx->forward_roi_work);
510522
511523 acrtc->dm_irq_params.window_param.update_win = false;
524+
525+ /* Statically skip 1 frame, because we may need to wait below things
526+ * before sending ROI to dmub:
527+ * 1. We defer the work by using system workqueue.
528+ * 2. We may need to wait for dc_lock before accessing dmub.
529+ */
512530 acrtc->dm_irq_params.window_param.skip_frame_cnt = 1;
513531
514532 } else {
515− if (acrtc->dm_irq_params.window_param.skip_frame_cnt) {
516− acrtc->dm_irq_params.window_param.skip_frame_cnt -= 1;
517− goto cleanup;
518− }
519−
520− if (adev->dm.crc_rd_wrk) {
521− crc_rd_wrk = adev->dm.crc_rd_wrk;
522− spin_lock_irqsave(&crc_rd_wrk->crc_rd_work_lock, flags2);
523− crc_rd_wrk->phy_inst = stream_state->link->link_enc_hw_inst;
524− spin_unlock_irqrestore(&crc_rd_wrk->crc_rd_work_lock, flags2);
525− schedule_work(&crc_rd_wrk->notify_ta_work);
526− }
533+ /* prepare work for psp to read ROI/CRC and send to I2C */
534+ schedule_work(&secure_display_ctx->notify_ta_work);
527535 }
528536
529537 cleanup:
530538 spin_unlock_irqrestore(&drm_dev->event_lock, flags1);
531539 }
532540
533−struct crc_rd_work *amdgpu_dm_crtc_secure_display_create_work(void)
541+struct secure_display_context *
542+amdgpu_dm_crtc_secure_display_create_contexts(struct amdgpu_device *adev)
534543 {
535− struct crc_rd_work *crc_rd_wrk = NULL;
544+ struct secure_display_context *secure_display_ctxs = NULL;
545+ int i;
536546
537− crc_rd_wrk = kzalloc(sizeof(*crc_rd_wrk), GFP_KERNEL);
547+ secure_display_ctxs = kcalloc(AMDGPU_MAX_CRTCS, sizeof(struct secure_display_context), GFP_KERNEL);
538548
539− if (!crc_rd_wrk)
549+ if (!secure_display_ctxs)
540550 return NULL;
541551
542− spin_lock_init(&crc_rd_wrk->crc_rd_work_lock);
543− INIT_WORK(&crc_rd_wrk->notify_ta_work, amdgpu_dm_crtc_notify_ta_to_read);
552+ for (i = 0; i < adev->dm.dc->caps.max_links; i++) {
553+ INIT_WORK(&secure_display_ctxs[i].forward_roi_work, amdgpu_dm_forward_crc_window);
554+ INIT_WORK(&secure_display_ctxs[i].notify_ta_work, amdgpu_dm_crtc_notify_ta_to_read);
555+ secure_display_ctxs[i].crtc = &adev->mode_info.crtcs[i]->base;
556+ }
544557
545− return crc_rd_wrk;
558+ return secure_display_ctxs;
546559 }
547560 #endif
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_crc.h+11−15
@@ -45,7 +45,7 @@ struct crc_window_param { · 44 unmodified lines
4545 uint16_t y_start;
4646 uint16_t x_end;
4747 uint16_t y_end;
48− /* CRC windwo is activated or not*/
48+ /* CRC window is activated or not*/
4949 bool activated;
5050 /* Update crc window during vertical blank or not */
5151 bool update_win;
@@ -53,22 +53,17 @@ struct crc_window_param { · 1 unmodified line
5353 int skip_frame_cnt;
5454 };
5555
56−/* read_work for driver to call PSP to read */
57−struct crc_rd_work {
56+struct secure_display_context {
57+ /* work to notify PSP TA*/
5858 struct work_struct notify_ta_work;
59− /* To protect crc_rd_work carried fields*/
60− spinlock_t crc_rd_work_lock;
61− struct drm_crtc *crtc;
62− uint8_t phy_inst;
63−};
6459
65−/* forward_work for driver to forward ROI to dmu */
66−struct crc_fw_work {
60+ /* work to forward ROI to dmcu/dmub */
6761 struct work_struct forward_roi_work;
68− struct amdgpu_display_manager *dm;
69− struct dc_stream_state *stream;
62+
63+ struct drm_crtc *crtc;
64+
65+ /* Region of Interest (ROI) */
7066 struct rect rect;
71− bool is_stop_cmd;
7267 };
7368 #endif
7469
@@ -100,11 +95,12 @@ void amdgpu_dm_crtc_handle_crc_irq(struct drm_crtc *crtc); · 25 unmodified lines
10095 #ifdef CONFIG_DRM_AMD_SECURE_DISPLAY
10196 bool amdgpu_dm_crc_window_is_activated(struct drm_crtc *crtc);
10297 void amdgpu_dm_crtc_handle_crc_window_irq(struct drm_crtc *crtc);
103−struct crc_rd_work *amdgpu_dm_crtc_secure_display_create_work(void);
98+struct secure_display_context *amdgpu_dm_crtc_secure_display_create_contexts(
99+ struct amdgpu_device *adev);
104100 #else
105101 #define amdgpu_dm_crc_window_is_activated(x)
106102 #define amdgpu_dm_crtc_handle_crc_window_irq(x)
107−#define amdgpu_dm_crtc_secure_display_create_work()
103+#define amdgpu_dm_crtc_secure_display_create_contexts()
108104 #endif
109105
110106 #endif /* AMD_DAL_DEV_AMDGPU_DM_AMDGPU_DM_CRC_H_ */
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c+24−86
@@ -1375,16 +1375,11 @@ static ssize_t dp_dsc_clock_en_read(struct file *f, char __user *buf, · 1374 unmodified lines
13751375
13761376 for (i = 0; i < MAX_PIPES; i++) {
13771377 pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
1378− if (pipe_ctx && pipe_ctx->stream &&
1378+ if (pipe_ctx->stream &&
13791379 pipe_ctx->stream->link == aconnector->dc_link)
13801380 break;
13811381 }
13821382
1383− if (!pipe_ctx) {
1384− kfree(rd_buf);
1385− return -ENXIO;
1386− }
1387−
13881383 dsc = pipe_ctx->stream_res.dsc;
13891384 if (dsc)
13901385 dsc->funcs->dsc_read_state(dsc, &dsc_state);
@@ -1481,12 +1476,12 @@ static ssize_t dp_dsc_clock_en_write(struct file *f, const char __user *buf, · 90 unmodified lines
14811476
14821477 for (i = 0; i < MAX_PIPES; i++) {
14831478 pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
1484− if (pipe_ctx && pipe_ctx->stream &&
1479+ if (pipe_ctx->stream &&
14851480 pipe_ctx->stream->link == aconnector->dc_link)
14861481 break;
14871482 }
14881483
1489− if (!pipe_ctx || !pipe_ctx->stream)
1484+ if (!pipe_ctx->stream)
14901485 goto done;
14911486
14921487 // Get CRTC state
@@ -1566,16 +1561,11 @@ static ssize_t dp_dsc_slice_width_read(struct file *f, char __user *buf, · 73 unmodified lines
15661561
15671562 for (i = 0; i < MAX_PIPES; i++) {
15681563 pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
1569− if (pipe_ctx && pipe_ctx->stream &&
1564+ if (pipe_ctx->stream &&
15701565 pipe_ctx->stream->link == aconnector->dc_link)
15711566 break;
15721567 }
15731568
1574− if (!pipe_ctx) {
1575− kfree(rd_buf);
1576− return -ENXIO;
1577− }
1578−
15791569 dsc = pipe_ctx->stream_res.dsc;
15801570 if (dsc)
15811571 dsc->funcs->dsc_read_state(dsc, &dsc_state);
@@ -1670,12 +1660,12 @@ static ssize_t dp_dsc_slice_width_write(struct file *f, const char __user *buf, · 88 unmodified lines
16701660
16711661 for (i = 0; i < MAX_PIPES; i++) {
16721662 pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
1673− if (pipe_ctx && pipe_ctx->stream &&
1663+ if (pipe_ctx->stream &&
16741664 pipe_ctx->stream->link == aconnector->dc_link)
16751665 break;
16761666 }
16771667
1678− if (!pipe_ctx || !pipe_ctx->stream)
1668+ if (!pipe_ctx->stream)
16791669 goto done;
16801670
16811671 // Safely get CRTC state
@@ -1755,16 +1745,11 @@ static ssize_t dp_dsc_slice_height_read(struct file *f, char __user *buf, · 73 unmodified lines
17551745
17561746 for (i = 0; i < MAX_PIPES; i++) {
17571747 pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
1758− if (pipe_ctx && pipe_ctx->stream &&
1748+ if (pipe_ctx->stream &&
17591749 pipe_ctx->stream->link == aconnector->dc_link)
17601750 break;
17611751 }
17621752
1763− if (!pipe_ctx) {
1764− kfree(rd_buf);
1765− return -ENXIO;
1766− }
1767−
17681753 dsc = pipe_ctx->stream_res.dsc;
17691754 if (dsc)
17701755 dsc->funcs->dsc_read_state(dsc, &dsc_state);
@@ -1859,12 +1844,12 @@ static ssize_t dp_dsc_slice_height_write(struct file *f, const char __user *buf, · 88 unmodified lines
18591844
18601845 for (i = 0; i < MAX_PIPES; i++) {
18611846 pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
1862− if (pipe_ctx && pipe_ctx->stream &&
1847+ if (pipe_ctx->stream &&
18631848 pipe_ctx->stream->link == aconnector->dc_link)
18641849 break;
18651850 }
18661851
1867− if (!pipe_ctx || !pipe_ctx->stream)
1852+ if (!pipe_ctx->stream)
18681853 goto done;
18691854
18701855 // Get CRTC state
@@ -1940,16 +1925,11 @@ static ssize_t dp_dsc_bits_per_pixel_read(struct file *f, char __user *buf, · 69 unmodified lines
19401925
19411926 for (i = 0; i < MAX_PIPES; i++) {
19421927 pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
1943− if (pipe_ctx && pipe_ctx->stream &&
1928+ if (pipe_ctx->stream &&
19441929 pipe_ctx->stream->link == aconnector->dc_link)
19451930 break;
19461931 }
19471932
1948− if (!pipe_ctx) {
1949− kfree(rd_buf);
1950− return -ENXIO;
1951− }
1952−
19531933 dsc = pipe_ctx->stream_res.dsc;
19541934 if (dsc)
19551935 dsc->funcs->dsc_read_state(dsc, &dsc_state);
@@ -2041,12 +2021,12 @@ static ssize_t dp_dsc_bits_per_pixel_write(struct file *f, const char __user *bu · 85 unmodified lines
20412021
20422022 for (i = 0; i < MAX_PIPES; i++) {
20432023 pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
2044− if (pipe_ctx && pipe_ctx->stream &&
2024+ if (pipe_ctx->stream &&
20452025 pipe_ctx->stream->link == aconnector->dc_link)
20462026 break;
20472027 }
20482028
2049− if (!pipe_ctx || !pipe_ctx->stream)
2029+ if (!pipe_ctx->stream)
20502030 goto done;
20512031
20522032 // Get CRTC state
@@ -2120,16 +2100,11 @@ static ssize_t dp_dsc_pic_width_read(struct file *f, char __user *buf, · 67 unmodified lines
21202100
21212101 for (i = 0; i < MAX_PIPES; i++) {
21222102 pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
2123− if (pipe_ctx && pipe_ctx->stream &&
2103+ if (pipe_ctx->stream &&
21242104 pipe_ctx->stream->link == aconnector->dc_link)
21252105 break;
21262106 }
21272107
2128− if (!pipe_ctx) {
2129− kfree(rd_buf);
2130− return -ENXIO;
2131− }
2132−
21332108 dsc = pipe_ctx->stream_res.dsc;
21342109 if (dsc)
21352110 dsc->funcs->dsc_read_state(dsc, &dsc_state);
@@ -2181,16 +2156,11 @@ static ssize_t dp_dsc_pic_height_read(struct file *f, char __user *buf, · 45 unmodified lines
21812156
21822157 for (i = 0; i < MAX_PIPES; i++) {
21832158 pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
2184− if (pipe_ctx && pipe_ctx->stream &&
2159+ if (pipe_ctx->stream &&
21852160 pipe_ctx->stream->link == aconnector->dc_link)
21862161 break;
21872162 }
21882163
2189− if (!pipe_ctx) {
2190− kfree(rd_buf);
2191− return -ENXIO;
2192− }
2193−
21942164 dsc = pipe_ctx->stream_res.dsc;
21952165 if (dsc)
21962166 dsc->funcs->dsc_read_state(dsc, &dsc_state);
@@ -2257,16 +2227,11 @@ static ssize_t dp_dsc_chunk_size_read(struct file *f, char __user *buf, · 60 unmodified lines
22572227
22582228 for (i = 0; i < MAX_PIPES; i++) {
22592229 pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
2260− if (pipe_ctx && pipe_ctx->stream &&
2230+ if (pipe_ctx->stream &&
22612231 pipe_ctx->stream->link == aconnector->dc_link)
22622232 break;
22632233 }
22642234
2265− if (!pipe_ctx) {
2266− kfree(rd_buf);
2267− return -ENXIO;
2268− }
2269−
22702235 dsc = pipe_ctx->stream_res.dsc;
22712236 if (dsc)
22722237 dsc->funcs->dsc_read_state(dsc, &dsc_state);
@@ -2333,16 +2298,11 @@ static ssize_t dp_dsc_slice_bpg_offset_read(struct file *f, char __user *buf, · 60 unmodified lines
23332298
23342299 for (i = 0; i < MAX_PIPES; i++) {
23352300 pipe_ctx = &aconnector->dc_link->dc->current_state->res_ctx.pipe_ctx[i];
2336− if (pipe_ctx && pipe_ctx->stream &&
2301+ if (pipe_ctx->stream &&
23372302 pipe_ctx->stream->link == aconnector->dc_link)
23382303 break;
23392304 }
23402305
2341− if (!pipe_ctx) {
2342− kfree(rd_buf);
2343− return -ENXIO;
2344− }
2345−
23462306 dsc = pipe_ctx->stream_res.dsc;
23472307 if (dsc)
23482308 dsc->funcs->dsc_read_state(dsc, &dsc_state);
@@ -3245,46 +3205,24 @@ DEFINE_DEBUGFS_ATTRIBUTE(crc_win_y_end_fops, crc_win_y_end_get, · 896 unmodified lines
32453205 */
32463206 static int crc_win_update_set(void *data, u64 val)
32473207 {
3248− struct drm_crtc *new_crtc = data;
3249− struct drm_crtc *old_crtc = NULL;
3250− struct amdgpu_crtc *new_acrtc, *old_acrtc;
3251− struct amdgpu_device *adev = drm_to_adev(new_crtc->dev);
3252− struct crc_rd_work *crc_rd_wrk = adev->dm.crc_rd_wrk;
3253−
3254− if (!crc_rd_wrk)
3255− return 0;
3208+ struct drm_crtc *crtc = data;
3209+ struct amdgpu_crtc *acrtc;
3210+ struct amdgpu_device *adev = drm_to_adev(crtc->dev);
32563211
32573212 if (val) {
3258− new_acrtc = to_amdgpu_crtc(new_crtc);
3213+ acrtc = to_amdgpu_crtc(crtc);
32593214 mutex_lock(&adev->dm.dc_lock);
32603215 /* PSR may write to OTG CRC window control register,
32613216 * so close it before starting secure_display.
32623217 */
3263− amdgpu_dm_psr_disable(new_acrtc->dm_irq_params.stream);
3218+ amdgpu_dm_psr_disable(acrtc->dm_irq_params.stream);
32643219
32653220 spin_lock_irq(&adev_to_drm(adev)->event_lock);
3266− spin_lock_irq(&crc_rd_wrk->crc_rd_work_lock);
3267− if (crc_rd_wrk->crtc) {
3268− old_crtc = crc_rd_wrk->crtc;
3269− old_acrtc = to_amdgpu_crtc(old_crtc);
3270− }
32713221
3272− if (old_crtc && old_crtc != new_crtc) {
3273− old_acrtc->dm_irq_params.window_param.activated = false;
3274− old_acrtc->dm_irq_params.window_param.update_win = false;
3275− old_acrtc->dm_irq_params.window_param.skip_frame_cnt = 0;
3222+ acrtc->dm_irq_params.window_param.activated = true;
3223+ acrtc->dm_irq_params.window_param.update_win = true;
3224+ acrtc->dm_irq_params.window_param.skip_frame_cnt = 0;
32763225
3277− new_acrtc->dm_irq_params.window_param.activated = true;
3278− new_acrtc->dm_irq_params.window_param.update_win = true;
3279− new_acrtc->dm_irq_params.window_param.skip_frame_cnt = 0;
3280− crc_rd_wrk->crtc = new_crtc;
3281− } else {
3282− new_acrtc->dm_irq_params.window_param.activated = true;
3283− new_acrtc->dm_irq_params.window_param.update_win = true;
3284− new_acrtc->dm_irq_params.window_param.skip_frame_cnt = 0;
3285− crc_rd_wrk->crtc = new_crtc;
3286− }
3287− spin_unlock_irq(&crc_rd_wrk->crc_rd_work_lock);
32883226 spin_unlock_irq(&adev_to_drm(adev)->event_lock);
32893227 mutex_unlock(&adev->dm.dc_lock);
32903228 }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_hdcp.h+14−0
@@ -52,6 +52,20 @@ struct hdcp_workqueue { · 51 unmodified lines
5252 struct mod_hdcp_link link;
5353
5454 enum mod_hdcp_encryption_status encryption_status;
55+
56+ /* when display is unplugged from mst hub, connctor will be
57+ * destroyed within dm_dp_mst_connector_destroy. connector
58+ * hdcp perperties, like type, undesired, desired, enabled,
59+ * will be lost. So, save hdcp properties into hdcp_work within
60+ * amdgpu_dm_atomic_commit_tail. if the same display is
61+ * plugged back with same display index, its hdcp properties
62+ * will be retrieved from hdcp_work within dm_dp_mst_get_modes
63+ */
64+ /* un-desired, desired, enabled */
65+ unsigned int content_protection[AMDGPU_DM_MAX_DISPLAY_INDEX];
66+ /* hdcp1.x, hdcp2.x */
67+ unsigned int hdcp_content_type[AMDGPU_DM_MAX_DISPLAY_INDEX];
68+
5569 uint8_t max_link;
5670
5771 uint8_t *srm;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c+26−0
@@ -32,6 +32,10 @@ · 31 unmodified lines
3232 #include "amdgpu_dm.h"
3333 #include "amdgpu_dm_mst_types.h"
3434
35+#ifdef CONFIG_DRM_AMD_DC_HDCP
36+#include "amdgpu_dm_hdcp.h"
37+#endif
38+
3539 #include "dc.h"
3640 #include "dm_helpers.h"
3741
@@ -344,6 +348,28 @@ static int dm_dp_mst_get_modes(struct drm_connector *connector) · 306 unmodified lines
344348 /* dc_link_add_remote_sink returns a new reference */
345349 aconnector->dc_sink = dc_sink;
346350
351+ /* when display is unplugged from mst hub, connctor will be
352+ * destroyed within dm_dp_mst_connector_destroy. connector
353+ * hdcp perperties, like type, undesired, desired, enabled,
354+ * will be lost. So, save hdcp properties into hdcp_work within
355+ * amdgpu_dm_atomic_commit_tail. if the same display is
356+ * plugged back with same display index, its hdcp properties
357+ * will be retrieved from hdcp_work within dm_dp_mst_get_modes
358+ */
359+#ifdef CONFIG_DRM_AMD_DC_HDCP
360+ if (aconnector->dc_sink && connector->state) {
361+ struct drm_device *dev = connector->dev;
362+ struct amdgpu_device *adev = drm_to_adev(dev);
363+ struct hdcp_workqueue *hdcp_work = adev->dm.hdcp_workqueue;
364+ struct hdcp_workqueue *hdcp_w = &hdcp_work[aconnector->dc_link->link_index];
365+
366+ connector->state->hdcp_content_type =
367+ hdcp_w->hdcp_content_type[connector->index];
368+ connector->state->content_protection =
369+ hdcp_w->content_protection[connector->index];
370+ }
371+#endif
372+
347373 if (aconnector->dc_sink) {
348374 amdgpu_dm_update_freesync_caps(
349375 connector, aconnector->edid);
drivers/gpu/drm/amd/display/dc/core/dc.c+54−52
@@ -382,16 +382,18 @@ static void dc_perf_trace_destroy(struct dc_perf_trace **perf_trace) · 381 unmodified lines
382382 }
383383
384384 /**
385− * dc_stream_adjust_vmin_vmax:
385+ * dc_stream_adjust_vmin_vmax - look up pipe context & update parts of DRR
386+ * @dc: dc reference
387+ * @stream: Initial dc stream state
388+ * @adjust: Updated parameters for vertical_total_min and vertical_total_max
386389 *
387390 * Looks up the pipe context of dc_stream_state and updates the
388391 * vertical_total_min and vertical_total_max of the DRR, Dynamic Refresh
389392 * Rate, which is a power-saving feature that targets reducing panel
390393 * refresh rate while the screen is static
391394 *
392− * @dc: dc reference
393− * @stream: Initial dc stream state
394− * @adjust: Updated parameters for vertical_total_min and vertical_total_max
395+ * Return: %true if the pipe context is found and adjusted;
396+ * %false if the pipe context is not found.
395397 */
396398 bool dc_stream_adjust_vmin_vmax(struct dc *dc,
397399 struct dc_stream_state *stream,
@@ -419,14 +421,17 @@ bool dc_stream_adjust_vmin_vmax(struct dc *dc, · 21 unmodified lines
419421 }
420422
421423 /**
422− * dc_stream_get_last_used_drr_vtotal - dc_stream_get_last_vrr_vtotal
424+ * dc_stream_get_last_used_drr_vtotal - Looks up the pipe context of
425+ * dc_stream_state and gets the last VTOTAL used by DRR (Dynamic Refresh Rate)
423426 *
424427 * @dc: [in] dc reference
425428 * @stream: [in] Initial dc stream state
426− * @adjust: [in] Updated parameters for vertical_total_min and
429+ * @refresh_rate: [in] new refresh_rate
427430 *
428− * Looks up the pipe context of dc_stream_state and gets the last VTOTAL used
429− * by DRR (Dynamic Refresh Rate)
431+ * Return: %true if the pipe context is found and there is an associated
432+ * timing_generator for the DC;
433+ * %false if the pipe context is not found or there is no
434+ * timing_generator for the DC.
430435 */
431436 bool dc_stream_get_last_used_drr_vtotal(struct dc *dc,
432437 struct dc_stream_state *stream,
@@ -518,14 +523,15 @@ dc_stream_forward_dmcu_crc_window(struct dmcu *dmcu, · 85 unmodified lines
518523 }
519524
520525 bool
521−dc_stream_forward_crc_window(struct dc *dc,
522− struct rect *rect, struct dc_stream_state *stream, bool is_stop)
526+dc_stream_forward_crc_window(struct dc_stream_state *stream,
527+ struct rect *rect, bool is_stop)
523528 {
524529 struct dmcu *dmcu;
525530 struct dc_dmub_srv *dmub_srv;
526531 struct otg_phy_mux mux_mapping;
527532 struct pipe_ctx *pipe;
528533 int i;
534+ struct dc *dc = stream->ctx->dc;
529535
530536 for (i = 0; i < MAX_PIPES; i++) {
531537 pipe = &dc->current_state->res_ctx.pipe_ctx[i];
@@ -566,7 +572,10 @@ dc_stream_forward_crc_window(struct dc *dc, · 34 unmodified lines
566572 * once.
567573 *
568574 * By default, only CRC0 is configured, and the entire frame is used to
569− * calculate the crc.
575+ * calculate the CRC.
576+ *
577+ * Return: %false if the stream is not found or CRC capture is not supported;
578+ * %true if the stream has been configured.
570579 */
571580 bool dc_stream_configure_crc(struct dc *dc, struct dc_stream_state *stream,
572581 struct crc_params *crc_window, bool enable, bool continuous)
@@ -635,7 +644,7 @@ bool dc_stream_configure_crc(struct dc *dc, struct dc_stream_state *stream, · 62 unmodified lines
635644 * dc_stream_configure_crc needs to be called beforehand to enable CRCs.
636645 *
637646 * Return:
638− * false if stream is not found, or if CRCs are not enabled.
647+ * %false if stream is not found, or if CRCs are not enabled.
639648 */
640649 bool dc_stream_get_crc(struct dc *dc, struct dc_stream_state *stream,
641650 uint32_t *r_cr, uint32_t *g_y, uint32_t *b_cb)
@@ -1740,6 +1749,8 @@ void dc_z10_save_init(struct dc *dc) · 1098 unmodified lines
17401749 *
17411750 * Applies given context to the hardware and copy it into current context.
17421751 * It's up to the user to release the src context afterwards.
1752+ *
1753+ * Return: an enum dc_status result code for the operation
17431754 */
17441755 static enum dc_status dc_commit_state_no_check(struct dc *dc, struct dc_state *context)
17451756 {
@@ -2007,8 +2018,9 @@ bool dc_commit_state(struct dc *dc, struct dc_state *context) · 261 unmodified lines
20072018 return result == DC_OK;
20082019 }
20092020
2010− if (!streams_changed(dc, context->streams, context->stream_count))
2021+ if (!streams_changed(dc, context->streams, context->stream_count)) {
20112022 return DC_OK;
2023+ }
20122024
20132025 DC_LOG_DC("%s: %d streams\n",
20142026 __func__, context->stream_count);
@@ -3325,6 +3337,7 @@ static void commit_planes_for_stream(struct dc *dc, · 1310 unmodified lines
33253337 struct pipe_ctx *top_pipe_to_program = NULL;
33263338 bool should_lock_all_pipes = (update_type != UPDATE_TYPE_FAST);
33273339 bool subvp_prev_use = false;
3340+ bool subvp_curr_use = false;
33283341
33293342 // Once we apply the new subvp context to hardware it won't be in the
33303343 // dc->current_state anymore, so we have to cache it before we apply
@@ -3381,6 +3394,15 @@ static void commit_planes_for_stream(struct dc *dc, · 50 unmodified lines
33813394 break;
33823395 }
33833396
3397+ for (i = 0; i < dc->res_pool->pipe_count; i++) {
3398+ struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
3399+
3400+ if (pipe->stream && pipe->stream->mall_stream_config.type == SUBVP_PHANTOM) {
3401+ subvp_curr_use = true;
3402+ break;
3403+ }
3404+ }
3405+
33843406 if (stream->test_pattern.type != DP_TEST_PATTERN_VIDEO_MODE) {
33853407 struct pipe_ctx *mpcc_pipe;
33863408 struct pipe_ctx *odm_pipe;
@@ -3652,42 +3674,22 @@ static void commit_planes_for_stream(struct dc *dc, · 265 unmodified lines
36523674 top_pipe_to_program->stream_res.tg);
36533675 }
36543676
3655− /* For phantom pipe OTG enable, it has to be done after any previous pipe
3656− * that was in use has already been programmed at gotten its double buffer
3657− * update for "disable".
3658− */
3659− if (update_type != UPDATE_TYPE_FAST) {
3660− for (i = 0; i < dc->res_pool->pipe_count; i++) {
3661− struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
3662− struct pipe_ctx *old_pipe = &dc->current_state->res_ctx.pipe_ctx[i];
3663−
3664− /* If an active, non-phantom pipe is being transitioned into a phantom
3665− * pipe, wait for the double buffer update to complete first before we do
3666− * ANY phantom pipe programming.
3667− */
3668− if (pipe->stream && pipe->stream->mall_stream_config.type == SUBVP_PHANTOM &&
3669− old_pipe->stream && old_pipe->stream->mall_stream_config.type != SUBVP_PHANTOM) {
3670− old_pipe->stream_res.tg->funcs->wait_for_state(
3671− old_pipe->stream_res.tg,
3672− CRTC_STATE_VBLANK);
3673− old_pipe->stream_res.tg->funcs->wait_for_state(
3674− old_pipe->stream_res.tg,
3675− CRTC_STATE_VACTIVE);
3676− }
3677+ if (subvp_curr_use) {
3678+ /* If enabling subvp or transitioning from subvp->subvp, enable the
3679+ * phantom streams before we program front end for the phantom pipes.
3680+ */
3681+ if (update_type != UPDATE_TYPE_FAST) {
3682+ if (dc->hwss.enable_phantom_streams)
3683+ dc->hwss.enable_phantom_streams(dc, context);
36773684 }
3678− for (i = 0; i < dc->res_pool->pipe_count; i++) {
3679− struct pipe_ctx *new_pipe = &context->res_ctx.pipe_ctx[i];
3685+ }
36803686
3681− if ((new_pipe->stream && new_pipe->stream->mall_stream_config.type == SUBVP_PHANTOM) ||
3682− subvp_prev_use) {
3683− // If old context or new context has phantom pipes, apply
3684− // the phantom timings now. We can't change the phantom
3685− // pipe configuration safely without driver acquiring
3686− // the DMCUB lock first.
3687− dc->hwss.apply_ctx_to_hw(dc, context);
3688− break;
3689− }
3690− }
3687+ if (subvp_prev_use && !subvp_curr_use) {
3688+ /* If disabling subvp, disable phantom streams after front end
3689+ * programming has completed (we turn on phantom OTG in order
3690+ * to complete the plane disable for phantom pipes).
3691+ */
3692+ dc->hwss.apply_ctx_to_hw(dc, context);
36913693 }
36923694
36933695 if (update_type != UPDATE_TYPE_FAST)
@@ -4704,7 +4706,7 @@ bool dc_enable_dmub_notifications(struct dc *dc) · 1010 unmodified lines
47044706 /**
47054707 * dc_enable_dmub_outbox - Enables DMUB unsolicited notification
47064708 *
4707− * dc: [in] dc structure
4709+ * @dc: [in] dc structure
47084710 *
47094711 * Enables DMUB unsolicited notifications to x86 via outbox.
47104712 */
@@ -4905,8 +4907,8 @@ enum dc_status dc_process_dmub_set_mst_slots(const struct dc *dc, · 194 unmodified lines
49054907 /**
49064908 * dc_process_dmub_dpia_hpd_int_enable - Submits DPIA DPD interruption
49074909 *
4908− * @dc [in]: dc structure
4909− * @hpd_int_enable [in]: 1 for hpd int enable, 0 to disable
4910+ * @dc: [in] dc structure
4911+ * @hpd_int_enable: [in] 1 for hpd int enable, 0 to disable
49104912 *
49114913 * Submits dpia hpd int enable command to dmub via inbox message
49124914 */
@@ -4987,7 +4989,7 @@ void dc_notify_vsync_int_state(struct dc *dc, struct dc_stream_state *stream, bo · 74 unmodified lines
49874989 }
49884990
49894991 /**
4990− * dc_extended_blank_supported 0 Decide whether extended blank is supported
4992+ * dc_extended_blank_supported - Decide whether extended blank is supported
49914993 *
49924994 * @dc: [in] Current DC state
49934995 *
@@ -4996,7 +4998,7 @@ void dc_notify_vsync_int_state(struct dc *dc, struct dc_stream_state *stream, bo · 2 unmodified lines
49964998 * ability to enter z9/z10.
49974999 *
49985000 * Return:
4999− * Indicate whether extended blank is supported (true or false)
5001+ * Indicate whether extended blank is supported (%true or %false)
50005002 */
50015003 bool dc_extended_blank_supported(struct dc *dc)
50025004 {
drivers/gpu/drm/amd/display/dc/core/dc_link.c+0−9
@@ -1916,12 +1916,6 @@ struct dc_link *link_create(const struct link_init_data *init_params) · 1915 unmodified lines
19161916 if (false == dc_link_construct(link, init_params))
19171917 goto construct_fail;
19181918
1919− /*
1920− * Must use preferred_link_setting, not reported_link_cap or verified_link_cap,
1921− * since struct preferred_link_setting won't be reset after S3.
1922− */
1923− link->preferred_link_setting.dpcd_source_device_specific_field_support = true;
1924−
19251919 return link;
19261920
19271921 construct_fail:
@@ -4655,9 +4649,6 @@ void dc_link_set_preferred_training_settings(struct dc *dc, · 2727 unmodified lines
46554649
46564650 if (link_setting != NULL) {
46574651 link->preferred_link_setting = *link_setting;
4658− if (dp_get_link_encoding_format(link_setting) == DP_128b_132b_ENCODING)
4659− /* TODO: add dc update for acquiring link res */
4660− skip_immediate_retrain = true;
46614652 } else {
46624653 link->preferred_link_setting.lane_count = LANE_COUNT_UNKNOWN;
46634654 link->preferred_link_setting.link_rate = LINK_RATE_UNKNOWN;
drivers/gpu/drm/amd/display/dc/core/dc_link_ddc.c+0−1
@@ -82,7 +82,6 @@ struct dp_hdmi_dongle_signature_data { · 81 unmodified lines
8282 #define HDMI_SCDC_STATUS_FLAGS 0x40
8383 #define HDMI_SCDC_ERR_DETECT 0x50
8484 #define HDMI_SCDC_TEST_CONFIG 0xC0
85−#define HDMI_SCDC_DEVICE_ID 0xD3
8685
8786 union hdmi_scdc_update_read_data {
8887 uint8_t byte[2];
drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c+67−70
@@ -4094,6 +4094,12 @@ static void dp_test_send_link_training(struct dc_link *link) · 4093 unmodified lines
40944094 dp_retrain_link_dp_test(link, &link_settings, false);
40954095 }
40964096
4097+static bool is_dp_phy_sqaure_pattern(enum dp_test_pattern test_pattern)
4098+{
4099+ return (DP_TEST_PATTERN_SQUARE_BEGIN <= test_pattern &&
4100+ test_pattern <= DP_TEST_PATTERN_SQUARE_END);
4101+}
4102+
40974103 /* TODO Raven hbr2 compliance eye output is unstable
40984104 * (toggling on and off) with debugger break
40994105 * This caueses intermittent PHY automation failure
@@ -4111,6 +4117,8 @@ static void dp_test_send_phy_test_pattern(struct dc_link *link) · 11 unmodified lines
41114117 union lane_adjust dpcd_lane_adjust;
41124118 unsigned int lane;
41134119 struct link_training_settings link_training_settings;
4120+ unsigned char no_preshoot = 0;
4121+ unsigned char no_deemphasis = 0;
41144122
41154123 dpcd_test_pattern.raw = 0;
41164124 memset(dpcd_lane_adjustment, 0, sizeof(dpcd_lane_adjustment));
@@ -4204,8 +4212,21 @@ static void dp_test_send_phy_test_pattern(struct dc_link *link) · 87 unmodified lines
42044212 case PHY_TEST_PATTERN_264BIT_CUSTOM:
42054213 test_pattern = DP_TEST_PATTERN_264BIT_CUSTOM;
42064214 break;
4207− case PHY_TEST_PATTERN_SQUARE_PULSE:
4208− test_pattern = DP_TEST_PATTERN_SQUARE_PULSE;
4215+ case PHY_TEST_PATTERN_SQUARE:
4216+ test_pattern = DP_TEST_PATTERN_SQUARE;
4217+ break;
4218+ case PHY_TEST_PATTERN_SQUARE_PRESHOOT_DISABLED:
4219+ test_pattern = DP_TEST_PATTERN_SQUARE_PRESHOOT_DISABLED;
4220+ no_preshoot = 1;
4221+ break;
4222+ case PHY_TEST_PATTERN_SQUARE_DEEMPHASIS_DISABLED:
4223+ test_pattern = DP_TEST_PATTERN_SQUARE_DEEMPHASIS_DISABLED;
4224+ no_deemphasis = 1;
4225+ break;
4226+ case PHY_TEST_PATTERN_SQUARE_PRESHOOT_DEEMPHASIS_DISABLED:
4227+ test_pattern = DP_TEST_PATTERN_SQUARE_PRESHOOT_DEEMPHASIS_DISABLED;
4228+ no_preshoot = 1;
4229+ no_deemphasis = 1;
42094230 break;
42104231 default:
42114232 test_pattern = DP_TEST_PATTERN_VIDEO_MODE;
@@ -4222,7 +4243,7 @@ static void dp_test_send_phy_test_pattern(struct dc_link *link) · 10 unmodified lines
42224243 test_pattern_size);
42234244 }
42244245
4225− if (test_pattern == DP_TEST_PATTERN_SQUARE_PULSE) {
4246+ if (is_dp_phy_sqaure_pattern(test_pattern)) {
42264247 test_pattern_size = 1; // Square pattern data is 1 byte (DP spec)
42274248 core_link_read_dpcd(
42284249 link,
@@ -4259,8 +4280,10 @@ static void dp_test_send_phy_test_pattern(struct dc_link *link) · 30 unmodified lines
42594280 ((dpcd_post_cursor_2_adjustment >> (lane * 2)) & 0x03);
42604281 } else if (dp_get_link_encoding_format(&link->cur_link_settings) ==
42614282 DP_128b_132b_ENCODING) {
4262− link_training_settings.hw_lane_settings[lane].FFE_PRESET.raw =
4283+ link_training_settings.hw_lane_settings[lane].FFE_PRESET.settings.level =
42634284 dpcd_lane_adjust.tx_ffe.PRESET_VALUE;
4285+ link_training_settings.hw_lane_settings[lane].FFE_PRESET.settings.no_preshoot = no_preshoot;
4286+ link_training_settings.hw_lane_settings[lane].FFE_PRESET.settings.no_deemphasis = no_deemphasis;
42644287 }
42654288 }
42664289
@@ -6114,7 +6137,7 @@ bool dc_link_dp_set_test_pattern( · 1847 unmodified lines
61146137 * MuteAudioEndpoint(pPathMode->pDisplayPath, true);
61156138 */
61166139 /* Blank stream */
6117− pipes->stream_res.stream_enc->funcs->dp_blank(link, pipe_ctx->stream_res.stream_enc);
6140+ link->dc->hwss.blank_stream(pipe_ctx);
61186141 }
61196142
61206143 dp_set_hw_test_pattern(link, &pipe_ctx->link_res, test_pattern,
@@ -6178,8 +6201,17 @@ bool dc_link_dp_set_test_pattern( · 57 unmodified lines
61786201 case DP_TEST_PATTERN_264BIT_CUSTOM:
61796202 pattern = PHY_TEST_PATTERN_264BIT_CUSTOM;
61806203 break;
6181− case DP_TEST_PATTERN_SQUARE_PULSE:
6182− pattern = PHY_TEST_PATTERN_SQUARE_PULSE;
6204+ case DP_TEST_PATTERN_SQUARE:
6205+ pattern = PHY_TEST_PATTERN_SQUARE;
6206+ break;
6207+ case DP_TEST_PATTERN_SQUARE_PRESHOOT_DISABLED:
6208+ pattern = PHY_TEST_PATTERN_SQUARE_PRESHOOT_DISABLED;
6209+ break;
6210+ case DP_TEST_PATTERN_SQUARE_DEEMPHASIS_DISABLED:
6211+ pattern = PHY_TEST_PATTERN_SQUARE_DEEMPHASIS_DISABLED;
6212+ break;
6213+ case DP_TEST_PATTERN_SQUARE_PRESHOOT_DEEMPHASIS_DISABLED:
6214+ pattern = PHY_TEST_PATTERN_SQUARE_PRESHOOT_DEEMPHASIS_DISABLED;
61836215 break;
61846216 default:
61856217 return false;
@@ -6190,14 +6222,12 @@ bool dc_link_dp_set_test_pattern( · 4 unmodified lines
61906222 return false;
61916223
61926224 if (link->dpcd_caps.dpcd_rev.raw >= DPCD_REV_12) {
6193−#if defined(CONFIG_DRM_AMD_DC_DCN)
6194− if (test_pattern == DP_TEST_PATTERN_SQUARE_PULSE)
6225+ if (is_dp_phy_sqaure_pattern(test_pattern))
61956226 core_link_write_dpcd(link,
61966227 DP_LINK_SQUARE_PATTERN,
61976228 p_custom_pattern,
61986229 1);
61996230
6200−#endif
62016231 /* tell receiver that we are sending qualification
62026232 * pattern DP 1.2 or later - DP receiver's link quality
62036233 * pattern is set using DPCD LINK_QUAL_LANEx_SET
@@ -6554,18 +6584,10 @@ void dpcd_set_source_specific_data(struct dc_link *link) · 350 unmodified lines
65546584
65556585 uint8_t hblank_size = (uint8_t)link->dc->caps.min_horizontal_blanking_period;
65566586
6557− if (link->preferred_link_setting.dpcd_source_device_specific_field_support) {
6558− result_write_min_hblank = core_link_write_dpcd(link,
6559− DP_SOURCE_MINIMUM_HBLANK_SUPPORTED, (uint8_t *)(&hblank_size),
6560− sizeof(hblank_size));
6561−
6562− if (result_write_min_hblank == DC_ERROR_UNEXPECTED)
6563− link->preferred_link_setting.dpcd_source_device_specific_field_support = false;
6564− } else {
6565− DC_LOG_DC("Sink device does not support 00340h DPCD write. Skipping on purpose.\n");
6566− }
6587+ result_write_min_hblank = core_link_write_dpcd(link,
6588+ DP_SOURCE_MINIMUM_HBLANK_SUPPORTED, (uint8_t *)(&hblank_size),
6589+ sizeof(hblank_size));
65676590 }
6568−
65696591 DC_TRACE_LEVEL_MESSAGE(DAL_TRACE_LEVEL_INFORMATION,
65706592 WPP_BIT_FLAG_DC_DETECTION_DP_CAPS,
65716593 "result=%u link_index=%u enum dce_version=%d DPCD=0x%04X min_hblank=%u branch_dev_id=0x%x branch_dev_name='%c%c%c%c%c%c'",
@@ -7254,59 +7276,35 @@ void dp_retrain_link_dp_test(struct dc_link *link, · 682 unmodified lines
72547276 struct dc_link_settings *link_setting,
72557277 bool skip_video_pattern)
72567278 {
7257− struct pipe_ctx *pipes =
7258− &link->dc->current_state->res_ctx.pipe_ctx[0];
7279+ struct pipe_ctx *pipe;
72597280 unsigned int i;
7260− bool do_fallback = false;
72617281
7282+ udelay(100);
72627283
72637284 for (i = 0; i < MAX_PIPES; i++) {
7264− if (pipes[i].stream != NULL &&
7265− !pipes[i].top_pipe && !pipes[i].prev_odm_pipe &&
7266− pipes[i].stream->link != NULL &&
7267− pipes[i].stream_res.stream_enc != NULL &&
7268− pipes[i].stream->link == link) {
7269− udelay(100);
7270−
7271− pipes[i].stream_res.stream_enc->funcs->dp_blank(link,
7272− pipes[i].stream_res.stream_enc);
7273−
7274− /* disable any test pattern that might be active */
7275− dp_set_hw_test_pattern(link, &pipes[i].link_res,
7276− DP_TEST_PATTERN_VIDEO_MODE, NULL, 0);
7277−
7278− dp_receiver_power_ctrl(link, false);
7279−
7280− link->dc->hwss.disable_stream(&pipes[i]);
7281− if ((&pipes[i])->stream_res.audio && !link->dc->debug.az_endpoint_mute_only)
7282− (&pipes[i])->stream_res.audio->funcs->az_disable((&pipes[i])->stream_res.audio);
7283−
7284− if (link->link_enc)
7285− link->link_enc->funcs->disable_output(
7286− link->link_enc,
7287− SIGNAL_TYPE_DISPLAY_PORT);
7288−
7289− /* Clear current link setting. */
7290− memset(&link->cur_link_settings, 0,
7291− sizeof(link->cur_link_settings));
7292−
7293− if (link->ep_type == DISPLAY_ENDPOINT_USB4_DPIA)
7294− do_fallback = true;
7295−
7296− perform_link_training_with_retries(
7297− link_setting,
7298− skip_video_pattern,
7299− LINK_TRAINING_ATTEMPTS,
7300− &pipes[i],
7301− SIGNAL_TYPE_DISPLAY_PORT,
7302− do_fallback);
7303−
7304− link->dc->hwss.enable_stream(&pipes[i]);
7305−
7306− link->dc->hwss.unblank_stream(&pipes[i],
7307− link_setting);
7285+ pipe = &link->dc->current_state->res_ctx.pipe_ctx[i];
7286+ if (pipe->stream != NULL &&
7287+ pipe->stream->link == link &&
7288+ !pipe->stream->dpms_off &&
7289+ !pipe->top_pipe && !pipe->prev_odm_pipe) {
7290+ core_link_disable_stream(pipe);
7291+ pipe->link_config.dp_link_settings = *link_setting;
7292+ update_dp_encoder_resources_for_test_harness(
7293+ link->dc,
7294+ pipe->stream->ctx->dc->current_state,
7295+ pipe);
7296+ }
7297+ }
73087298
7309− link->dc->hwss.enable_audio_stream(&pipes[i]);
7299+ for (i = 0; i < MAX_PIPES; i++) {
7300+ pipe = &link->dc->current_state->res_ctx.pipe_ctx[i];
7301+ if (pipe->stream != NULL &&
7302+ pipe->stream->link == link &&
7303+ !pipe->stream->dpms_off &&
7304+ !pipe->top_pipe && !pipe->prev_odm_pipe) {
7305+ core_link_enable_stream(
7306+ pipe->stream->ctx->dc->current_state,
7307+ pipe);
73107308 }
73117309 }
73127310 }
@@ -7496,7 +7494,6 @@ bool dp_set_dsc_pps_sdp(struct pipe_ctx *pipe_ctx, bool enable, bool immediate_u · 183 unmodified lines
74967494 dsc_cfg.is_odm = pipe_ctx->next_odm_pipe ? true : false;
74977495 dsc_cfg.dc_dsc_cfg = stream->timing.dsc_cfg;
74987496
7499− DC_LOG_DSC(" ");
75007497 dsc->funcs->dsc_get_packed_pps(dsc, &dsc_cfg, &dsc_packed_pps[0]);
75017498 memcpy(&stream->dsc_packed_pps[0], &dsc_packed_pps[0], sizeof(stream->dsc_packed_pps));
75027499 if (dc_is_dp_signal(stream->signal)) {
drivers/gpu/drm/amd/display/dc/core/dc_resource.c+51−3
@@ -3810,6 +3810,8 @@ void check_syncd_pipes_for_disabled_master_pipe(struct dc *dc, · 3809 unmodified lines
38103810 int i;
38113811 struct pipe_ctx *pipe_ctx, *pipe_ctx_check;
38123812
3813+ DC_LOGGER_INIT(dc->ctx->logger);
3814+
38133815 pipe_ctx = &context->res_ctx.pipe_ctx[disabled_master_pipe_idx];
38143816 if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx) != disabled_master_pipe_idx) ||
38153817 !IS_PIPE_SYNCD_VALID(pipe_ctx))
@@ -3820,9 +3822,16 @@ void check_syncd_pipes_for_disabled_master_pipe(struct dc *dc, · 4 unmodified lines
38203822 pipe_ctx_check = &context->res_ctx.pipe_ctx[i];
38213823
38223824 if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx_check) == disabled_master_pipe_idx) &&
3823− IS_PIPE_SYNCD_VALID(pipe_ctx_check) && (i != disabled_master_pipe_idx))
3824− DC_ERR("DC: Failure: pipe_idx[%d] syncd with disabled master pipe_idx[%d]\n",
3825− i, disabled_master_pipe_idx);
3825+ IS_PIPE_SYNCD_VALID(pipe_ctx_check) && (i != disabled_master_pipe_idx)) {
3826+ /* On dcn32, this error isn't fatal since hw supports odm transition in fast update*/
3827+ if (dc->ctx->dce_version == DCN_VERSION_3_2 ||
3828+ dc->ctx->dce_version == DCN_VERSION_3_21)
3829+ DC_LOG_DEBUG("DC: pipe_idx[%d] syncd with disabled master pipe_idx[%d]\n",
3830+ i, disabled_master_pipe_idx);
3831+ else
3832+ DC_ERR("DC: Failure: pipe_idx[%d] syncd with disabled master pipe_idx[%d]\n",
3833+ i, disabled_master_pipe_idx);
3834+ }
38263835 }
38273836 }
38283837
@@ -3981,3 +3990,42 @@ bool dc_resource_acquire_secondary_pipe_for_mpc_odm( · 152 unmodified lines
39813990
39823991 return true;
39833992 }
3993+
3994+enum dc_status update_dp_encoder_resources_for_test_harness(const struct dc *dc,
3995+ struct dc_state *context,
3996+ struct pipe_ctx *pipe_ctx)
3997+{
3998+ if (dp_get_link_encoding_format(&pipe_ctx->link_config.dp_link_settings) == DP_128b_132b_ENCODING) {
3999+ if (pipe_ctx->stream_res.hpo_dp_stream_enc == NULL) {
4000+ pipe_ctx->stream_res.hpo_dp_stream_enc =
4001+ find_first_free_match_hpo_dp_stream_enc_for_link(
4002+ &context->res_ctx, dc->res_pool, pipe_ctx->stream);
4003+
4004+ if (!pipe_ctx->stream_res.hpo_dp_stream_enc)
4005+ return DC_NO_STREAM_ENC_RESOURCE;
4006+
4007+ update_hpo_dp_stream_engine_usage(
4008+ &context->res_ctx, dc->res_pool,
4009+ pipe_ctx->stream_res.hpo_dp_stream_enc,
4010+ true);
4011+ }
4012+
4013+ if (pipe_ctx->link_res.hpo_dp_link_enc == NULL) {
4014+ if (!add_hpo_dp_link_enc_to_ctx(&context->res_ctx, dc->res_pool, pipe_ctx, pipe_ctx->stream))
4015+ return DC_NO_LINK_ENC_RESOURCE;
4016+ }
4017+ } else {
4018+ if (pipe_ctx->stream_res.hpo_dp_stream_enc) {
4019+ update_hpo_dp_stream_engine_usage(
4020+ &context->res_ctx, dc->res_pool,
4021+ pipe_ctx->stream_res.hpo_dp_stream_enc,
4022+ false);
4023+ pipe_ctx->stream_res.hpo_dp_stream_enc = NULL;
4024+ }
4025+ if (pipe_ctx->link_res.hpo_dp_link_enc)
4026+ remove_hpo_dp_link_enc_from_ctx(&context->res_ctx, pipe_ctx, pipe_ctx->stream);
4027+ }
4028+
4029+ return DC_OK;
4030+}
4031+
drivers/gpu/drm/amd/display/dc/core/dc_stat.c+1−0
@@ -65,6 +65,7 @@ void dc_stat_get_dmub_notification(const struct dc *dc, struct dmub_notification · 64 unmodified lines
6565 /* For HPD/HPD RX, convert dpia port index into link index */
6666 if (notify->type == DMUB_NOTIFICATION_HPD ||
6767 notify->type == DMUB_NOTIFICATION_HPD_IRQ ||
68+ notify->type == DMUB_NOTIFICATION_DPIA_NOTIFICATION ||
6869 notify->type == DMUB_NOTIFICATION_SET_CONFIG_REPLY) {
6970 notify->link_index =
7071 get_link_index_from_dpia_port_index(dc, notify->link_index);
drivers/gpu/drm/amd/display/dc/core/dc_stream.c+8−1
@@ -481,6 +481,7 @@ bool dc_stream_add_writeback(struct dc *dc, · 480 unmodified lines
481481 }
482482
483483 if (!isDrc) {
484+ ASSERT(stream->num_wb_info + 1 <= MAX_DWB_PIPES);
484485 stream->writeback_info[stream->num_wb_info++] = *wb_info;
485486 }
486487
@@ -526,6 +527,11 @@ bool dc_stream_remove_writeback(struct dc *dc, · 39 unmodified lines
526527 return false;
527528 }
528529
530+ if (stream->num_wb_info > MAX_DWB_PIPES) {
531+ dm_error("DC: num_wb_info is invalid!\n");
532+ return false;
533+ }
534+
529535 // stream->writeback_info[dwb_pipe_inst].wb_enabled = false;
530536 for (i = 0; i < stream->num_wb_info; i++) {
531537 /*dynamic update*/
@@ -540,7 +546,8 @@ bool dc_stream_remove_writeback(struct dc *dc, · 8 unmodified lines
540546 if (stream->writeback_info[i].wb_enabled) {
541547 if (j < i)
542548 /* trim the array */
543− stream->writeback_info[j] = stream->writeback_info[i];
549+ memcpy(&stream->writeback_info[j], &stream->writeback_info[i],
550+ sizeof(struct dc_writeback_info));
544551 j++;
545552 }
546553 }
drivers/gpu/drm/amd/display/dc/dc.h+2−1
@@ -47,7 +47,7 @@ struct aux_payload; · 46 unmodified lines
4747 struct set_config_cmd_payload;
4848 struct dmub_notification;
4949
50−#define DC_VER "3.2.215"
50+#define DC_VER "3.2.217"
5151
5252 #define MAX_SURFACES 3
5353 #define MAX_PLANES 6
@@ -872,6 +872,7 @@ struct dc_debug_options { · 818 unmodified lines
872872 enum lttpr_mode lttpr_mode_override;
873873 unsigned int dsc_delay_factor_wa_x1000;
874874 unsigned int min_prefetch_in_strobe_ns;
875+ bool disable_unbounded_requesting;
875876 };
876877
877878 struct gpu_info_soc_bounding_box_v1_0;
drivers/gpu/drm/amd/display/dc/dc_dp_types.h+3−1
@@ -149,7 +149,6 @@ struct dc_link_settings { · 148 unmodified lines
149149 enum dc_link_spread link_spread;
150150 bool use_link_rate_set;
151151 uint8_t link_rate_set;
152− bool dpcd_source_device_specific_field_support;
153152 };
154153
155154 union dc_dp_ffe_preset {
@@ -926,6 +925,9 @@ struct dpcd_usb4_dp_tunneling_info { · 770 unmodified lines
926925 #ifndef DP_128b_132b_TRAINING_AUX_RD_INTERVAL
927926 #define DP_128b_132b_TRAINING_AUX_RD_INTERVAL 0x2216
928927 #endif
928+#ifndef DP_LINK_SQUARE_PATTERN
929+#define DP_LINK_SQUARE_PATTERN 0x10F
930+#endif
929931 #ifndef DP_CABLE_ATTRIBUTES_UPDATED_BY_DPRX
930932 #define DP_CABLE_ATTRIBUTES_UPDATED_BY_DPRX 0x2217
931933 #endif
drivers/gpu/drm/amd/display/dc/dc_link.h+9−6
@@ -335,15 +335,18 @@ static inline bool dc_get_edp_link_panel_inst(const struct dc *dc, · 334 unmodified lines
335335 unsigned int *inst_out)
336336 {
337337 struct dc_link *edp_links[MAX_NUM_EDP];
338− int edp_num;
338+ int edp_num, i;
339339
340− if (link->connector_signal != SIGNAL_TYPE_EDP)
340+ *inst_out = 0;
341+ if (link->connector_signal != SIGNAL_TYPE_EDP || !link->local_sink)
341342 return false;
342343 get_edp_links(dc, edp_links, &edp_num);
343− if ((edp_num > 1) && (link->link_index > edp_links[0]->link_index))
344− *inst_out = 1;
345− else
346− *inst_out = 0;
344+ for (i = 0; i < edp_num; i++) {
345+ if (link == edp_links[i])
346+ break;
347+ if (edp_links[i]->local_sink)
348+ (*inst_out)++;
349+ }
347350 return true;
348351 }
349352
drivers/gpu/drm/amd/display/dc/dc_stream.h+1−2
@@ -543,9 +543,8 @@ bool dc_stream_get_crtc_position(struct dc *dc, · 542 unmodified lines
543543 unsigned int *nom_v_pos);
544544
545545 #if defined(CONFIG_DRM_AMD_SECURE_DISPLAY)
546−bool dc_stream_forward_crc_window(struct dc *dc,
546+bool dc_stream_forward_crc_window(struct dc_stream_state *stream,
547547 struct rect *rect,
548− struct dc_stream_state *stream,
549548 bool is_stop);
550549 #endif
551550
drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c+13−0
@@ -1142,6 +1142,10 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx) · 1141 unmodified lines
11421142 struct dc_link *link = stream->link;
11431143 struct dc *dc = pipe_ctx->stream->ctx->dc;
11441144 const struct link_hwss *link_hwss = get_link_hwss(link, &pipe_ctx->link_res);
1145+ struct dccg *dccg = dc->res_pool->dccg;
1146+ struct timing_generator *tg = pipe_ctx->stream_res.tg;
1147+ struct dtbclk_dto_params dto_params = {0};
1148+ int dp_hpo_inst;
11451149
11461150 if (dc_is_hdmi_tmds_signal(pipe_ctx->stream->signal)) {
11471151 pipe_ctx->stream_res.stream_enc->funcs->stop_hdmi_info_packets(
@@ -1161,6 +1165,15 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx) · 13 unmodified lines
11611165
11621166 link_hwss->reset_stream_encoder(pipe_ctx);
11631167
1168+ if (is_dp_128b_132b_signal(pipe_ctx)) {
1169+ dto_params.otg_inst = tg->inst;
1170+ dto_params.timing = &pipe_ctx->stream->timing;
1171+ dp_hpo_inst = pipe_ctx->stream_res.hpo_dp_stream_enc->inst;
1172+ dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
1173+ dccg->funcs->disable_symclk32_se(dccg, dp_hpo_inst);
1174+ dccg->funcs->set_dpstreamclk(dccg, REFCLK, tg->inst, dp_hpo_inst);
1175+ }
1176+
11641177 if (is_dp_128b_132b_signal(pipe_ctx)) {
11651178 /* TODO: This looks like a bug to me as we are disabling HPO IO when
11661179 * we are just disabling a single HPO stream. Shouldn't we disable HPO
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dsc.c+0−1
@@ -200,7 +200,6 @@ static void dsc2_set_config(struct display_stream_compressor *dsc, const struct · 199 unmodified lines
200200 bool is_config_ok;
201201 struct dcn20_dsc *dsc20 = TO_DCN20_DSC(dsc);
202202
203− DC_LOG_DSC(" ");
204203 DC_LOG_DSC("Setting DSC Config at DSC inst %d", dsc->inst);
205204 dsc_config_log(dsc, dsc_cfg);
206205 is_config_ok = dsc_prepare_config(dsc_cfg, &dsc20->reg_vals, dsc_optc_cfg);
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hwseq.c+86−0
@@ -582,6 +582,9 @@ void dcn20_plane_atomic_disable(struct dc *dc, struct pipe_ctx *pipe_ctx) · 581 unmodified lines
582582 if (pipe_ctx->stream_res.gsl_group != 0)
583583 dcn20_setup_gsl_group_as_lock(dc, pipe_ctx, false);
584584
585+ if (hubp->funcs->hubp_update_mall_sel)
586+ hubp->funcs->hubp_update_mall_sel(hubp, 0, false);
587+
585588 dc->hwss.set_flip_control_gsl(pipe_ctx, false);
586589
587590 hubp->funcs->hubp_clk_cntl(hubp, false);
@@ -605,6 +608,9 @@ void dcn20_plane_atomic_disable(struct dc *dc, struct pipe_ctx *pipe_ctx) · 17 unmodified lines
605608
606609 void dcn20_disable_plane(struct dc *dc, struct pipe_ctx *pipe_ctx)
607610 {
611+ bool is_phantom = pipe_ctx->plane_state && pipe_ctx->plane_state->is_phantom;
612+ struct timing_generator *tg = is_phantom ? pipe_ctx->stream_res.tg : NULL;
613+
608614 DC_LOGGER_INIT(dc->ctx->logger);
609615
610616 if (!pipe_ctx->plane_res.hubp || pipe_ctx->plane_res.hubp->power_gated)
@@ -612,6 +618,12 @@ void dcn20_disable_plane(struct dc *dc, struct pipe_ctx *pipe_ctx) · 1 unmodified line
612618
613619 dcn20_plane_atomic_disable(dc, pipe_ctx);
614620
621+ /* Turn back off the phantom OTG after the phantom plane is fully disabled
622+ */
623+ if (is_phantom)
624+ if (tg && tg->funcs->disable_phantom_crtc)
625+ tg->funcs->disable_phantom_crtc(tg);
626+
615627 DC_LOG_DC("Power down front end %d\n",
616628 pipe_ctx->pipe_idx);
617629 }
@@ -1803,6 +1815,18 @@ void dcn20_program_front_end_for_ctx( · 1185 unmodified lines
18031815 dcn20_detect_pipe_changes(&dc->current_state->res_ctx.pipe_ctx[i],
18041816 &context->res_ctx.pipe_ctx[i]);
18051817
1818+ /* When disabling phantom pipes, turn on phantom OTG first (so we can get double
1819+ * buffer updates properly)
1820+ */
1821+ for (i = 0; i < dc->res_pool->pipe_count; i++)
1822+ if (context->res_ctx.pipe_ctx[i].update_flags.bits.disable
1823+ && dc->current_state->res_ctx.pipe_ctx[i].stream->mall_stream_config.type == SUBVP_PHANTOM) {
1824+ struct timing_generator *tg = dc->current_state->res_ctx.pipe_ctx[i].stream_res.tg;
1825+
1826+ if (tg->funcs->enable_crtc)
1827+ tg->funcs->enable_crtc(tg);
1828+ }
1829+
18061830 /* OTG blank before disabling all front ends */
18071831 for (i = 0; i < dc->res_pool->pipe_count; i++)
18081832 if (context->res_ctx.pipe_ctx[i].update_flags.bits.disable
@@ -2615,6 +2639,37 @@ void dcn20_update_mpcc(struct dc *dc, struct pipe_ctx *pipe_ctx) · 806 unmodified lines
26152639 hubp->mpcc_id = mpcc_id;
26162640 }
26172641
2642+static enum phyd32clk_clock_source get_phyd32clk_src(struct dc_link *link)
2643+{
2644+ switch (link->link_enc->transmitter) {
2645+ case TRANSMITTER_UNIPHY_A:
2646+ return PHYD32CLKA;
2647+ case TRANSMITTER_UNIPHY_B:
2648+ return PHYD32CLKB;
2649+ case TRANSMITTER_UNIPHY_C:
2650+ return PHYD32CLKC;
2651+ case TRANSMITTER_UNIPHY_D:
2652+ return PHYD32CLKD;
2653+ case TRANSMITTER_UNIPHY_E:
2654+ return PHYD32CLKE;
2655+ default:
2656+ return PHYD32CLKA;
2657+ }
2658+}
2659+
2660+static int get_odm_segment_count(struct pipe_ctx *pipe_ctx)
2661+{
2662+ struct pipe_ctx *odm_pipe = pipe_ctx->next_odm_pipe;
2663+ int count = 1;
2664+
2665+ while (odm_pipe != NULL) {
2666+ count++;
2667+ odm_pipe = odm_pipe->next_odm_pipe;
2668+ }
2669+
2670+ return count;
2671+}
2672+
26182673 void dcn20_enable_stream(struct pipe_ctx *pipe_ctx)
26192674 {
26202675 enum dc_lane_count lane_count =
@@ -2628,12 +2683,43 @@ void dcn20_enable_stream(struct pipe_ctx *pipe_ctx) · 7 unmodified lines
26282683 struct timing_generator *tg = pipe_ctx->stream_res.tg;
26292684 const struct link_hwss *link_hwss = get_link_hwss(link, &pipe_ctx->link_res);
26302685 struct dc *dc = pipe_ctx->stream->ctx->dc;
2686+ struct dtbclk_dto_params dto_params = {0};
2687+ struct dccg *dccg = dc->res_pool->dccg;
2688+ enum phyd32clk_clock_source phyd32clk;
2689+ int dp_hpo_inst;
2690+ struct dce_hwseq *hws = dc->hwseq;
2691+ unsigned int k1_div = PIXEL_RATE_DIV_NA;
2692+ unsigned int k2_div = PIXEL_RATE_DIV_NA;
26312693
26322694 if (is_dp_128b_132b_signal(pipe_ctx)) {
26332695 if (dc->hwseq->funcs.setup_hpo_hw_control)
26342696 dc->hwseq->funcs.setup_hpo_hw_control(dc->hwseq, true);
26352697 }
26362698
2699+ if (is_dp_128b_132b_signal(pipe_ctx)) {
2700+ dp_hpo_inst = pipe_ctx->stream_res.hpo_dp_stream_enc->inst;
2701+ dccg->funcs->set_dpstreamclk(dccg, DTBCLK0, tg->inst, dp_hpo_inst);
2702+
2703+ phyd32clk = get_phyd32clk_src(link);
2704+ dccg->funcs->enable_symclk32_se(dccg, dp_hpo_inst, phyd32clk);
2705+
2706+ dto_params.otg_inst = tg->inst;
2707+ dto_params.pixclk_khz = pipe_ctx->stream->timing.pix_clk_100hz / 10;
2708+ dto_params.num_odm_segments = get_odm_segment_count(pipe_ctx);
2709+ dto_params.timing = &pipe_ctx->stream->timing;
2710+ dto_params.ref_dtbclk_khz = dc->clk_mgr->funcs->get_dtb_ref_clk_frequency(dc->clk_mgr);
2711+ dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
2712+ }
2713+
2714+ if (hws->funcs.calculate_dccg_k1_k2_values && dc->res_pool->dccg->funcs->set_pixel_rate_div) {
2715+ hws->funcs.calculate_dccg_k1_k2_values(pipe_ctx, &k1_div, &k2_div);
2716+
2717+ dc->res_pool->dccg->funcs->set_pixel_rate_div(
2718+ dc->res_pool->dccg,
2719+ pipe_ctx->stream_res.tg->inst,
2720+ k1_div, k2_div);
2721+ }
2722+
26372723 link_hwss->setup_stream_encoder(pipe_ctx);
26382724
26392725 if (pipe_ctx->plane_state && pipe_ctx->plane_state->flip_immediate != 1) {
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_resource.c+3−0
@@ -1389,6 +1389,9 @@ enum dc_status dcn20_add_dsc_to_stream_resource(struct dc *dc, · 1388 unmodified lines
13891389 for (i = 0; i < dc->res_pool->pipe_count; i++) {
13901390 struct pipe_ctx *pipe_ctx = &dc_ctx->res_ctx.pipe_ctx[i];
13911391
1392+ if (pipe_ctx->top_pipe)
1393+ continue;
1394+
13921395 if (pipe_ctx->stream != dc_stream)
13931396 continue;
13941397
drivers/gpu/drm/amd/display/dc/dcn301/dcn301_resource.c+2−1
@@ -1414,7 +1414,8 @@ static struct resource_funcs dcn301_res_pool_funcs = { · 1413 unmodified lines
14141414 .find_first_free_match_stream_enc_for_link = dcn10_find_first_free_match_stream_enc_for_link,
14151415 .acquire_post_bldn_3dlut = dcn30_acquire_post_bldn_3dlut,
14161416 .release_post_bldn_3dlut = dcn30_release_post_bldn_3dlut,
1417− .update_bw_bounding_box = dcn301_update_bw_bounding_box
1417+ .update_bw_bounding_box = dcn301_update_bw_bounding_box,
1418+ .patch_unknown_plane_state = dcn20_patch_unknown_plane_state
14181419 };
14191420
14201421 static bool dcn301_resource_construct(
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hpo_dp_link_encoder.c+4−1
@@ -242,7 +242,10 @@ void dcn31_hpo_dp_link_enc_set_link_test_pattern( · 241 unmodified lines
242242 REG_UPDATE(DP_DPHY_SYM32_CONTROL,
243243 MODE, DP2_TEST_PATTERN);
244244 break;
245− case DP_TEST_PATTERN_SQUARE_PULSE:
245+ case DP_TEST_PATTERN_SQUARE:
246+ case DP_TEST_PATTERN_SQUARE_PRESHOOT_DISABLED:
247+ case DP_TEST_PATTERN_SQUARE_DEEMPHASIS_DISABLED:
248+ case DP_TEST_PATTERN_SQUARE_PRESHOOT_DEEMPHASIS_DISABLED:
246249 REG_SET(DP_DPHY_SYM32_TP_SQ_PULSE, 0,
247250 TP_SQ_PULSE_WIDTH, tp_params->custom_pattern[0]);
248251
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.c+0−40
@@ -623,43 +623,3 @@ void dcn31_setup_hpo_hw_control(const struct dce_hwseq *hws, bool enable) · 622 unmodified lines
623623 if (hws->ctx->dc->debug.hpo_optimization)
624624 REG_UPDATE(HPO_TOP_HW_CONTROL, HPO_IO_EN, !!enable);
625625 }
626−void dcn31_set_drr(struct pipe_ctx **pipe_ctx,
627− int num_pipes, struct dc_crtc_timing_adjust adjust)
628−{
629− int i = 0;
630− struct drr_params params = {0};
631− unsigned int event_triggers = 0x2;/*Bit[1]: OTG_TRIG_A*/
632− unsigned int num_frames = 2;
633− params.vertical_total_max = adjust.v_total_max;
634− params.vertical_total_min = adjust.v_total_min;
635− params.vertical_total_mid = adjust.v_total_mid;
636− params.vertical_total_mid_frame_num = adjust.v_total_mid_frame_num;
637− for (i = 0; i < num_pipes; i++) {
638− if ((pipe_ctx[i]->stream_res.tg != NULL) && pipe_ctx[i]->stream_res.tg->funcs) {
639− if (pipe_ctx[i]->stream_res.tg->funcs->set_drr)
640− pipe_ctx[i]->stream_res.tg->funcs->set_drr(
641− pipe_ctx[i]->stream_res.tg, &params);
642− if (adjust.v_total_max != 0 && adjust.v_total_min != 0)
643− if (pipe_ctx[i]->stream_res.tg->funcs->set_static_screen_control)
644− pipe_ctx[i]->stream_res.tg->funcs->set_static_screen_control(
645− pipe_ctx[i]->stream_res.tg,
646− event_triggers, num_frames);
647− }
648− }
649−}
650−void dcn31_set_static_screen_control(struct pipe_ctx **pipe_ctx,
651− int num_pipes, const struct dc_static_screen_params *params)
652−{
653− unsigned int i;
654− unsigned int triggers = 0;
655− if (params->triggers.surface_update)
656− triggers |= 0x600;/*bit 9 and bit10 : 110 0000 0000*/
657− if (params->triggers.cursor_update)
658− triggers |= 0x10;/*bit4*/
659− if (params->triggers.force_trigger)
660− triggers |= 0x1;
661− for (i = 0; i < num_pipes; i++)
662− pipe_ctx[i]->stream_res.tg->funcs->
663− set_static_screen_control(pipe_ctx[i]->stream_res.tg,
664− triggers, params->num_frames);
665−}
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_hwseq.h+0−4
@@ -56,8 +56,4 @@ bool dcn31_is_abm_supported(struct dc *dc, · 55 unmodified lines
5656 void dcn31_init_pipes(struct dc *dc, struct dc_state *context);
5757 void dcn31_setup_hpo_hw_control(const struct dce_hwseq *hws, bool enable);
5858
59−void dcn31_set_static_screen_control(struct pipe_ctx **pipe_ctx,
60− int num_pipes, const struct dc_static_screen_params *params);
61−void dcn31_set_drr(struct pipe_ctx **pipe_ctx,
62− int num_pipes, struct dc_crtc_timing_adjust adjust);
6359 #endif /* __DC_HWSS_DCN31_H__ */
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_init.c+2−2
@@ -64,9 +64,9 @@ static const struct hw_sequencer_funcs dcn31_funcs = { · 63 unmodified lines
6464 .prepare_bandwidth = dcn20_prepare_bandwidth,
6565 .optimize_bandwidth = dcn20_optimize_bandwidth,
6666 .update_bandwidth = dcn20_update_bandwidth,
67− .set_drr = dcn31_set_drr,
67+ .set_drr = dcn10_set_drr,
6868 .get_position = dcn10_get_position,
69− .set_static_screen_control = dcn31_set_static_screen_control,
69+ .set_static_screen_control = dcn10_set_static_screen_control,
7070 .setup_stereo = dcn10_setup_stereo,
7171 .set_avmute = dcn30_set_avmute,
7272 .log_hw_state = dcn10_log_hw_state,
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_optc.c+1−28
@@ -40,7 +40,6 @@ · 39 unmodified lines
4040 #define FN(reg_name, field_name) \
4141 optc1->tg_shift->field_name, optc1->tg_mask->field_name
4242
43−#define STATIC_SCREEN_EVENT_MASK_DRR_DOUBLE_BUFFER_UPDATE_EN 0x2000 /*bit 13*/
4443 static void optc31_set_odm_combine(struct timing_generator *optc, int *opp_id, int opp_cnt,
4544 struct dc_crtc_timing *timing)
4645 {
@@ -232,32 +231,6 @@ void optc3_init_odm(struct timing_generator *optc) · 185 unmodified lines
232231 OPTC_MEM_SEL, 0);
233232 optc1->opp_count = 1;
234233 }
235−void optc31_set_static_screen_control(
236− struct timing_generator *optc,
237− uint32_t event_triggers,
238− uint32_t num_frames)
239−{
240− struct optc *optc1 = DCN10TG_FROM_TG(optc);
241− uint32_t framecount;
242− uint32_t events;
243−
244− if (num_frames > 0xFF)
245− num_frames = 0xFF;
246− REG_GET_2(OTG_STATIC_SCREEN_CONTROL,
247− OTG_STATIC_SCREEN_EVENT_MASK, &events,
248− OTG_STATIC_SCREEN_FRAME_COUNT, &framecount);
249−
250− if (events == event_triggers && num_frames == framecount)
251− return;
252− if ((event_triggers & STATIC_SCREEN_EVENT_MASK_DRR_DOUBLE_BUFFER_UPDATE_EN)
253− != 0)
254− event_triggers = event_triggers &
255− ~STATIC_SCREEN_EVENT_MASK_DRR_DOUBLE_BUFFER_UPDATE_EN;
256−
257− REG_UPDATE_2(OTG_STATIC_SCREEN_CONTROL,
258− OTG_STATIC_SCREEN_EVENT_MASK, event_triggers,
259− OTG_STATIC_SCREEN_FRAME_COUNT, num_frames);
260−}
261234
262235 static struct timing_generator_funcs dcn31_tg_funcs = {
263236 .validate_timing = optc1_validate_timing,
@@ -293,7 +266,7 @@ static struct timing_generator_funcs dcn31_tg_funcs = { · 29 unmodified lines
293266 .set_drr = optc31_set_drr,
294267 .get_last_used_drr_vtotal = optc2_get_last_used_drr_vtotal,
295268 .set_vtotal_min_max = optc1_set_vtotal_min_max,
296− .set_static_screen_control = optc31_set_static_screen_control,
269+ .set_static_screen_control = optc1_set_static_screen_control,
297270 .program_stereo = optc1_program_stereo,
298271 .is_stereo_left_eye = optc1_is_stereo_left_eye,
299272 .tg_init = optc3_tg_init,
drivers/gpu/drm/amd/display/dc/dcn31/dcn31_optc.h+1−4
@@ -263,8 +263,5 @@ bool optc31_immediate_disable_crtc(struct timing_generator *optc); · 262 unmodified lines
263263 void optc31_set_drr(struct timing_generator *optc, const struct drr_params *params);
264264
265265 void optc3_init_odm(struct timing_generator *optc);
266−void optc31_set_static_screen_control(
267− struct timing_generator *optc,
268− uint32_t event_triggers,
269− uint32_t num_frames);
266+
270267 #endif /* __DC_OPTC_DCN31_H__ */
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_dio_stream_encoder.c+3−3
@@ -278,10 +278,10 @@ static void enc314_stream_encoder_dp_blank( · 277 unmodified lines
278278 struct dc_link *link,
279279 struct stream_encoder *enc)
280280 {
281− /* New to DCN314 - disable the FIFO before VID stream disable. */
282− enc314_disable_fifo(enc);
283−
284281 enc1_stream_encoder_dp_blank(link, enc);
282+
283+ /* Disable FIFO after the DP vid stream is disabled to avoid corruption. */
284+ enc314_disable_fifo(enc);
285285 }
286286
287287 static void enc314_stream_encoder_dp_unblank(
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_init.c+2−2
@@ -66,9 +66,9 @@ static const struct hw_sequencer_funcs dcn314_funcs = { · 65 unmodified lines
6666 .prepare_bandwidth = dcn20_prepare_bandwidth,
6767 .optimize_bandwidth = dcn20_optimize_bandwidth,
6868 .update_bandwidth = dcn20_update_bandwidth,
69− .set_drr = dcn31_set_drr,
69+ .set_drr = dcn10_set_drr,
7070 .get_position = dcn10_get_position,
71− .set_static_screen_control = dcn31_set_static_screen_control,
71+ .set_static_screen_control = dcn10_set_static_screen_control,
7272 .setup_stereo = dcn10_setup_stereo,
7373 .set_avmute = dcn30_set_avmute,
7474 .log_hw_state = dcn10_log_hw_state,
drivers/gpu/drm/amd/display/dc/dcn314/dcn314_optc.c+1−2
@@ -228,7 +228,7 @@ static struct timing_generator_funcs dcn314_tg_funcs = { · 227 unmodified lines
228228 .set_drr = optc31_set_drr,
229229 .get_last_used_drr_vtotal = optc2_get_last_used_drr_vtotal,
230230 .set_vtotal_min_max = optc1_set_vtotal_min_max,
231− .set_static_screen_control = optc31_set_static_screen_control,
231+ .set_static_screen_control = optc1_set_static_screen_control,
232232 .program_stereo = optc1_program_stereo,
233233 .is_stereo_left_eye = optc1_is_stereo_left_eye,
234234 .tg_init = optc3_tg_init,
@@ -241,7 +241,6 @@ static struct timing_generator_funcs dcn314_tg_funcs = { · 6 unmodified lines
241241 .set_dsc_config = optc3_set_dsc_config,
242242 .get_dsc_status = optc2_get_dsc_status,
243243 .set_dwb_source = NULL,
244− .set_odm_combine = optc314_set_odm_combine,
245244 .get_optc_source = optc2_get_optc_source,
246245 .set_out_mux = optc3_set_out_mux,
247246 .set_drr_trigger_window = optc3_set_drr_trigger_window,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.c+38−1
@@ -188,7 +188,8 @@ static bool dcn32_check_no_memory_request_for_cab(struct dc *dc) · 187 unmodified lines
188188
189189 /* First, check no-memory-request case */
190190 for (i = 0; i < dc->current_state->stream_count; i++) {
191− if (dc->current_state->stream_status[i].plane_count)
191+ if ((dc->current_state->stream_status[i].plane_count) &&
192+ (dc->current_state->streams[i]->link->psr_settings.psr_version == DC_PSR_VERSION_UNSUPPORTED))
192193 /* Fail eligibility on a visible stream */
193194 break;
194195 }
@@ -1450,3 +1451,39 @@ void dcn32_update_dsc_pg(struct dc *dc, · 1255 unmodified lines
14501451 }
14511452 }
14521453 }
1454+
1455+void dcn32_enable_phantom_streams(struct dc *dc, struct dc_state *context)
1456+{
1457+ unsigned int i;
1458+
1459+ for (i = 0; i < dc->res_pool->pipe_count; i++) {
1460+ struct pipe_ctx *pipe = &context->res_ctx.pipe_ctx[i];
1461+ struct pipe_ctx *old_pipe = &dc->current_state->res_ctx.pipe_ctx[i];
1462+
1463+ /* If an active, non-phantom pipe is being transitioned into a phantom
1464+ * pipe, wait for the double buffer update to complete first before we do
1465+ * ANY phantom pipe programming.
1466+ */
1467+ if (pipe->stream && pipe->stream->mall_stream_config.type == SUBVP_PHANTOM &&
1468+ old_pipe->stream && old_pipe->stream->mall_stream_config.type != SUBVP_PHANTOM) {
1469+ old_pipe->stream_res.tg->funcs->wait_for_state(
1470+ old_pipe->stream_res.tg,
1471+ CRTC_STATE_VBLANK);
1472+ old_pipe->stream_res.tg->funcs->wait_for_state(
1473+ old_pipe->stream_res.tg,
1474+ CRTC_STATE_VACTIVE);
1475+ }
1476+ }
1477+ for (i = 0; i < dc->res_pool->pipe_count; i++) {
1478+ struct pipe_ctx *new_pipe = &context->res_ctx.pipe_ctx[i];
1479+
1480+ if (new_pipe->stream && new_pipe->stream->mall_stream_config.type == SUBVP_PHANTOM) {
1481+ // If old context or new context has phantom pipes, apply
1482+ // the phantom timings now. We can't change the phantom
1483+ // pipe configuration safely without driver acquiring
1484+ // the DMCUB lock first.
1485+ dc->hwss.apply_ctx_to_hw(dc, context);
1486+ break;
1487+ }
1488+ }
1489+}
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_hwseq.h+2−0
@@ -102,4 +102,6 @@ void dcn32_update_dsc_pg(struct dc *dc, · 101 unmodified lines
102102 struct dc_state *context,
103103 bool safe_to_disable);
104104
105+void dcn32_enable_phantom_streams(struct dc *dc, struct dc_state *context);
106+
105107 #endif /* __DC_HWSS_DCN32_H__ */
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_init.c+1−0
@@ -106,6 +106,7 @@ static const struct hw_sequencer_funcs dcn32_funcs = { · 105 unmodified lines
106106 .set_disp_pattern_generator = dcn30_set_disp_pattern_generator,
107107 .get_dcc_en_bits = dcn10_get_dcc_en_bits,
108108 .commit_subvp_config = dcn32_commit_subvp_config,
109+ .enable_phantom_streams = dcn32_enable_phantom_streams,
109110 .subvp_pipe_control_lock = dcn32_subvp_pipe_control_lock,
110111 .update_visual_confirm_color = dcn20_update_visual_confirm_color,
111112 .update_phantom_vp_position = dcn32_update_phantom_vp_position,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.c+1−0
@@ -726,6 +726,7 @@ static const struct dc_debug_options debug_defaults_drv = { · 725 unmodified lines
726726 .allow_sw_cursor_fallback = false, // Linux can't do SW cursor "fallback"
727727 .alloc_extra_way_for_cursor = true,
728728 .min_prefetch_in_strobe_ns = 60000, // 60us
729+ .disable_unbounded_requesting = false,
729730 };
730731
731732 static const struct dc_debug_options debug_defaults_diags = {
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource.h+1−0
@@ -112,6 +112,7 @@ bool dcn32_subvp_in_use(struct dc *dc, · 111 unmodified lines
112112 bool dcn32_mpo_in_use(struct dc_state *context);
113113
114114 bool dcn32_any_surfaces_rotated(struct dc *dc, struct dc_state *context);
115+bool dcn32_is_center_timing(struct pipe_ctx *pipe);
115116
116117 struct pipe_ctx *dcn32_acquire_idle_pipe_for_head_pipe_in_layer(
117118 struct dc_state *state,
drivers/gpu/drm/amd/display/dc/dcn32/dcn32_resource_helpers.c+15−1
@@ -255,6 +255,19 @@ bool dcn32_any_surfaces_rotated(struct dc *dc, struct dc_state *context) · 254 unmodified lines
255255 return false;
256256 }
257257
258+bool dcn32_is_center_timing(struct pipe_ctx *pipe)
259+{
260+ bool is_center_timing = false;
261+
262+ if (pipe->stream) {
263+ if (pipe->stream->timing.v_addressable != pipe->stream->dst.height ||
264+ pipe->stream->timing.v_addressable != pipe->stream->src.height) {
265+ is_center_timing = true;
266+ }
267+ }
268+ return is_center_timing;
269+}
270+
258271 /**
259272 * *******************************************************************************************
260273 * dcn32_determine_det_override: Determine DET allocation for each pipe
@@ -357,6 +370,7 @@ void dcn32_set_det_allocations(struct dc *dc, struct dc_state *context, · 96 unmodified lines
357370 int i, pipe_cnt;
358371 struct resource_context *res_ctx = &context->res_ctx;
359372 struct pipe_ctx *pipe;
373+ bool disable_unbounded_requesting = dc->debug.disable_z9_mpc || dc->debug.disable_unbounded_requesting;
360374
361375 for (i = 0, pipe_cnt = 0; i < dc->res_pool->pipe_count; i++) {
362376
@@ -373,7 +387,7 @@ void dcn32_set_det_allocations(struct dc *dc, struct dc_state *context, · 10 unmodified lines
373387 */
374388 if (pipe_cnt == 1) {
375389 pipes[0].pipe.src.det_size_override = DCN3_2_MAX_DET_SIZE;
376− if (pipe->plane_state && !dc->debug.disable_z9_mpc && pipe->plane_state->tiling_info.gfx9.swizzle != DC_SW_LINEAR) {
390+ if (pipe->plane_state && !disable_unbounded_requesting && pipe->plane_state->tiling_info.gfx9.swizzle != DC_SW_LINEAR) {
377391 if (!is_dual_plane(pipe->plane_state->format)) {
378392 pipes[0].pipe.src.det_size_override = DCN3_2_DEFAULT_DET_SIZE;
379393 pipes[0].pipe.src.unbounded_req_mode = true;
drivers/gpu/drm/amd/display/dc/dcn321/dcn321_resource.c+1−0
@@ -724,6 +724,7 @@ static const struct dc_debug_options debug_defaults_drv = { · 723 unmodified lines
724724 .allow_sw_cursor_fallback = false, // Linux can't do SW cursor "fallback"
725725 .alloc_extra_way_for_cursor = true,
726726 .min_prefetch_in_strobe_ns = 60000, // 60us
727+ .disable_unbounded_requesting = false,
727728 };
728729
729730 static const struct dc_debug_options debug_defaults_diags = {
drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c+21−4
@@ -691,7 +691,7 @@ static bool dcn32_assign_subvp_pipe(struct dc *dc, · 690 unmodified lines
691691 * to combine this with SubVP can cause issues with the scheduling).
692692 * - Not TMZ surface
693693 */
694− if (pipe->plane_state && !pipe->top_pipe &&
694+ if (pipe->plane_state && !pipe->top_pipe && !dcn32_is_center_timing(pipe) &&
695695 pipe->stream->mall_stream_config.type == SUBVP_NONE && refresh_rate < 120 && !pipe->plane_state->address.tmz_surface &&
696696 vba->ActiveDRAMClockChangeLatencyMarginPerState[vba->VoltageLevel][vba->maxMpcComb][vba->pipe_plane[pipe_idx]] <= 0) {
697697 while (pipe) {
@@ -979,8 +979,11 @@ static bool subvp_vblank_schedulable(struct dc *dc, struct dc_state *context) · 281 unmodified lines
979979 }
980980 // Use ignore_msa_timing_param flag to identify as DRR
981981 if (found && context->res_ctx.pipe_ctx[vblank_index].stream->ignore_msa_timing_param) {
982− // SUBVP + DRR case
983− schedulable = subvp_drr_schedulable(dc, context, &context->res_ctx.pipe_ctx[vblank_index]);
982+ // SUBVP + DRR case -- don't enable SubVP + DRR for HDMI VRR cases
983+ if (context->res_ctx.pipe_ctx[vblank_index].stream->allow_freesync)
984+ schedulable = subvp_drr_schedulable(dc, context, &context->res_ctx.pipe_ctx[vblank_index]);
985+ else
986+ schedulable = false;
984987 } else if (found) {
985988 main_timing = &subvp_pipe->stream->timing;
986989 phantom_timing = &subvp_pipe->stream->mall_stream_config.paired_stream->timing;
@@ -1169,6 +1172,16 @@ static void dcn32_full_validate_bw_helper(struct dc *dc, · 182 unmodified lines
11691172 pipes[0].clks_cfg.dppclk_mhz = get_dppclk_calculated(&context->bw_ctx.dml, pipes, *pipe_cnt, 0);
11701173 *vlevel = dml_get_voltage_level(&context->bw_ctx.dml, pipes, *pipe_cnt);
11711174
1175+ /* Check that vlevel requested supports pstate or not
1176+ * if not, select the lowest vlevel that supports it
1177+ */
1178+ for (i = *vlevel; i < context->bw_ctx.dml.soc.num_states; i++) {
1179+ if (vba->DRAMClockChangeSupport[i][vba->maxMpcComb] != dm_dram_clock_change_unsupported) {
1180+ *vlevel = i;
1181+ break;
1182+ }
1183+ }
1184+
11721185 if (*vlevel < context->bw_ctx.dml.soc.num_states &&
11731186 vba->DRAMClockChangeSupport[*vlevel][vba->maxMpcComb] != dm_dram_clock_change_unsupported
11741187 && subvp_validate_static_schedulability(dc, context, *vlevel)) {
@@ -1185,7 +1198,7 @@ static void dcn32_full_validate_bw_helper(struct dc *dc, · 10 unmodified lines
11851198 pipe->stream->mall_stream_config.type == SUBVP_NONE) {
11861199 non_subvp_pipes++;
11871200 // Use ignore_msa_timing_param flag to identify as DRR
1188− if (pipe->stream->ignore_msa_timing_param) {
1201+ if (pipe->stream->ignore_msa_timing_param && pipe->stream->allow_freesync) {
11891202 drr_pipe_found = true;
11901203 drr_pipe_index = i;
11911204 }
@@ -1551,6 +1564,7 @@ bool dcn32_internal_validate_bw(struct dc *dc, · 359 unmodified lines
15511564 context->bw_ctx.dml.soc.allow_for_pstate_or_stutter_in_vblank_final =
15521565 dm_prefetch_support_fclk_and_stutter;
15531566
1567+ context->bw_ctx.dml.validate_max_state = fast_validate;
15541568 vlevel = dml_get_voltage_level(&context->bw_ctx.dml, pipes, pipe_cnt);
15551569
15561570 /* Last attempt with Prefetch mode 2 (dm_prefetch_support_stutter == 3) */
@@ -1559,6 +1573,7 @@ bool dcn32_internal_validate_bw(struct dc *dc, · 2 unmodified lines
15591573 dm_prefetch_support_stutter;
15601574 vlevel = dml_get_voltage_level(&context->bw_ctx.dml, pipes, pipe_cnt);
15611575 }
1576+ context->bw_ctx.dml.validate_max_state = false;
15621577
15631578 if (vlevel < context->bw_ctx.dml.soc.num_states) {
15641579 memset(split, 0, sizeof(split));
@@ -1645,6 +1660,7 @@ bool dcn32_internal_validate_bw(struct dc *dc, · 80 unmodified lines
16451660 dcn20_release_dsc(&context->res_ctx, dc->res_pool, &pipe->stream_res.dsc);
16461661 memset(&pipe->plane_res, 0, sizeof(pipe->plane_res));
16471662 memset(&pipe->stream_res, 0, sizeof(pipe->stream_res));
1663+ memset(&pipe->link_res, 0, sizeof(pipe->link_res));
16481664 repopulate_pipes = true;
16491665 } else if (pipe->top_pipe && pipe->top_pipe->plane_state == pipe->plane_state) {
16501666 struct pipe_ctx *top_pipe = pipe->top_pipe;
@@ -1660,6 +1676,7 @@ bool dcn32_internal_validate_bw(struct dc *dc, · 9 unmodified lines
16601676 pipe->stream = NULL;
16611677 memset(&pipe->plane_res, 0, sizeof(pipe->plane_res));
16621678 memset(&pipe->stream_res, 0, sizeof(pipe->stream_res));
1679+ memset(&pipe->link_res, 0, sizeof(pipe->link_res));
16631680 repopulate_pipes = true;
16641681 } else
16651682 ASSERT(0); /* Should never try to merge master pipe */
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c+20−17
@@ -1707,7 +1707,7 @@ static void mode_support_configuration(struct vba_vars_st *v, · 1706 unmodified lines
17071707 void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_lib)
17081708 {
17091709 struct vba_vars_st *v = &mode_lib->vba;
1710− int i, j;
1710+ int i, j, start_state;
17111711 unsigned int k, m;
17121712 unsigned int MaximumMPCCombine;
17131713 unsigned int NumberOfNonCombinedSurfaceOfMaximumBandwidth;
@@ -1720,7 +1720,10 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 6 unmodified lines
17201720 #endif
17211721
17221722 /*MODE SUPPORT, VOLTAGE STATE AND SOC CONFIGURATION*/
1723−
1723+ if (mode_lib->validate_max_state)
1724+ start_state = v->soc.num_states - 1;
1725+ else
1726+ start_state = 0;
17241727 /*Scale Ratio, taps Support Check*/
17251728
17261729 mode_lib->vba.ScaleRatioAndTapsSupport = true;
@@ -2009,7 +2012,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 282 unmodified lines
20092012 mode_lib->vba.MPCCombineMethodIncompatible = v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.MPCCombineMethodAsNeededForPStateChangeAndVoltage
20102013 && v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.MPCCombineMethodAsPossible;
20112014
2012− for (i = 0; i < v->soc.num_states; i++) {
2015+ for (i = start_state; i < v->soc.num_states; i++) {
20132016 for (j = 0; j < 2; j++) {
20142017 mode_lib->vba.TotalNumberOfActiveDPP[i][j] = 0;
20152018 mode_lib->vba.TotalAvailablePipesSupport[i][j] = true;
@@ -2286,7 +2289,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 270 unmodified lines
22862289 }
22872290 }
22882291
2289− for (i = 0; i < v->soc.num_states; ++i) {
2292+ for (i = start_state; i < v->soc.num_states; ++i) {
22902293 mode_lib->vba.ExceededMultistreamSlots[i] = false;
22912294 for (k = 0; k < mode_lib->vba.NumberOfActiveSurfaces; ++k) {
22922295 if (mode_lib->vba.OutputMultistreamEn[k] == true && mode_lib->vba.OutputMultistreamId[k] == k) {
@@ -2386,7 +2389,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 93 unmodified lines
23862389 }
23872390 }
23882391
2389− for (i = 0; i < v->soc.num_states; ++i) {
2392+ for (i = start_state; i < v->soc.num_states; ++i) {
23902393 mode_lib->vba.DTBCLKRequiredMoreThanSupported[i] = false;
23912394 for (k = 0; k < mode_lib->vba.NumberOfActiveSurfaces; ++k) {
23922395 if (mode_lib->vba.BlendingAndTiming[k] == k
@@ -2403,7 +2406,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 10 unmodified lines
24032406 }
24042407 }
24052408
2406− for (i = 0; i < v->soc.num_states; ++i) {
2409+ for (i = start_state; i < v->soc.num_states; ++i) {
24072410 mode_lib->vba.ODMCombine2To1SupportCheckOK[i] = true;
24082411 mode_lib->vba.ODMCombine4To1SupportCheckOK[i] = true;
24092412 for (k = 0; k < mode_lib->vba.NumberOfActiveSurfaces; ++k) {
@@ -2421,7 +2424,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 11 unmodified lines
24212424 }
24222425 }
24232426
2424− for (i = 0; i < v->soc.num_states; i++) {
2427+ for (i = start_state; i < v->soc.num_states; i++) {
24252428 mode_lib->vba.DSCCLKRequiredMoreThanSupported[i] = false;
24262429 for (k = 0; k <= mode_lib->vba.NumberOfActiveSurfaces - 1; k++) {
24272430 if (mode_lib->vba.BlendingAndTiming[k] == k) {
@@ -2458,7 +2461,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 30 unmodified lines
24582461 /* Check DSC Unit and Slices Support */
24592462 v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.TotalDSCUnitsRequired = 0;
24602463
2461− for (i = 0; i < v->soc.num_states; ++i) {
2464+ for (i = start_state; i < v->soc.num_states; ++i) {
24622465 mode_lib->vba.NotEnoughDSCUnits[i] = false;
24632466 mode_lib->vba.NotEnoughDSCSlices[i] = false;
24642467 v->dummy_vars.dml32_ModeSupportAndSystemConfigurationFull.TotalDSCUnitsRequired = 0;
@@ -2493,7 +2496,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 28 unmodified lines
24932496 }
24942497
24952498 /*DSC Delay per state*/
2496− for (i = 0; i < v->soc.num_states; ++i) {
2499+ for (i = start_state; i < v->soc.num_states; ++i) {
24972500 for (k = 0; k < mode_lib->vba.NumberOfActiveSurfaces; ++k) {
24982501 mode_lib->vba.DSCDelayPerState[i][k] = dml32_DSCDelayRequirement(
24992502 mode_lib->vba.RequiresDSC[i][k], mode_lib->vba.ODMCombineEnablePerState[i][k],
@@ -2520,7 +2523,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 20 unmodified lines
25202523
25212524 //Calculate Swath, DET Configuration, DCFCLKDeepSleep
25222525 //
2523− for (i = 0; i < (int) v->soc.num_states; ++i) {
2526+ for (i = start_state; i < (int) v->soc.num_states; ++i) {
25242527 for (j = 0; j <= 1; ++j) {
25252528 for (k = 0; k < mode_lib->vba.NumberOfActiveSurfaces; ++k) {
25262529 mode_lib->vba.RequiredDPPCLKThisState[k] = mode_lib->vba.RequiredDPPCLK[i][j][k];
@@ -2655,7 +2658,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 128 unmodified lines
26552658 mode_lib->vba.SurfaceSizeInMALL,
26562659 &mode_lib->vba.ExceededMALLSize);
26572660
2658− for (i = 0; i < v->soc.num_states; i++) {
2661+ for (i = start_state; i < v->soc.num_states; i++) {
26592662 for (j = 0; j < 2; j++) {
26602663 for (k = 0; k <= mode_lib->vba.NumberOfActiveSurfaces - 1; k++) {
26612664 mode_lib->vba.swath_width_luma_ub_this_state[k] =
@@ -2882,7 +2885,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 220 unmodified lines
28822885 }
28832886
28842887 //Calculate Return BW
2885− for (i = 0; i < (int) v->soc.num_states; ++i) {
2888+ for (i = start_state; i < (int) v->soc.num_states; ++i) {
28862889 for (j = 0; j <= 1; ++j) {
28872890 for (k = 0; k <= mode_lib->vba.NumberOfActiveSurfaces - 1; k++) {
28882891 if (mode_lib->vba.BlendingAndTiming[k] == k) {
@@ -2961,7 +2964,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 72 unmodified lines
29612964 &mode_lib->vba.MinPrefetchMode,
29622965 &mode_lib->vba.MaxPrefetchMode);
29632966
2964− for (i = 0; i < (int) v->soc.num_states; ++i) {
2967+ for (i = start_state; i < (int) v->soc.num_states; ++i) {
29652968 for (j = 0; j <= 1; ++j)
29662969 mode_lib->vba.DCFCLKState[i][j] = mode_lib->vba.DCFCLKPerState[i];
29672970 }
@@ -3083,7 +3086,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 115 unmodified lines
30833086 mode_lib->vba.DCFCLKState);
30843087 } // UseMinimumRequiredDCFCLK == true
30853088
3086− for (i = 0; i < (int) v->soc.num_states; ++i) {
3089+ for (i = start_state; i < (int) v->soc.num_states; ++i) {
30873090 for (j = 0; j <= 1; ++j) {
30883091 mode_lib->vba.ReturnBWPerState[i][j] = dml32_get_return_bw_mbps(&mode_lib->vba.soc, i,
30893092 mode_lib->vba.HostVMEnable, mode_lib->vba.DCFCLKState[i][j],
@@ -3092,7 +3095,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 2 unmodified lines
30923095 }
30933096
30943097 //Re-ordering Buffer Support Check
3095− for (i = 0; i < (int) v->soc.num_states; ++i) {
3098+ for (i = start_state; i < (int) v->soc.num_states; ++i) {
30963099 for (j = 0; j <= 1; ++j) {
30973100 if ((mode_lib->vba.ROBBufferSizeInKByte - mode_lib->vba.PixelChunkSizeInKByte) * 1024
30983101 / mode_lib->vba.ReturnBWPerState[i][j]
@@ -3114,7 +3117,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 15 unmodified lines
31143117 + mode_lib->vba.ReadBandwidthChroma[k];
31153118 }
31163119
3117− for (i = 0; i < (int) v->soc.num_states; ++i) {
3120+ for (i = start_state; i < (int) v->soc.num_states; ++i) {
31183121 for (j = 0; j <= 1; ++j) {
31193122 mode_lib->vba.MaxTotalVerticalActiveAvailableBandwidth[i][j] =
31203123 dml_min3(mode_lib->vba.ReturnBusWidth * mode_lib->vba.DCFCLKState[i][j]
@@ -3138,7 +3141,7 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 17 unmodified lines
31383141
31393142 /* Prefetch Check */
31403143
3141− for (i = 0; i < (int) v->soc.num_states; ++i) {
3144+ for (i = start_state; i < (int) v->soc.num_states; ++i) {
31423145 for (j = 0; j <= 1; ++j) {
31433146
31443147 mode_lib->vba.TimeCalc = 24 / mode_lib->vba.ProjectedDCFCLKDeepSleep[i][j];
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c+3−3
@@ -6257,12 +6257,12 @@ bool dml32_CalculateDETSwathFillLatencyHiding(unsigned int NumberOfActiveSurface · 6256 unmodified lines
62576257 double SwathSizePerSurfaceC[DC__NUM_DPP__MAX];
62586258 bool NotEnoughDETSwathFillLatencyHiding = false;
62596259
6260− /* calculate sum of single swath size for all pipes in bytes*/
6260+ /* calculate sum of single swath size for all pipes in bytes */
62616261 for (k = 0; k < NumberOfActiveSurfaces; k++) {
6262− SwathSizePerSurfaceY[k] += SwathHeightY[k] * SwathWidthY[k] * BytePerPixelInDETY[k] * NumOfDPP[k];
6262+ SwathSizePerSurfaceY[k] = SwathHeightY[k] * SwathWidthY[k] * BytePerPixelInDETY[k] * NumOfDPP[k];
62636263
62646264 if (SwathHeightC[k] != 0)
6265− SwathSizePerSurfaceC[k] += SwathHeightC[k] * SwathWidthC[k] * BytePerPixelInDETC[k] * NumOfDPP[k];
6265+ SwathSizePerSurfaceC[k] = SwathHeightC[k] * SwathWidthC[k] * BytePerPixelInDETC[k] * NumOfDPP[k];
62666266 else
62676267 SwathSizePerSurfaceC[k] = 0;
62686268
drivers/gpu/drm/amd/display/dc/dml/dcn321/dcn321_fpu.c+1−1
@@ -136,7 +136,7 @@ struct _vcs_dpi_soc_bounding_box_st dcn3_21_soc = { · 135 unmodified lines
136136 .urgent_out_of_order_return_per_channel_pixel_only_bytes = 4096,
137137 .urgent_out_of_order_return_per_channel_pixel_and_vm_bytes = 4096,
138138 .urgent_out_of_order_return_per_channel_vm_only_bytes = 4096,
139− .pct_ideal_sdp_bw_after_urgent = 100.0,
139+ .pct_ideal_sdp_bw_after_urgent = 90.0,
140140 .pct_ideal_fabric_bw_after_urgent = 67.0,
141141 .pct_ideal_dram_sdp_bw_after_urgent_pixel_only = 20.0,
142142 .pct_ideal_dram_sdp_bw_after_urgent_pixel_and_vm = 60.0, // N/A, for now keep as is until DML implemented
drivers/gpu/drm/amd/display/dc/dml/display_mode_lib.h+1−0
@@ -91,6 +91,7 @@ struct display_mode_lib { · 90 unmodified lines
9191 struct dal_logger *logger;
9292 struct dml_funcs funcs;
9393 struct _vcs_dpi_display_e2e_pipe_params_st dml_pipe_state[6];
94+ bool validate_max_state;
9495 };
9596
9697 void dml_init_instance(struct display_mode_lib *lib,
drivers/gpu/drm/amd/display/dc/inc/core_types.h+9−9
@@ -546,15 +546,6 @@ struct dc_state { · 545 unmodified lines
546546 */
547547 struct resource_context res_ctx;
548548
549− /**
550− * @bw_ctx: The output from bandwidth and watermark calculations and the DML
551− *
552− * Each context must have its own instance of VBA, and in order to
553− * initialize and obtain IP and SOC, the base DML instance from DC is
554− * initially copied into every context.
555− */
556− struct bw_context bw_ctx;
557−
558549 /**
559550 * @pp_display_cfg: PowerPlay clocks and settings
560551 * Note: this is a big struct, do *not* put on stack!
@@ -569,6 +560,15 @@ struct dc_state { · 8 unmodified lines
569560
570561 struct clk_mgr *clk_mgr;
571562
563+ /**
564+ * @bw_ctx: The output from bandwidth and watermark calculations and the DML
565+ *
566+ * Each context must have its own instance of VBA, and in order to
567+ * initialize and obtain IP and SOC, the base DML instance from DC is
568+ * initially copied into every context.
569+ */
570+ struct bw_context bw_ctx;
571+
572572 /**
573573 * @refcount: refcount reference
574574 *
drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h+1−0
@@ -266,6 +266,7 @@ struct hw_sequencer_funcs { · 265 unmodified lines
266266 void (*apply_update_flags_for_phantom)(struct pipe_ctx *phantom_pipe);
267267
268268 void (*commit_subvp_config)(struct dc *dc, struct dc_state *context);
269+ void (*enable_phantom_streams)(struct dc *dc, struct dc_state *context);
269270 void (*subvp_pipe_control_lock)(struct dc *dc,
270271 struct dc_state *context,
271272 bool lock,
drivers/gpu/drm/amd/display/dc/inc/resource.h+9−0
@@ -236,4 +236,13 @@ bool dc_resource_acquire_secondary_pipe_for_mpc_odm( · 235 unmodified lines
236236 struct pipe_ctx *pri_pipe,
237237 struct pipe_ctx *sec_pipe,
238238 bool odm);
239+
240+/* A test harness interface that modifies dp encoder resources in the given dc
241+ * state and bypasses the need to revalidate. The interface assumes that the
242+ * test harness interface is called with pre-validated link config stored in the
243+ * pipe_ctx and updates dp encoder resources according to the link config.
244+ */
245+enum dc_status update_dp_encoder_resources_for_test_harness(const struct dc *dc,
246+ struct dc_state *context,
247+ struct pipe_ctx *pipe_ctx);
239248 #endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_RESOURCE_H_ */
drivers/gpu/drm/amd/display/dc/irq/dcn201/irq_service_dcn201.c+0−5
@@ -136,11 +136,6 @@ static const struct irq_source_info_funcs vupdate_no_lock_irq_info_funcs = { · 135 unmodified lines
136136 .ack = NULL
137137 };
138138
139−static const struct irq_source_info_funcs dmub_outbox_irq_info_funcs = {
140− .set = NULL,
141− .ack = NULL
142−};
143−
144139 #undef BASE_INNER
145140 #define BASE_INNER(seg) DMU_BASE__INST0_SEG ## seg
146141
drivers/gpu/drm/amd/display/dc/link/link_hwss_hpo_dp.c+0−37
@@ -87,57 +87,20 @@ static void set_hpo_dp_hblank_min_symbol_width(struct pipe_ctx *pipe_ctx, · 86 unmodified lines
8787 hblank_min_symbol_width);
8888 }
8989
90−static int get_odm_segment_count(struct pipe_ctx *pipe_ctx)
91−{
92− struct pipe_ctx *odm_pipe = pipe_ctx->next_odm_pipe;
93− int count = 1;
94−
95− while (odm_pipe != NULL) {
96− count++;
97− odm_pipe = odm_pipe->next_odm_pipe;
98− }
99−
100− return count;
101−}
102−
10390 static void setup_hpo_dp_stream_encoder(struct pipe_ctx *pipe_ctx)
10491 {
105− struct dc *dc = pipe_ctx->stream->ctx->dc;
10692 struct hpo_dp_stream_encoder *stream_enc = pipe_ctx->stream_res.hpo_dp_stream_enc;
10793 struct hpo_dp_link_encoder *link_enc = pipe_ctx->link_res.hpo_dp_link_enc;
108− struct dccg *dccg = dc->res_pool->dccg;
109− struct timing_generator *tg = pipe_ctx->stream_res.tg;
110− struct dtbclk_dto_params dto_params = {0};
111− enum phyd32clk_clock_source phyd32clk = get_phyd32clk_src(pipe_ctx->stream->link);
11294
113− dto_params.otg_inst = tg->inst;
114− dto_params.pixclk_khz = pipe_ctx->stream->timing.pix_clk_100hz / 10;
115− dto_params.num_odm_segments = get_odm_segment_count(pipe_ctx);
116− dto_params.timing = &pipe_ctx->stream->timing;
117− dto_params.ref_dtbclk_khz = dc->clk_mgr->funcs->get_dtb_ref_clk_frequency(dc->clk_mgr);
118−
119− dccg->funcs->set_dpstreamclk(dccg, DTBCLK0, tg->inst, stream_enc->inst);
120− dccg->funcs->enable_symclk32_se(dccg, stream_enc->inst, phyd32clk);
121− dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
12295 stream_enc->funcs->enable_stream(stream_enc);
12396 stream_enc->funcs->map_stream_to_link(stream_enc, stream_enc->inst, link_enc->inst);
12497 }
12598
12699 static void reset_hpo_dp_stream_encoder(struct pipe_ctx *pipe_ctx)
127100 {
128− struct dc *dc = pipe_ctx->stream->ctx->dc;
129101 struct hpo_dp_stream_encoder *stream_enc = pipe_ctx->stream_res.hpo_dp_stream_enc;
130− struct dccg *dccg = dc->res_pool->dccg;
131− struct timing_generator *tg = pipe_ctx->stream_res.tg;
132− struct dtbclk_dto_params dto_params = {0};
133−
134− dto_params.otg_inst = tg->inst;
135− dto_params.timing = &pipe_ctx->stream->timing;
136102
137103 stream_enc->funcs->disable(stream_enc);
138− dccg->funcs->set_dtbclk_dto(dccg, &dto_params);
139− dccg->funcs->disable_symclk32_se(dccg, stream_enc->inst);
140− dccg->funcs->set_dpstreamclk(dccg, REFCLK, tg->inst, stream_enc->inst);
141104 }
142105
143106 static void setup_hpo_dp_stream_attribute(struct pipe_ctx *pipe_ctx)
drivers/gpu/drm/amd/display/dmub/dmub_srv.h+3−0
@@ -126,6 +126,7 @@ enum dmub_notification_type { · 125 unmodified lines
126126 DMUB_NOTIFICATION_HPD,
127127 DMUB_NOTIFICATION_HPD_IRQ,
128128 DMUB_NOTIFICATION_SET_CONFIG_REPLY,
129+ DMUB_NOTIFICATION_DPIA_NOTIFICATION,
129130 DMUB_NOTIFICATION_MAX
130131 };
131132
@@ -453,6 +454,7 @@ struct dmub_srv { · 321 unmodified lines
453454 * @pending_notification: Indicates there are other pending notifications
454455 * @aux_reply: aux reply
455456 * @hpd_status: hpd status
457+ * @bw_alloc_reply: BW Allocation reply from CM/DPIA
456458 */
457459 struct dmub_notification {
458460 enum dmub_notification_type type;
@@ -463,6 +465,7 @@ struct dmub_notification { · 4 unmodified lines
463465 struct aux_reply_data aux_reply;
464466 enum dp_hpd_status hpd_status;
465467 enum set_config_status sc_status;
468+ struct dpia_notification_reply_data bw_alloc_reply;
466469 };
467470 };
468471
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h+83−0
@@ -770,6 +770,7 @@ enum dmub_out_cmd_type { · 769 unmodified lines
770770 * Command type used for SET_CONFIG Reply notification
771771 */
772772 DMUB_OUT_CMD__SET_CONFIG_REPLY = 3,
773+ DMUB_OUT_CMD__DPIA_NOTIFICATION = 5
773774 };
774775
775776 /* DMUB_CMD__DPIA command sub-types. */
@@ -1516,6 +1517,84 @@ struct dp_hpd_data { · 740 unmodified lines
15161517 uint8_t pad;
15171518 };
15181519
1520+/**
1521+ * DPIA NOTIFICATION Response Type
1522+ */
1523+enum dpia_notify_bw_alloc_status {
1524+
1525+ DPIA_BW_REQ_FAILED = 0,
1526+ DPIA_BW_REQ_SUCCESS,
1527+ DPIA_EST_BW_CHANGED,
1528+ DPIA_BW_ALLOC_CAPS_CHANGED
1529+};
1530+
1531+/* DMUB_OUT_CMD__DPIA_NOTIFY Reply command - OutBox Cmd */
1532+/**
1533+ * Data passed to driver from FW in a DMUB_OUT_CMD__DPIA_NOTIFY command.
1534+ */
1535+struct dpia_notification_reply_data {
1536+ uint8_t allocated_bw;
1537+ uint8_t estimated_bw;
1538+};
1539+
1540+struct dpia_notification_common {
1541+ bool shared;
1542+};
1543+
1544+struct dpia_bw_allocation_notify_data {
1545+ union {
1546+ struct {
1547+ uint16_t cm_bw_alloc_support: 1; /**< USB4 CM BW Allocation mode support */
1548+ uint16_t bw_request_failed: 1; /**< BW_Request_Failed */
1549+ uint16_t bw_request_succeeded: 1; /**< BW_Request_Succeeded */
1550+ uint16_t est_bw_changed: 1; /**< Estimated_BW changed */
1551+ uint16_t bw_alloc_cap_changed: 1; /**< BW_Allocation_Capabiity_Changed */
1552+ uint16_t reserved: 11;
1553+ } bits;
1554+ uint16_t flags;
1555+ };
1556+ uint8_t cm_id; /**< CM ID */
1557+ uint8_t group_id; /**< Group ID */
1558+ uint8_t granularity; /**< BW Allocation Granularity */
1559+ uint8_t estimated_bw; /**< Estimated_BW */
1560+ uint8_t allocated_bw; /**< Allocated_BW */
1561+ uint8_t reserved;
1562+};
1563+
1564+union dpia_notification_data {
1565+ struct dpia_notification_common common_data;
1566+ struct dpia_bw_allocation_notify_data dpia_bw_alloc; /**< Used for DPIA BW Allocation mode notification */
1567+};
1568+
1569+enum dmub_cmd_dpia_notification_type {
1570+ DPIA_NOTIFY__BW_ALLOCATION = 0,
1571+};
1572+
1573+struct dpia_notification_header {
1574+ uint8_t instance; /**< DPIA Instance */
1575+ uint8_t reserved[3];
1576+ enum dmub_cmd_dpia_notification_type type; /**< DPIA notification type */
1577+};
1578+
1579+struct dpia_notification_payload {
1580+ struct dpia_notification_header header;
1581+ union dpia_notification_data data; /**< DPIA notification data */
1582+};
1583+
1584+/**
1585+ * Definition of a DMUB_OUT_CMD__DPIA_NOTIFY command.
1586+ */
1587+struct dmub_rb_cmd_dpia_notification {
1588+ /**
1589+ * Command header.
1590+ */
1591+ struct dmub_cmd_header header; /**< DPIA notification header */
1592+ /**
1593+ * Data passed to driver from FW in a DMUB_OUT_CMD__DPIA_NOTIFY command.
1594+ */
1595+ struct dpia_notification_payload payload; /**< DPIA notification payload */
1596+};
1597+
15191598 /**
15201599 * Definition of a DMUB_OUT_CMD__DP_HPD_NOTIFY command.
15211600 */
@@ -3422,6 +3501,10 @@ union dmub_rb_out_cmd { · 1900 unmodified lines
34223501 * SET_CONFIG reply command.
34233502 */
34243503 struct dmub_rb_cmd_dp_set_config_reply set_config_reply;
3504+ /**
3505+ * BW ALLOCATION notification command.
3506+ */
3507+ struct dmub_rb_cmd_dpia_notification dpia_notify;
34253508 };
34263509 #pragma pack(pop)
34273510
drivers/gpu/drm/amd/display/dmub/src/dmub_srv_stat.c+21−0
@@ -92,6 +92,27 @@ enum dmub_status dmub_srv_stat_get_notification(struct dmub_srv *dmub, · 91 unmodified lines
9292 notify->link_index = cmd.set_config_reply.set_config_reply_control.instance;
9393 notify->sc_status = cmd.set_config_reply.set_config_reply_control.status;
9494 break;
95+ case DMUB_OUT_CMD__DPIA_NOTIFICATION:
96+ notify->type = DMUB_NOTIFICATION_DPIA_NOTIFICATION;
97+ notify->link_index = cmd.dpia_notify.payload.header.instance;
98+
99+ if (cmd.dpia_notify.payload.header.type == DPIA_NOTIFY__BW_ALLOCATION) {
100+
101+ if (cmd.dpia_notify.payload.data.dpia_bw_alloc.bits.bw_request_failed) {
102+ notify->result = DPIA_BW_REQ_FAILED;
103+ } else if (cmd.dpia_notify.payload.data.dpia_bw_alloc.bits.bw_request_succeeded) {
104+ notify->result = DPIA_BW_REQ_SUCCESS;
105+ notify->bw_alloc_reply.allocated_bw =
106+ cmd.dpia_notify.payload.data.dpia_bw_alloc.allocated_bw;
107+ } else if (cmd.dpia_notify.payload.data.dpia_bw_alloc.bits.est_bw_changed) {
108+ notify->result = DPIA_EST_BW_CHANGED;
109+ notify->bw_alloc_reply.estimated_bw =
110+ cmd.dpia_notify.payload.data.dpia_bw_alloc.estimated_bw;
111+ } else if (cmd.dpia_notify.payload.data.dpia_bw_alloc.bits.bw_alloc_cap_changed) {
112+ notify->result = DPIA_BW_ALLOC_CAPS_CHANGED;
113+ }
114+ }
115+ break;
95116 default:
96117 notify->type = DMUB_NOTIFICATION_NO_DATA;
97118 break;
drivers/gpu/drm/amd/display/include/dpcd_defs.h+4−1
@@ -88,7 +88,10 @@ enum dpcd_phy_test_patterns { · 87 unmodified lines
8888 PHY_TEST_PATTERN_PRBS23 = 0x30,
8989 PHY_TEST_PATTERN_PRBS31 = 0x38,
9090 PHY_TEST_PATTERN_264BIT_CUSTOM = 0x40,
91− PHY_TEST_PATTERN_SQUARE_PULSE = 0x48,
91+ PHY_TEST_PATTERN_SQUARE = 0x48,
92+ PHY_TEST_PATTERN_SQUARE_PRESHOOT_DISABLED = 0x49,
93+ PHY_TEST_PATTERN_SQUARE_DEEMPHASIS_DISABLED = 0x4A,
94+ PHY_TEST_PATTERN_SQUARE_PRESHOOT_DEEMPHASIS_DISABLED = 0x4B,
9295 };
9396
9497 enum dpcd_test_dyn_range {
drivers/gpu/drm/amd/display/include/link_service_types.h+6−1
@@ -165,7 +165,12 @@ enum dp_test_pattern { · 164 unmodified lines
165165 DP_TEST_PATTERN_PRBS23,
166166 DP_TEST_PATTERN_PRBS31,
167167 DP_TEST_PATTERN_264BIT_CUSTOM,
168− DP_TEST_PATTERN_SQUARE_PULSE,
168+ DP_TEST_PATTERN_SQUARE_BEGIN,
169+ DP_TEST_PATTERN_SQUARE = DP_TEST_PATTERN_SQUARE_BEGIN,
170+ DP_TEST_PATTERN_SQUARE_PRESHOOT_DISABLED,
171+ DP_TEST_PATTERN_SQUARE_DEEMPHASIS_DISABLED,
172+ DP_TEST_PATTERN_SQUARE_PRESHOOT_DEEMPHASIS_DISABLED,
173+ DP_TEST_PATTERN_SQUARE_END = DP_TEST_PATTERN_SQUARE_PRESHOOT_DEEMPHASIS_DISABLED,
169174
170175 /* Link Training Patterns */
171176 DP_TEST_PATTERN_TRAINING_PATTERN1,
drivers/gpu/drm/amd/include/asic_reg/df/df_4_3_offset.h+30−0
@@ -0,0 +1,30 @@
1+/*
2+ * Copyright (C) 2022 Advanced Micro Devices, Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included
12+ * in all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+ */
21+
22+#ifndef _df_4_3_OFFSET_HEADER
23+#define _df_4_3_OFFSET_HEADER
24+
25+#define regDF_CS_UMC_AON0_HardwareAssertMaskLow 0x0e3e
26+#define regDF_CS_UMC_AON0_HardwareAssertMaskLow_BASE_IDX 4
27+#define regDF_NCS_PG0_HardwareAssertMaskHigh 0x0e3f
28+#define regDF_NCS_PG0_HardwareAssertMaskHigh_BASE_IDX 4
29+
30+#endif
drivers/gpu/drm/amd/include/asic_reg/df/df_4_3_sh_mask.h+157−0
@@ -0,0 +1,157 @@
1+/*
2+ * Copyright (C) 2022 Advanced Micro Devices, Inc.
3+ *
4+ * Permission is hereby granted, free of charge, to any person obtaining a
5+ * copy of this software and associated documentation files (the "Software"),
6+ * to deal in the Software without restriction, including without limitation
7+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
8+ * and/or sell copies of the Software, and to permit persons to whom the
9+ * Software is furnished to do so, subject to the following conditions:
10+ *
11+ * The above copyright notice and this permission notice shall be included
12+ * in all copies or substantial portions of the Software.
13+ *
14+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
15+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17+ * THE COPYRIGHT HOLDER(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
18+ * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+ */
21+
22+#ifndef _df_4_3_SH_MASK_HEADER
23+#define _df_4_3_SH_MASK_HEADER
24+
25+//DF_CS_UMC_AON0_HardwareAssertMaskLow
26+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk0__SHIFT 0x0
27+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk1__SHIFT 0x1
28+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk2__SHIFT 0x2
29+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk3__SHIFT 0x3
30+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk4__SHIFT 0x4
31+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk5__SHIFT 0x5
32+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk6__SHIFT 0x6
33+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk7__SHIFT 0x7
34+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk8__SHIFT 0x8
35+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk9__SHIFT 0x9
36+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk10__SHIFT 0xa
37+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk11__SHIFT 0xb
38+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk12__SHIFT 0xc
39+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk13__SHIFT 0xd
40+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk14__SHIFT 0xe
41+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk15__SHIFT 0xf
42+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk16__SHIFT 0x10
43+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk17__SHIFT 0x11
44+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk18__SHIFT 0x12
45+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk19__SHIFT 0x13
46+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk20__SHIFT 0x14
47+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk21__SHIFT 0x15
48+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk22__SHIFT 0x16
49+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk23__SHIFT 0x17
50+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk24__SHIFT 0x18
51+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk25__SHIFT 0x19
52+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk26__SHIFT 0x1a
53+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk27__SHIFT 0x1b
54+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk28__SHIFT 0x1c
55+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk29__SHIFT 0x1d
56+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk30__SHIFT 0x1e
57+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk31__SHIFT 0x1f
58+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk0_MASK 0x00000001L
59+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk1_MASK 0x00000002L
60+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk2_MASK 0x00000004L
61+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk3_MASK 0x00000008L
62+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk4_MASK 0x00000010L
63+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk5_MASK 0x00000020L
64+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk6_MASK 0x00000040L
65+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk7_MASK 0x00000080L
66+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk8_MASK 0x00000100L
67+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk9_MASK 0x00000200L
68+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk10_MASK 0x00000400L
69+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk11_MASK 0x00000800L
70+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk12_MASK 0x00001000L
71+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk13_MASK 0x00002000L
72+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk14_MASK 0x00004000L
73+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk15_MASK 0x00008000L
74+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk16_MASK 0x00010000L
75+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk17_MASK 0x00020000L
76+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk18_MASK 0x00040000L
77+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk19_MASK 0x00080000L
78+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk20_MASK 0x00100000L
79+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk21_MASK 0x00200000L
80+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk22_MASK 0x00400000L
81+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk23_MASK 0x00800000L
82+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk24_MASK 0x01000000L
83+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk25_MASK 0x02000000L
84+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk26_MASK 0x04000000L
85+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk27_MASK 0x08000000L
86+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk28_MASK 0x10000000L
87+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk29_MASK 0x20000000L
88+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk30_MASK 0x40000000L
89+#define DF_CS_UMC_AON0_HardwareAssertMaskLow__HWAssertMsk31_MASK 0x80000000L
90+
91+//DF_NCS_PG0_HardwareAssertMaskHigh
92+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk0__SHIFT 0x0
93+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk1__SHIFT 0x1
94+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk2__SHIFT 0x2
95+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk3__SHIFT 0x3
96+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk4__SHIFT 0x4
97+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk5__SHIFT 0x5
98+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk6__SHIFT 0x6
99+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk7__SHIFT 0x7
100+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk8__SHIFT 0x8
101+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk9__SHIFT 0x9
102+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk10__SHIFT 0xa
103+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk11__SHIFT 0xb
104+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk12__SHIFT 0xc
105+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk13__SHIFT 0xd
106+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk14__SHIFT 0xe
107+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk15__SHIFT 0xf
108+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk16__SHIFT 0x10
109+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk17__SHIFT 0x11
110+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk18__SHIFT 0x12
111+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk19__SHIFT 0x13
112+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk20__SHIFT 0x14
113+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk21__SHIFT 0x15
114+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk22__SHIFT 0x16
115+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk23__SHIFT 0x17
116+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk24__SHIFT 0x18
117+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk25__SHIFT 0x19
118+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk26__SHIFT 0x1a
119+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk27__SHIFT 0x1b
120+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk28__SHIFT 0x1c
121+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk29__SHIFT 0x1d
122+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk30__SHIFT 0x1e
123+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk31__SHIFT 0x1f
124+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk0_MASK 0x00000001L
125+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk1_MASK 0x00000002L
126+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk2_MASK 0x00000004L
127+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk3_MASK 0x00000008L
128+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk4_MASK 0x00000010L
129+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk5_MASK 0x00000020L
130+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk6_MASK 0x00000040L
131+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk7_MASK 0x00000080L
132+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk8_MASK 0x00000100L
133+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk9_MASK 0x00000200L
134+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk10_MASK 0x00000400L
135+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk11_MASK 0x00000800L
136+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk12_MASK 0x00001000L
137+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk13_MASK 0x00002000L
138+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk14_MASK 0x00004000L
139+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk15_MASK 0x00008000L
140+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk16_MASK 0x00010000L
141+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk17_MASK 0x00020000L
142+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk18_MASK 0x00040000L
143+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk19_MASK 0x00080000L
144+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk20_MASK 0x00100000L
145+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk21_MASK 0x00200000L
146+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk22_MASK 0x00400000L
147+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk23_MASK 0x00800000L
148+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk24_MASK 0x01000000L
149+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk25_MASK 0x02000000L
150+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk26_MASK 0x04000000L
151+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk27_MASK 0x08000000L
152+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk28_MASK 0x10000000L
153+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk29_MASK 0x20000000L
154+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk30_MASK 0x40000000L
155+#define DF_NCS_PG0_HardwareAssertMaskHigh__HWAssertMsk31_MASK 0x80000000L
156+
157+#endif
drivers/gpu/drm/amd/include/kgd_pp_interface.h+2−0
@@ -139,6 +139,8 @@ enum amd_pp_sensors { · 138 unmodified lines
139139 AMDGPU_PP_SENSOR_MIN_FAN_RPM,
140140 AMDGPU_PP_SENSOR_MAX_FAN_RPM,
141141 AMDGPU_PP_SENSOR_VCN_POWER_STATE,
142+ AMDGPU_PP_SENSOR_PEAK_PSTATE_SCLK,
143+ AMDGPU_PP_SENSOR_PEAK_PSTATE_MCLK,
142144 };
143145
144146 enum amd_pp_task {
drivers/gpu/drm/amd/pm/powerplay/amd_powerplay.c+8−2
@@ -769,10 +769,16 @@ static int pp_dpm_read_sensor(void *handle, int idx, · 768 unmodified lines
769769
770770 switch (idx) {
771771 case AMDGPU_PP_SENSOR_STABLE_PSTATE_SCLK:
772− *((uint32_t *)value) = hwmgr->pstate_sclk;
772+ *((uint32_t *)value) = hwmgr->pstate_sclk * 100;
773773 return 0;
774774 case AMDGPU_PP_SENSOR_STABLE_PSTATE_MCLK:
775− *((uint32_t *)value) = hwmgr->pstate_mclk;
775+ *((uint32_t *)value) = hwmgr->pstate_mclk * 100;
776+ return 0;
777+ case AMDGPU_PP_SENSOR_PEAK_PSTATE_SCLK:
778+ *((uint32_t *)value) = hwmgr->pstate_sclk_peak * 100;
779+ return 0;
780+ case AMDGPU_PP_SENSOR_PEAK_PSTATE_MCLK:
781+ *((uint32_t *)value) = hwmgr->pstate_mclk_peak * 100;
776782 return 0;
777783 case AMDGPU_PP_SENSOR_MIN_FAN_RPM:
778784 *((uint32_t *)value) = hwmgr->thermal_controller.fanInfo.ulMinRPM;
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu10_hwmgr.c+13−3
@@ -375,6 +375,17 @@ static int smu10_enable_gfx_off(struct pp_hwmgr *hwmgr) · 374 unmodified lines
375375 return 0;
376376 }
377377
378+static void smu10_populate_umdpstate_clocks(struct pp_hwmgr *hwmgr)
379+{
380+ hwmgr->pstate_sclk = SMU10_UMD_PSTATE_GFXCLK;
381+ hwmgr->pstate_mclk = SMU10_UMD_PSTATE_FCLK;
382+
383+ smum_send_msg_to_smc(hwmgr,
384+ PPSMC_MSG_GetMaxGfxclkFrequency,
385+ &hwmgr->pstate_sclk_peak);
386+ hwmgr->pstate_mclk_peak = SMU10_UMD_PSTATE_PEAK_FCLK;
387+}
388+
378389 static int smu10_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
379390 {
380391 struct amdgpu_device *adev = hwmgr->adev;
@@ -398,6 +409,8 @@ static int smu10_enable_dpm_tasks(struct pp_hwmgr *hwmgr) · 17 unmodified lines
398409 return ret;
399410 }
400411
412+ smu10_populate_umdpstate_clocks(hwmgr);
413+
401414 return 0;
402415 }
403416
@@ -574,9 +587,6 @@ static int smu10_hwmgr_backend_init(struct pp_hwmgr *hwmgr) · 170 unmodified lines
574587
575588 hwmgr->platform_descriptor.minimumClocksReductionPercentage = 50;
576589
577− hwmgr->pstate_sclk = SMU10_UMD_PSTATE_GFXCLK * 100;
578− hwmgr->pstate_mclk = SMU10_UMD_PSTATE_FCLK * 100;
579−
580590 /* enable the pp_od_clk_voltage sysfs file */
581591 hwmgr->od_enabled = 1;
582592 /* disabled fine grain tuning function by default */
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu7_hwmgr.c+63−13
@@ -1501,6 +1501,65 @@ static int smu7_populate_edc_leakage_registers(struct pp_hwmgr *hwmgr) · 1500 unmodified lines
15011501 return ret;
15021502 }
15031503
1504+static void smu7_populate_umdpstate_clocks(struct pp_hwmgr *hwmgr)
1505+{
1506+ struct smu7_hwmgr *data = (struct smu7_hwmgr *)(hwmgr->backend);
1507+ struct smu7_dpm_table *golden_dpm_table = &data->golden_dpm_table;
1508+ struct phm_clock_voltage_dependency_table *vddc_dependency_on_sclk =
1509+ hwmgr->dyn_state.vddc_dependency_on_sclk;
1510+ struct phm_ppt_v1_information *table_info =
1511+ (struct phm_ppt_v1_information *)(hwmgr->pptable);
1512+ struct phm_ppt_v1_clock_voltage_dependency_table *vdd_dep_on_sclk =
1513+ table_info->vdd_dep_on_sclk;
1514+ int32_t tmp_sclk, count, percentage;
1515+
1516+ if (golden_dpm_table->mclk_table.count == 1) {
1517+ percentage = 70;
1518+ hwmgr->pstate_mclk = golden_dpm_table->mclk_table.dpm_levels[0].value;
1519+ } else {
1520+ percentage = 100 * golden_dpm_table->sclk_table.dpm_levels[golden_dpm_table->sclk_table.count - 1].value /
1521+ golden_dpm_table->mclk_table.dpm_levels[golden_dpm_table->mclk_table.count - 1].value;
1522+ hwmgr->pstate_mclk = golden_dpm_table->mclk_table.dpm_levels[golden_dpm_table->mclk_table.count - 2].value;
1523+ }
1524+
1525+ tmp_sclk = hwmgr->pstate_mclk * percentage / 100;
1526+
1527+ if (hwmgr->pp_table_version == PP_TABLE_V0) {
1528+ for (count = vddc_dependency_on_sclk->count - 1; count >= 0; count--) {
1529+ if (tmp_sclk >= vddc_dependency_on_sclk->entries[count].clk) {
1530+ hwmgr->pstate_sclk = vddc_dependency_on_sclk->entries[count].clk;
1531+ break;
1532+ }
1533+ }
1534+ if (count < 0)
1535+ hwmgr->pstate_sclk = vddc_dependency_on_sclk->entries[0].clk;
1536+
1537+ hwmgr->pstate_sclk_peak =
1538+ vddc_dependency_on_sclk->entries[vddc_dependency_on_sclk->count - 1].clk;
1539+ } else if (hwmgr->pp_table_version == PP_TABLE_V1) {
1540+ for (count = vdd_dep_on_sclk->count - 1; count >= 0; count--) {
1541+ if (tmp_sclk >= vdd_dep_on_sclk->entries[count].clk) {
1542+ hwmgr->pstate_sclk = vdd_dep_on_sclk->entries[count].clk;
1543+ break;
1544+ }
1545+ }
1546+ if (count < 0)
1547+ hwmgr->pstate_sclk = vdd_dep_on_sclk->entries[0].clk;
1548+
1549+ hwmgr->pstate_sclk_peak =
1550+ vdd_dep_on_sclk->entries[vdd_dep_on_sclk->count - 1].clk;
1551+ }
1552+
1553+ hwmgr->pstate_mclk_peak =
1554+ golden_dpm_table->mclk_table.dpm_levels[golden_dpm_table->mclk_table.count - 1].value;
1555+
1556+ /* make sure the output is in Mhz */
1557+ hwmgr->pstate_sclk /= 100;
1558+ hwmgr->pstate_mclk /= 100;
1559+ hwmgr->pstate_sclk_peak /= 100;
1560+ hwmgr->pstate_mclk_peak /= 100;
1561+}
1562+
15041563 static int smu7_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
15051564 {
15061565 int tmp_result = 0;
@@ -1625,6 +1684,8 @@ static int smu7_enable_dpm_tasks(struct pp_hwmgr *hwmgr) · 118 unmodified lines
16251684 PP_ASSERT_WITH_CODE((0 == tmp_result),
16261685 "pcie performance request failed!", result = tmp_result);
16271686
1687+ smu7_populate_umdpstate_clocks(hwmgr);
1688+
16281689 return 0;
16291690 }
16301691
@@ -3143,15 +3204,12 @@ static int smu7_get_profiling_clk(struct pp_hwmgr *hwmgr, enum amd_dpm_forced_le · 1512 unmodified lines
31433204 for (count = hwmgr->dyn_state.vddc_dependency_on_sclk->count-1;
31443205 count >= 0; count--) {
31453206 if (tmp_sclk >= hwmgr->dyn_state.vddc_dependency_on_sclk->entries[count].clk) {
3146− tmp_sclk = hwmgr->dyn_state.vddc_dependency_on_sclk->entries[count].clk;
31473207 *sclk_mask = count;
31483208 break;
31493209 }
31503210 }
3151− if (count < 0 || level == AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK) {
3211+ if (count < 0 || level == AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK)
31523212 *sclk_mask = 0;
3153− tmp_sclk = hwmgr->dyn_state.vddc_dependency_on_sclk->entries[0].clk;
3154− }
31553213
31563214 if (level == AMD_DPM_FORCED_LEVEL_PROFILE_PEAK)
31573215 *sclk_mask = hwmgr->dyn_state.vddc_dependency_on_sclk->count-1;
@@ -3161,15 +3219,12 @@ static int smu7_get_profiling_clk(struct pp_hwmgr *hwmgr, enum amd_dpm_forced_le · 3 unmodified lines
31613219
31623220 for (count = table_info->vdd_dep_on_sclk->count-1; count >= 0; count--) {
31633221 if (tmp_sclk >= table_info->vdd_dep_on_sclk->entries[count].clk) {
3164− tmp_sclk = table_info->vdd_dep_on_sclk->entries[count].clk;
31653222 *sclk_mask = count;
31663223 break;
31673224 }
31683225 }
3169− if (count < 0 || level == AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK) {
3226+ if (count < 0 || level == AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK)
31703227 *sclk_mask = 0;
3171− tmp_sclk = table_info->vdd_dep_on_sclk->entries[0].clk;
3172− }
31733228
31743229 if (level == AMD_DPM_FORCED_LEVEL_PROFILE_PEAK)
31753230 *sclk_mask = table_info->vdd_dep_on_sclk->count - 1;
@@ -3181,8 +3236,6 @@ static int smu7_get_profiling_clk(struct pp_hwmgr *hwmgr, enum amd_dpm_forced_le · 5 unmodified lines
31813236 *mclk_mask = golden_dpm_table->mclk_table.count - 1;
31823237
31833238 *pcie_mask = data->dpm_table.pcie_speed_table.count - 1;
3184− hwmgr->pstate_sclk = tmp_sclk;
3185− hwmgr->pstate_mclk = tmp_mclk;
31863239
31873240 return 0;
31883241 }
@@ -3195,9 +3248,6 @@ static int smu7_force_dpm_level(struct pp_hwmgr *hwmgr, · 6 unmodified lines
31953248 uint32_t mclk_mask = 0;
31963249 uint32_t pcie_mask = 0;
31973250
3198− if (hwmgr->pstate_sclk == 0)
3199− smu7_get_profiling_clk(hwmgr, level, &sclk_mask, &mclk_mask, &pcie_mask);
3200−
32013251 switch (level) {
32023252 case AMD_DPM_FORCED_LEVEL_HIGH:
32033253 ret = smu7_force_dpm_highest(hwmgr);
drivers/gpu/drm/amd/pm/powerplay/hwmgr/smu8_hwmgr.c+14−2
@@ -1016,6 +1016,18 @@ static void smu8_reset_acp_boot_level(struct pp_hwmgr *hwmgr) · 1015 unmodified lines
10161016 data->acp_boot_level = 0xff;
10171017 }
10181018
1019+static void smu8_populate_umdpstate_clocks(struct pp_hwmgr *hwmgr)
1020+{
1021+ struct phm_clock_voltage_dependency_table *table =
1022+ hwmgr->dyn_state.vddc_dependency_on_sclk;
1023+
1024+ hwmgr->pstate_sclk = table->entries[0].clk / 100;
1025+ hwmgr->pstate_mclk = 0;
1026+
1027+ hwmgr->pstate_sclk_peak = table->entries[table->count - 1].clk / 100;
1028+ hwmgr->pstate_mclk_peak = 0;
1029+}
1030+
10191031 static int smu8_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
10201032 {
10211033 smu8_program_voting_clients(hwmgr);
@@ -1024,6 +1036,8 @@ static int smu8_enable_dpm_tasks(struct pp_hwmgr *hwmgr) · 2 unmodified lines
10241036 smu8_program_bootup_state(hwmgr);
10251037 smu8_reset_acp_boot_level(hwmgr);
10261038
1039+ smu8_populate_umdpstate_clocks(hwmgr);
1040+
10271041 return 0;
10281042 }
10291043
@@ -1167,8 +1181,6 @@ static int smu8_phm_unforce_dpm_levels(struct pp_hwmgr *hwmgr) · 137 unmodified lines
11671181
11681182 data->sclk_dpm.soft_min_clk = table->entries[0].clk;
11691183 data->sclk_dpm.hard_min_clk = table->entries[0].clk;
1170− hwmgr->pstate_sclk = table->entries[0].clk;
1171− hwmgr->pstate_mclk = 0;
11721184
11731185 level = smu8_get_max_sclk_level(hwmgr) - 1;
11741186
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega10_hwmgr.c+26−5
@@ -3008,6 +3008,30 @@ static int vega10_enable_disable_PCC_limit_feature(struct pp_hwmgr *hwmgr, bool · 3007 unmodified lines
30083008 return 0;
30093009 }
30103010
3011+static void vega10_populate_umdpstate_clocks(struct pp_hwmgr *hwmgr)
3012+{
3013+ struct phm_ppt_v2_information *table_info =
3014+ (struct phm_ppt_v2_information *)(hwmgr->pptable);
3015+
3016+ if (table_info->vdd_dep_on_sclk->count > VEGA10_UMD_PSTATE_GFXCLK_LEVEL &&
3017+ table_info->vdd_dep_on_mclk->count > VEGA10_UMD_PSTATE_MCLK_LEVEL) {
3018+ hwmgr->pstate_sclk = table_info->vdd_dep_on_sclk->entries[VEGA10_UMD_PSTATE_GFXCLK_LEVEL].clk;
3019+ hwmgr->pstate_mclk = table_info->vdd_dep_on_mclk->entries[VEGA10_UMD_PSTATE_MCLK_LEVEL].clk;
3020+ } else {
3021+ hwmgr->pstate_sclk = table_info->vdd_dep_on_sclk->entries[0].clk;
3022+ hwmgr->pstate_mclk = table_info->vdd_dep_on_mclk->entries[0].clk;
3023+ }
3024+
3025+ hwmgr->pstate_sclk_peak = table_info->vdd_dep_on_sclk->entries[table_info->vdd_dep_on_sclk->count - 1].clk;
3026+ hwmgr->pstate_mclk_peak = table_info->vdd_dep_on_mclk->entries[table_info->vdd_dep_on_mclk->count - 1].clk;
3027+
3028+ /* make sure the output is in Mhz */
3029+ hwmgr->pstate_sclk /= 100;
3030+ hwmgr->pstate_mclk /= 100;
3031+ hwmgr->pstate_sclk_peak /= 100;
3032+ hwmgr->pstate_mclk_peak /= 100;
3033+}
3034+
30113035 static int vega10_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
30123036 {
30133037 struct vega10_hwmgr *data = hwmgr->backend;
@@ -3082,6 +3106,8 @@ static int vega10_enable_dpm_tasks(struct pp_hwmgr *hwmgr) · 68 unmodified lines
30823106 result = tmp_result);
30833107 }
30843108
3109+ vega10_populate_umdpstate_clocks(hwmgr);
3110+
30853111 return result;
30863112 }
30873113
@@ -4169,8 +4195,6 @@ static int vega10_get_profiling_clk_mask(struct pp_hwmgr *hwmgr, enum amd_dpm_fo · 1081 unmodified lines
41694195 *sclk_mask = VEGA10_UMD_PSTATE_GFXCLK_LEVEL;
41704196 *soc_mask = VEGA10_UMD_PSTATE_SOCCLK_LEVEL;
41714197 *mclk_mask = VEGA10_UMD_PSTATE_MCLK_LEVEL;
4172− hwmgr->pstate_sclk = table_info->vdd_dep_on_sclk->entries[VEGA10_UMD_PSTATE_GFXCLK_LEVEL].clk;
4173− hwmgr->pstate_mclk = table_info->vdd_dep_on_mclk->entries[VEGA10_UMD_PSTATE_MCLK_LEVEL].clk;
41744198 }
41754199
41764200 if (level == AMD_DPM_FORCED_LEVEL_PROFILE_MIN_SCLK) {
@@ -4281,9 +4305,6 @@ static int vega10_dpm_force_dpm_level(struct pp_hwmgr *hwmgr, · 104 unmodified lines
42814305 uint32_t mclk_mask = 0;
42824306 uint32_t soc_mask = 0;
42834307
4284− if (hwmgr->pstate_sclk == 0)
4285− vega10_get_profiling_clk_mask(hwmgr, level, &sclk_mask, &mclk_mask, &soc_mask);
4286−
42874308 switch (level) {
42884309 case AMD_DPM_FORCED_LEVEL_HIGH:
42894310 ret = vega10_force_dpm_highest(hwmgr);
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega12_hwmgr.c+22−0
@@ -1026,6 +1026,25 @@ static int vega12_get_all_clock_ranges(struct pp_hwmgr *hwmgr) · 1025 unmodified lines
10261026 return 0;
10271027 }
10281028
1029+static void vega12_populate_umdpstate_clocks(struct pp_hwmgr *hwmgr)
1030+{
1031+ struct vega12_hwmgr *data = (struct vega12_hwmgr *)(hwmgr->backend);
1032+ struct vega12_single_dpm_table *gfx_dpm_table = &(data->dpm_table.gfx_table);
1033+ struct vega12_single_dpm_table *mem_dpm_table = &(data->dpm_table.mem_table);
1034+
1035+ if (gfx_dpm_table->count > VEGA12_UMD_PSTATE_GFXCLK_LEVEL &&
1036+ mem_dpm_table->count > VEGA12_UMD_PSTATE_MCLK_LEVEL) {
1037+ hwmgr->pstate_sclk = gfx_dpm_table->dpm_levels[VEGA12_UMD_PSTATE_GFXCLK_LEVEL].value;
1038+ hwmgr->pstate_mclk = mem_dpm_table->dpm_levels[VEGA12_UMD_PSTATE_MCLK_LEVEL].value;
1039+ } else {
1040+ hwmgr->pstate_sclk = gfx_dpm_table->dpm_levels[0].value;
1041+ hwmgr->pstate_mclk = mem_dpm_table->dpm_levels[0].value;
1042+ }
1043+
1044+ hwmgr->pstate_sclk_peak = gfx_dpm_table->dpm_levels[gfx_dpm_table->count].value;
1045+ hwmgr->pstate_mclk_peak = mem_dpm_table->dpm_levels[mem_dpm_table->count].value;
1046+}
1047+
10291048 static int vega12_enable_dpm_tasks(struct pp_hwmgr *hwmgr)
10301049 {
10311050 int tmp_result, result = 0;
@@ -1077,6 +1096,9 @@ static int vega12_enable_dpm_tasks(struct pp_hwmgr *hwmgr) · 45 unmodified lines
10771096 PP_ASSERT_WITH_CODE(!result,
10781097 "Failed to setup default DPM tables!",
10791098 return result);
1099+
1100+ vega12_populate_umdpstate_clocks(hwmgr);
1101+
10801102 return result;
10811103 }
10821104
drivers/gpu/drm/amd/pm/powerplay/hwmgr/vega20_hwmgr.c+7−13
@@ -1555,26 +1555,23 @@ static int vega20_set_mclk_od( · 1554 unmodified lines
15551555 return 0;
15561556 }
15571557
1558−static int vega20_populate_umdpstate_clocks(
1559− struct pp_hwmgr *hwmgr)
1558+static void vega20_populate_umdpstate_clocks(struct pp_hwmgr *hwmgr)
15601559 {
15611560 struct vega20_hwmgr *data = (struct vega20_hwmgr *)(hwmgr->backend);
15621561 struct vega20_single_dpm_table *gfx_table = &(data->dpm_table.gfx_table);
15631562 struct vega20_single_dpm_table *mem_table = &(data->dpm_table.mem_table);
15641563
1565− hwmgr->pstate_sclk = gfx_table->dpm_levels[0].value;
1566− hwmgr->pstate_mclk = mem_table->dpm_levels[0].value;
1567−
15681564 if (gfx_table->count > VEGA20_UMD_PSTATE_GFXCLK_LEVEL &&
15691565 mem_table->count > VEGA20_UMD_PSTATE_MCLK_LEVEL) {
15701566 hwmgr->pstate_sclk = gfx_table->dpm_levels[VEGA20_UMD_PSTATE_GFXCLK_LEVEL].value;
15711567 hwmgr->pstate_mclk = mem_table->dpm_levels[VEGA20_UMD_PSTATE_MCLK_LEVEL].value;
1568+ } else {
1569+ hwmgr->pstate_sclk = gfx_table->dpm_levels[0].value;
1570+ hwmgr->pstate_mclk = mem_table->dpm_levels[0].value;
15721571 }
15731572
1574− hwmgr->pstate_sclk = hwmgr->pstate_sclk * 100;
1575− hwmgr->pstate_mclk = hwmgr->pstate_mclk * 100;
1576−
1577− return 0;
1573+ hwmgr->pstate_sclk_peak = gfx_table->dpm_levels[gfx_table->count - 1].value;
1574+ hwmgr->pstate_mclk_peak = mem_table->dpm_levels[mem_table->count - 1].value;
15781575 }
15791576
15801577 static int vega20_get_max_sustainable_clock(struct pp_hwmgr *hwmgr,
@@ -1753,10 +1750,7 @@ static int vega20_enable_dpm_tasks(struct pp_hwmgr *hwmgr) · 172 unmodified lines
17531750 "[EnableDPMTasks] Failed to initialize odn settings!",
17541751 return result);
17551752
1756− result = vega20_populate_umdpstate_clocks(hwmgr);
1757− PP_ASSERT_WITH_CODE(!result,
1758− "[EnableDPMTasks] Failed to populate umdpstate clocks!",
1759− return result);
1753+ vega20_populate_umdpstate_clocks(hwmgr);
17601754
17611755 result = smum_send_msg_to_smc_with_parameter(hwmgr, PPSMC_MSG_GetPptLimit,
17621756 POWER_SOURCE_AC << 16, &hwmgr->default_power_limit);
drivers/gpu/drm/amd/pm/powerplay/inc/hwmgr.h+2−0
@@ -809,6 +809,8 @@ struct pp_hwmgr { · 808 unmodified lines
809809 uint32_t workload_prority[Workload_Policy_Max];
810810 uint32_t workload_setting[Workload_Policy_Max];
811811 bool gfxoff_state_changed_by_workload;
812+ uint32_t pstate_sclk_peak;
813+ uint32_t pstate_mclk_peak;
812814 };
813815
814816 int hwmgr_early_init(struct pp_hwmgr *hwmgr);
drivers/gpu/drm/amd/pm/powerplay/smumgr/smu10_smumgr.c+4−6
@@ -250,9 +250,8 @@ static int smu10_smu_init(struct pp_hwmgr *hwmgr) · 249 unmodified lines
250250
251251 /* allocate space for watermarks table */
252252 r = amdgpu_bo_create_kernel((struct amdgpu_device *)hwmgr->adev,
253− sizeof(Watermarks_t),
254− PAGE_SIZE,
255− AMDGPU_GEM_DOMAIN_VRAM,
253+ sizeof(Watermarks_t), PAGE_SIZE,
254+ AMDGPU_GEM_DOMAIN_VRAM | AMDGPU_GEM_DOMAIN_GTT,
256255 &priv->smu_tables.entry[SMU10_WMTABLE].handle,
257256 &priv->smu_tables.entry[SMU10_WMTABLE].mc_addr,
258257 &priv->smu_tables.entry[SMU10_WMTABLE].table);
@@ -266,9 +265,8 @@ static int smu10_smu_init(struct pp_hwmgr *hwmgr) · 7 unmodified lines
266265
267266 /* allocate space for watermarks table */
268267 r = amdgpu_bo_create_kernel((struct amdgpu_device *)hwmgr->adev,
269− sizeof(DpmClocks_t),
270− PAGE_SIZE,
271− AMDGPU_GEM_DOMAIN_VRAM,
268+ sizeof(DpmClocks_t), PAGE_SIZE,
269+ AMDGPU_GEM_DOMAIN_VRAM | AMDGPU_GEM_DOMAIN_GTT,
272270 &priv->smu_tables.entry[SMU10_CLOCKTABLE].handle,
273271 &priv->smu_tables.entry[SMU10_CLOCKTABLE].mc_addr,
274272 &priv->smu_tables.entry[SMU10_CLOCKTABLE].table);
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c+8−0
@@ -2473,6 +2473,14 @@ static int smu_read_sensor(void *handle, · 2472 unmodified lines
24732473 *((uint32_t *)data) = pstate_table->uclk_pstate.standard * 100;
24742474 *size = 4;
24752475 break;
2476+ case AMDGPU_PP_SENSOR_PEAK_PSTATE_SCLK:
2477+ *((uint32_t *)data) = pstate_table->gfxclk_pstate.peak * 100;
2478+ *size = 4;
2479+ break;
2480+ case AMDGPU_PP_SENSOR_PEAK_PSTATE_MCLK:
2481+ *((uint32_t *)data) = pstate_table->uclk_pstate.peak * 100;
2482+ *size = 4;
2483+ break;
24762484 case AMDGPU_PP_SENSOR_ENABLED_SMC_FEATURES_MASK:
24772485 ret = smu_feature_get_enabled_mask(smu, (uint64_t *)data);
24782486 *size = 8;
drivers/gpu/drm/amd/pm/swsmu/inc/smu_v13_0.h+0−5
@@ -244,11 +244,6 @@ int smu_v13_0_set_single_dpm_table(struct smu_context *smu, · 243 unmodified lines
244244 enum smu_clk_type clk_type,
245245 struct smu_13_0_dpm_table *single_dpm_table);
246246
247−int smu_v13_0_get_dpm_level_range(struct smu_context *smu,
248− enum smu_clk_type clk_type,
249− uint32_t *min_value,
250− uint32_t *max_value);
251−
252247 int smu_v13_0_get_current_pcie_link_width_level(struct smu_context *smu);
253248
254249 int smu_v13_0_get_current_pcie_link_width(struct smu_context *smu);
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0.c+2−41
@@ -1261,7 +1261,8 @@ int smu_v13_0_set_fan_speed_rpm(struct smu_context *smu, · 1260 unmodified lines
12611261 uint32_t speed)
12621262 {
12631263 struct amdgpu_device *adev = smu->adev;
1264− uint32_t tach_period, crystal_clock_freq;
1264+ uint32_t crystal_clock_freq = 2500;
1265+ uint32_t tach_period;
12651266 int ret;
12661267
12671268 if (!speed)
@@ -1271,7 +1272,6 @@ int smu_v13_0_set_fan_speed_rpm(struct smu_context *smu, · 3 unmodified lines
12711272 if (ret)
12721273 return ret;
12731274
1274− crystal_clock_freq = amdgpu_asic_get_xclk(adev);
12751275 tach_period = 60 * crystal_clock_freq * 10000 / (8 * speed);
12761276 WREG32_SOC15(THM, 0, regCG_TACH_CTRL,
12771277 REG_SET_FIELD(RREG32_SOC15(THM, 0, regCG_TACH_CTRL),
@@ -2064,45 +2064,6 @@ int smu_v13_0_set_single_dpm_table(struct smu_context *smu, · 786 unmodified lines
20642064 return 0;
20652065 }
20662066
2067−int smu_v13_0_get_dpm_level_range(struct smu_context *smu,
2068− enum smu_clk_type clk_type,
2069− uint32_t *min_value,
2070− uint32_t *max_value)
2071−{
2072− uint32_t level_count = 0;
2073− int ret = 0;
2074−
2075− if (!min_value && !max_value)
2076− return -EINVAL;
2077−
2078− if (min_value) {
2079− /* by default, level 0 clock value as min value */
2080− ret = smu_v13_0_get_dpm_freq_by_index(smu,
2081− clk_type,
2082− 0,
2083− min_value);
2084− if (ret)
2085− return ret;
2086− }
2087−
2088− if (max_value) {
2089− ret = smu_v13_0_get_dpm_level_count(smu,
2090− clk_type,
2091− &level_count);
2092− if (ret)
2093− return ret;
2094−
2095− ret = smu_v13_0_get_dpm_freq_by_index(smu,
2096− clk_type,
2097− level_count - 1,
2098− max_value);
2099− if (ret)
2100− return ret;
2101− }
2102−
2103− return ret;
2104−}
2105−
21062067 int smu_v13_0_get_current_pcie_link_width_level(struct smu_context *smu)
21072068 {
21082069 struct amdgpu_device *adev = smu->adev;
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_0_ppt.c+4−2
@@ -213,6 +213,7 @@ static struct cmn2asic_mapping smu_v13_0_0_feature_mask_map[SMU_FEATURE_COUNT] = · 212 unmodified lines
213213 FEA_MAP(SOC_PCC),
214214 [SMU_FEATURE_DPM_VCLK_BIT] = {1, FEATURE_MM_DPM_BIT},
215215 [SMU_FEATURE_DPM_DCLK_BIT] = {1, FEATURE_MM_DPM_BIT},
216+ [SMU_FEATURE_PPT_BIT] = {1, FEATURE_THROTTLERS_BIT},
216217 };
217218
218219 static struct cmn2asic_mapping smu_v13_0_0_table_map[SMU_TABLE_COUNT] = {
@@ -240,6 +241,7 @@ static struct cmn2asic_mapping smu_v13_0_0_workload_map[PP_SMC_POWER_PROFILE_COU · 21 unmodified lines
240241 WORKLOAD_MAP(PP_SMC_POWER_PROFILE_VR, WORKLOAD_PPLIB_VR_BIT),
241242 WORKLOAD_MAP(PP_SMC_POWER_PROFILE_COMPUTE, WORKLOAD_PPLIB_COMPUTE_BIT),
242243 WORKLOAD_MAP(PP_SMC_POWER_PROFILE_CUSTOM, WORKLOAD_PPLIB_CUSTOM_BIT),
244+ WORKLOAD_MAP(PP_SMC_POWER_PROFILE_WINDOW3D, WORKLOAD_PPLIB_WINDOW_3D_BIT),
243245 };
244246
245247 static const uint8_t smu_v13_0_0_throttler_map[] = {
@@ -1555,7 +1557,7 @@ static int smu_v13_0_0_get_power_profile_mode(struct smu_context *smu, · 1309 unmodified lines
15551557 title[0], title[1], title[2], title[3], title[4], title[5],
15561558 title[6], title[7], title[8], title[9]);
15571559
1558− for (i = 0; i <= PP_SMC_POWER_PROFILE_CUSTOM; i++) {
1560+ for (i = 0; i < PP_SMC_POWER_PROFILE_COUNT; i++) {
15591561 /* conv PP_SMC_POWER_PROFILE* to WORKLOAD_PPLIB_*_BIT */
15601562 workload_type = smu_cmn_to_asic_specific_index(smu,
15611563 CMN2ASIC_MAPPING_WORKLOAD,
@@ -1617,7 +1619,7 @@ static int smu_v13_0_0_set_power_profile_mode(struct smu_context *smu, · 55 unmodified lines
16171619
16181620 smu->power_profile_mode = input[size];
16191621
1620− if (smu->power_profile_mode > PP_SMC_POWER_PROFILE_CUSTOM) {
1622+ if (smu->power_profile_mode >= PP_SMC_POWER_PROFILE_COUNT) {
16211623 dev_err(smu->adev->dev, "Invalid power profile mode %d\n", smu->power_profile_mode);
16221624 return -EINVAL;
16231625 }
drivers/gpu/drm/amd/pm/swsmu/smu13/smu_v13_0_7_ppt.c+1−0
@@ -192,6 +192,7 @@ static struct cmn2asic_mapping smu_v13_0_7_feature_mask_map[SMU_FEATURE_COUNT] = · 191 unmodified lines
192192 FEA_MAP(SOC_PCC),
193193 [SMU_FEATURE_DPM_VCLK_BIT] = {1, FEATURE_MM_DPM_BIT},
194194 [SMU_FEATURE_DPM_DCLK_BIT] = {1, FEATURE_MM_DPM_BIT},
195+ [SMU_FEATURE_PPT_BIT] = {1, FEATURE_THROTTLERS_BIT},
195196 };
196197
197198 static struct cmn2asic_mapping smu_v13_0_7_table_map[SMU_TABLE_COUNT] = {
drivers/gpu/drm/radeon/atombios.h+5−5
@@ -4020,7 +4020,7 @@ typedef struct _ATOM_DISPLAY_OBJECT_PATH · 4019 unmodified lines
40204020 USHORT usSize; //the size of ATOM_DISPLAY_OBJECT_PATH
40214021 USHORT usConnObjectId; //Connector Object ID
40224022 USHORT usGPUObjectId; //GPU ID
4023− USHORT usGraphicObjIds[1]; //1st Encoder Obj source from GPU to last Graphic Obj destinate to connector.
4023+ USHORT usGraphicObjIds[]; //1st Encoder Obj source from GPU to last Graphic Obj destinate to connector.
40244024 }ATOM_DISPLAY_OBJECT_PATH;
40254025
40264026 typedef struct _ATOM_DISPLAY_EXTERNAL_OBJECT_PATH
@@ -4037,7 +4037,7 @@ typedef struct _ATOM_DISPLAY_OBJECT_PATH_TABLE · 10 unmodified lines
40374037 UCHAR ucNumOfDispPath;
40384038 UCHAR ucVersion;
40394039 UCHAR ucPadding[2];
4040− ATOM_DISPLAY_OBJECT_PATH asDispPath[1];
4040+ ATOM_DISPLAY_OBJECT_PATH asDispPath[];
40414041 }ATOM_DISPLAY_OBJECT_PATH_TABLE;
40424042
40434043
@@ -4053,7 +4053,7 @@ typedef struct _ATOM_OBJECT_TABLE //Above 4 object table · 9 unmodified lines
40534053 {
40544054 UCHAR ucNumberOfObjects;
40554055 UCHAR ucPadding[3];
4056− ATOM_OBJECT asObjects[1];
4056+ ATOM_OBJECT asObjects[];
40574057 }ATOM_OBJECT_TABLE;
40584058
40594059 typedef struct _ATOM_SRC_DST_TABLE_FOR_ONE_OBJECT //usSrcDstTableOffset pointing to this structure
@@ -4615,7 +4615,7 @@ typedef struct _ATOM_GPIO_VOLTAGE_OBJECT_V3 · 555 unmodified lines
46154615 UCHAR ucPhaseDelay; // phase delay in unit of micro second
46164616 UCHAR ucReserved;
46174617 ULONG ulGpioMaskVal; // GPIO Mask value
4618− VOLTAGE_LUT_ENTRY_V2 asVolGpioLut[1];
4618+ VOLTAGE_LUT_ENTRY_V2 asVolGpioLut[];
46194619 }ATOM_GPIO_VOLTAGE_OBJECT_V3;
46204620
46214621 typedef struct _ATOM_LEAKAGE_VOLTAGE_OBJECT_V3
@@ -7964,7 +7964,7 @@ typedef struct { · 3342 unmodified lines
79647964
79657965 typedef struct {
79667966 VFCT_IMAGE_HEADER VbiosHeader;
7967− UCHAR VbiosContent[1];
7967+ UCHAR VbiosContent[];
79687968 }GOP_VBIOS_CONTENT;
79697969
79707970 typedef struct {
include/drm/display/drm_dp.h+6−0
@@ -603,6 +603,7 @@ · 602 unmodified lines
603603
604604 #define DP_DOWNSPREAD_CTRL 0x107
605605 # define DP_SPREAD_AMP_0_5 (1 << 4)
606+# define DP_FIXED_VTOTAL_AS_SDP_EN_IN_PR_ACTIVE (1 << 6)
606607 # define DP_MSA_TIMING_PAR_IGNORE_EN (1 << 7) /* eDP */
607608
608609 #define DP_MAIN_LINK_CHANNEL_CODING_SET 0x108
@@ -1105,6 +1106,11 @@ · 496 unmodified lines
11051106 # define DP_VSC_EXT_CEA_SDP_SUPPORTED (1 << 6) /* DP 1.4 */
11061107 # define DP_VSC_EXT_CEA_SDP_CHAINING_SUPPORTED (1 << 7) /* DP 1.4 */
11071108
1109+#define DP_DPRX_FEATURE_ENUMERATION_LIST_CONT_1 0x2214 /* 2.0 E11 */
1110+# define DP_ADAPTIVE_SYNC_SDP_SUPPORTED (1 << 0)
1111+# define DP_AS_SDP_FIRST_HALF_LINE_OR_3840_PIXEL_CYCLE_WINDOW_NOT_SUPPORTED (1 << 1)
1112+# define DP_VSC_EXT_SDP_FRAMEWORK_VERSION_1_SUPPORTED (1 << 4)
1113+
11081114 #define DP_128B132B_SUPPORTED_LINK_RATES 0x2215 /* 2.0 */
11091115 # define DP_UHBR10 (1 << 0)
11101116 # define DP_UHBR20 (1 << 1)
include/uapi/drm/amdgpu_drm.h+6−0
@@ -832,6 +832,10 @@ struct drm_amdgpu_cs_chunk_data { · 831 unmodified lines
832832 #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_SCLK 0x8
833833 /* Subquery id: Query GPU stable pstate memory clock */
834834 #define AMDGPU_INFO_SENSOR_STABLE_PSTATE_GFX_MCLK 0x9
835+ /* Subquery id: Query GPU peak pstate shader clock */
836+ #define AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_SCLK 0xa
837+ /* Subquery id: Query GPU peak pstate memory clock */
838+ #define AMDGPU_INFO_SENSOR_PEAK_PSTATE_GFX_MCLK 0xb
835839 /* Number of VRAM page faults on CPU access. */
836840 #define AMDGPU_INFO_NUM_VRAM_CPU_PAGE_FAULTS 0x1E
837841 #define AMDGPU_INFO_VRAM_LOST_COUNTER 0x1F
@@ -1107,6 +1111,8 @@ struct drm_amdgpu_info_device { · 269 unmodified lines
11071111 __u32 pa_sc_tile_steering_override;
11081112 /* disabled TCCs */
11091113 __u64 tcc_disabled_mask;
1114+ __u64 min_engine_clock;
1115+ __u64 min_memory_clock;
11101116 };
11111117
11121118 struct drm_amdgpu_info_hw_ip {

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