History

Merge tag 'amd-drm-next-6.11-2024-07-03' of https://gitlab.freedesktop.org/agd5f/linux into drm-next

amd-drm-next-6.11-2024-07-03: amdgpu: - Use vmalloc for dc_state - Replay fixes - Freesync fixes - DCN 4.0.1 fixes - DML fixes - DCC updates - Misc code cleanups and bug fixes - 8K display fixes - DCN 3.5 fixes - Restructure DIO code - DML1 fixes - DML2 fixes - GFX11 fix - GFX12 updates - GFX12 modifiers fixes - RAS fixes - IP dump fixes - Add some updated IP version checks _ Silence UBSAN warning radeon: - GPUVM fix

Daniel Vetter committed 2 years ago

Commit 6be146c2 parents 71e9f40 4ed6a3694 files · +624 −318Browse files

Unified · Split

94 files
  1. drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c +11 −0
  2. drivers/gpu/drm/amd/amdgpu/amdgpu_display.c +57 −37
  3. drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c +1 −0
  4. drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h +1 −0
  5. drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c +1 −0
  6. drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c +1 −1
  7. drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c +1 −0
  8. drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c +2 −0
  9. drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c +14 −6
  10. drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c +0 −22
  11. drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c +2 −0
  12. drivers/gpu/drm/amd/amdgpu/imu_v11_0.c +1 −0
  13. drivers/gpu/drm/amd/amdgpu/mes_v11_0.c +2 −0
  14. drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c +1 −1
  15. drivers/gpu/drm/amd/amdgpu/psp_v13_0.c +3 −0
  16. drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c +1 −0
  17. drivers/gpu/drm/amd/amdgpu/soc21.c +28 −0
  18. drivers/gpu/drm/amd/amdgpu/vpe_v6_1.c +1 −0
  19. drivers/gpu/drm/amd/amdkfd/kfd_crat.c +1 −0
  20. drivers/gpu/drm/amd/amdkfd/kfd_device.c +7 −0
  21. drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c +2 −1
  22. drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c +11 −10
  23. drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c +5 −3
  24. drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c +41 −22
  25. drivers/gpu/drm/amd/amdkfd/kfd_process.c +15 −9
  26. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +58 −5
  27. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c +1 −3
  28. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c +4 −2
  29. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c +80 −28
  30. drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c +1 −1
  31. drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c +1 −1
  32. drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c +1 −1
  33. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c +1 −1
  34. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c +2 −2
  35. drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c +20 −18
  36. drivers/gpu/drm/amd/display/dc/core/dc_resource.c +4 −4
  37. drivers/gpu/drm/amd/display/dc/core/dc_stream.c +3 −3
  38. drivers/gpu/drm/amd/display/dc/dc.h +3 −1
  39. drivers/gpu/drm/amd/display/dc/dce/dce_audio.c +3 −2
  40. drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c +4 −4
  41. drivers/gpu/drm/amd/display/dc/dce/dce_panel_cntl.c +1 −1
  42. drivers/gpu/drm/amd/display/dc/dcn10/Makefile +0 −1
  43. drivers/gpu/drm/amd/display/dc/dcn20/Makefile +0 −1
  44. drivers/gpu/drm/amd/display/dc/dcn30/Makefile +0 −2
  45. drivers/gpu/drm/amd/display/dc/dcn31/Makefile +1 −1
  46. drivers/gpu/drm/amd/display/dc/dio/Makefile +36 −0
  47. drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_link_encoder.c +0 −0
  48. drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_link_encoder.h +0 −0
  49. drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.c +0 −0
  50. drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.h +0 −0
  51. drivers/gpu/drm/amd/display/dc/dio/dcn20/dcn20_link_encoder.c +0 −0
  52. drivers/gpu/drm/amd/display/dc/dio/dcn20/dcn20_link_encoder.h +0 −0
  53. drivers/gpu/drm/amd/display/dc/dio/dcn20/dcn20_stream_encoder.c +0 −0
  54. drivers/gpu/drm/amd/display/dc/dio/dcn20/dcn20_stream_encoder.h +0 −0
  55. drivers/gpu/drm/amd/display/dc/dio/dcn30/dcn30_dio_link_encoder.c +0 −0
  56. drivers/gpu/drm/amd/display/dc/dio/dcn30/dcn30_dio_link_encoder.h +0 −0
  57. drivers/gpu/drm/amd/display/dc/dio/dcn30/dcn30_dio_stream_encoder.c +0 −0
  58. drivers/gpu/drm/amd/display/dc/dio/dcn30/dcn30_dio_stream_encoder.h +0 −0
  59. drivers/gpu/drm/amd/display/dc/dio/dcn31/dcn31_dio_link_encoder.c +0 −0
  60. drivers/gpu/drm/amd/display/dc/dio/dcn31/dcn31_dio_link_encoder.h +0 −0
  61. drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c +1 −1
  62. drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c +3 −0
  63. drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c +12 −10
  64. drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_factory.c +1 −1
  65. drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_factory.c +1 −1
  66. drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_mcg/dml2_mcg_factory.c +1 −1
  67. drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_factory.c +1 −1
  68. drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c +1 −0
  69. drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c +3 −11
  70. drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c +0 −15
  71. drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h +0 −2
  72. drivers/gpu/drm/amd/display/dc/hubbub/dcn401/dcn401_hubbub.c +6 −0
  73. drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c +13 −2
  74. drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c +57 −5
  75. drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c +1 −1
  76. drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c +6 −0
  77. drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c +38 −9
  78. drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.h +1 −0
  79. drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c +1 −1
  80. drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c +0 −22
  81. drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c +1 −1
  82. drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c +0 −2
  83. drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c +3 −0
  84. drivers/gpu/drm/amd/display/dc/spl/dc_spl.c +4 −4
  85. drivers/gpu/drm/amd/display/dmub/dmub_srv.h +1 −0
  86. drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h +4 −1
  87. drivers/gpu/drm/amd/display/dmub/src/dmub_dcn35.c +1 −0
  88. drivers/gpu/drm/amd/display/modules/freesync/freesync.c +1 −1
  89. drivers/gpu/drm/amd/include/atomfirmware.h +1 −1
  90. drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c +1 −0
  91. drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c +8 −12
  92. drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c +15 −15
  93. drivers/gpu/drm/radeon/radeon_gem.c +1 −1
  94. include/uapi/drm/drm_fourcc.h +2 −3
drivers/gpu/drm/amd/amdgpu/amdgpu_discovery.c+11−0
@@ -1808,6 +1808,7 @@ static int amdgpu_discovery_set_common_ip_blocks(struct amdgpu_device *adev) · 1807 unmodified lines
18081808 case IP_VERSION(11, 0, 4):
18091809 case IP_VERSION(11, 5, 0):
18101810 case IP_VERSION(11, 5, 1):
1811+ case IP_VERSION(11, 5, 2):
18111812 amdgpu_device_ip_block_add(adev, &soc21_common_ip_block);
18121813 break;
18131814 case IP_VERSION(12, 0, 0):
@@ -1861,6 +1862,7 @@ static int amdgpu_discovery_set_gmc_ip_blocks(struct amdgpu_device *adev) · 47 unmodified lines
18611862 case IP_VERSION(11, 0, 4):
18621863 case IP_VERSION(11, 5, 0):
18631864 case IP_VERSION(11, 5, 1):
1865+ case IP_VERSION(11, 5, 2):
18641866 amdgpu_device_ip_block_add(adev, &gmc_v11_0_ip_block);
18651867 break;
18661868 case IP_VERSION(12, 0, 0):
@@ -1962,6 +1964,7 @@ static int amdgpu_discovery_set_psp_ip_blocks(struct amdgpu_device *adev) · 95 unmodified lines
19621964 case IP_VERSION(13, 0, 14):
19631965 case IP_VERSION(14, 0, 0):
19641966 case IP_VERSION(14, 0, 1):
1967+ case IP_VERSION(14, 0, 4):
19651968 amdgpu_device_ip_block_add(adev, &psp_v13_0_ip_block);
19661969 break;
19671970 case IP_VERSION(13, 0, 4):
@@ -2025,6 +2028,7 @@ static int amdgpu_discovery_set_smu_ip_blocks(struct amdgpu_device *adev) · 57 unmodified lines
20252028 case IP_VERSION(14, 0, 1):
20262029 case IP_VERSION(14, 0, 2):
20272030 case IP_VERSION(14, 0, 3):
2031+ case IP_VERSION(14, 0, 4):
20282032 amdgpu_device_ip_block_add(adev, &smu_v14_0_ip_block);
20292033 break;
20302034 default:
@@ -2152,6 +2156,7 @@ static int amdgpu_discovery_set_gc_ip_blocks(struct amdgpu_device *adev) · 121 unmodified lines
21522156 case IP_VERSION(11, 0, 4):
21532157 case IP_VERSION(11, 5, 0):
21542158 case IP_VERSION(11, 5, 1):
2159+ case IP_VERSION(11, 5, 2):
21552160 amdgpu_device_ip_block_add(adev, &gfx_v11_0_ip_block);
21562161 break;
21572162 case IP_VERSION(12, 0, 0):
@@ -2207,6 +2212,7 @@ static int amdgpu_discovery_set_sdma_ip_blocks(struct amdgpu_device *adev) · 49 unmodified lines
22072212 case IP_VERSION(6, 0, 3):
22082213 case IP_VERSION(6, 1, 0):
22092214 case IP_VERSION(6, 1, 1):
2215+ case IP_VERSION(6, 1, 2):
22102216 amdgpu_device_ip_block_add(adev, &sdma_v6_0_ip_block);
22112217 break;
22122218 case IP_VERSION(7, 0, 0):
@@ -2325,6 +2331,7 @@ static int amdgpu_discovery_set_mes_ip_blocks(struct amdgpu_device *adev) · 112 unmodified lines
23252331 case IP_VERSION(11, 0, 4):
23262332 case IP_VERSION(11, 5, 0):
23272333 case IP_VERSION(11, 5, 1):
2334+ case IP_VERSION(11, 5, 2):
23282335 amdgpu_device_ip_block_add(adev, &mes_v11_0_ip_block);
23292336 adev->enable_mes = true;
23302337 adev->enable_mes_kiq = true;
@@ -2360,6 +2367,7 @@ static int amdgpu_discovery_set_vpe_ip_blocks(struct amdgpu_device *adev) · 29 unmodified lines
23602367 switch (amdgpu_ip_version(adev, VPE_HWIP, 0)) {
23612368 case IP_VERSION(6, 1, 0):
23622369 case IP_VERSION(6, 1, 1):
2370+ case IP_VERSION(6, 1, 3):
23632371 amdgpu_device_ip_block_add(adev, &vpe_v6_1_ip_block);
23642372 break;
23652373 default:
@@ -2634,6 +2642,7 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev) · 268 unmodified lines
26342642 break;
26352643 case IP_VERSION(11, 5, 0):
26362644 case IP_VERSION(11, 5, 1):
2645+ case IP_VERSION(11, 5, 2):
26372646 adev->family = AMDGPU_FAMILY_GC_11_5_0;
26382647 break;
26392648 case IP_VERSION(12, 0, 0):
@@ -2658,6 +2667,7 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev) · 18 unmodified lines
26582667 case IP_VERSION(11, 0, 4):
26592668 case IP_VERSION(11, 5, 0):
26602669 case IP_VERSION(11, 5, 1):
2670+ case IP_VERSION(11, 5, 2):
26612671 adev->flags |= AMD_IS_APU;
26622672 break;
26632673 default:
@@ -2696,6 +2706,7 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev) · 32 unmodified lines
26962706 break;
26972707 case IP_VERSION(7, 11, 0):
26982708 case IP_VERSION(7, 11, 1):
2709+ case IP_VERSION(7, 11, 3):
26992710 adev->nbio.funcs = &nbio_v7_11_funcs;
27002711 adev->nbio.hdp_flush_reg = &nbio_v7_11_hdp_flush_reg;
27012712 break;
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c+57−37
@@ -654,6 +654,10 @@ amdgpu_lookup_format_info(u32 format, uint64_t modifier) · 653 unmodified lines
654654 if (!IS_AMD_FMT_MOD(modifier))
655655 return NULL;
656656
657+ if (AMD_FMT_MOD_GET(TILE_VERSION, modifier) < AMD_FMT_MOD_TILE_VER_GFX9 ||
658+ AMD_FMT_MOD_GET(TILE_VERSION, modifier) >= AMD_FMT_MOD_TILE_VER_GFX12)
659+ return NULL;
660+
657661 if (AMD_FMT_MOD_GET(DCC_RETILE, modifier))
658662 return lookup_format_info(dcc_retile_formats,
659663 ARRAY_SIZE(dcc_retile_formats),
@@ -720,32 +724,25 @@ extract_render_dcc_offset(struct amdgpu_device *adev, · 60 unmodified lines
720724
721725 static int convert_tiling_flags_to_modifier_gfx12(struct amdgpu_framebuffer *afb)
722726 {
723− struct amdgpu_device *adev = drm_to_adev(afb->base.dev);
724− const struct drm_format_info *format_info;
725727 u64 modifier = 0;
726− int tile = 0;
727− int swizzle = 0;
728+ int swizzle_mode = AMDGPU_TILING_GET(afb->tiling_flags, GFX12_SWIZZLE_MODE);
728729
729− if (amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(12, 0, 0)) {
730− tile = AMD_FMT_MOD_TILE_VER_GFX12;
731− swizzle = AMDGPU_TILING_GET(afb->tiling_flags, GFX12_SWIZZLE_MODE);
730+ if (!swizzle_mode) {
731+ modifier = DRM_FORMAT_MOD_LINEAR;
732+ } else {
733+ int max_comp_block =
734+ AMDGPU_TILING_GET(afb->tiling_flags, GFX12_DCC_MAX_COMPRESSED_BLOCK);
735+
736+ modifier =
737+ AMD_FMT_MOD |
738+ AMD_FMT_MOD_SET(TILE_VERSION, AMD_FMT_MOD_TILE_VER_GFX12) |
739+ AMD_FMT_MOD_SET(TILE, swizzle_mode) |
740+ AMD_FMT_MOD_SET(DCC, afb->gfx12_dcc) |
741+ AMD_FMT_MOD_SET(DCC_MAX_COMPRESSED_BLOCK, max_comp_block);
732742 }
733743
734− modifier =
735− AMD_FMT_MOD |
736− AMD_FMT_MOD_SET(TILE, swizzle) |
737− AMD_FMT_MOD_SET(TILE_VERSION, tile) |
738− AMD_FMT_MOD_SET(DCC, 0) |
739− AMD_FMT_MOD_SET(DCC_MAX_COMPRESSED_BLOCK, 0);
740−
741− format_info = amdgpu_lookup_format_info(afb->base.format->format,
742− modifier);
743− if (!format_info)
744− return -EINVAL;
745−
746744 afb->base.modifier = modifier;
747745 afb->base.flags |= DRM_MODE_FB_MODIFIERS;
748−
749746 return 0;
750747 }
751748
@@ -773,12 +770,6 @@ static int convert_tiling_flags_to_modifier(struct amdgpu_framebuffer *afb) · 21 unmodified lines
773770 int pipes = ilog2(num_pipes);
774771 uint32_t dcc_offset = AMDGPU_TILING_GET(afb->tiling_flags, DCC_OFFSET_256B);
775772
776−
777− if (amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(12, 0, 0)) {
778− convert_tiling_flags_to_modifier_gfx12(afb);
779− return 0;
780− }
781−
782773 switch (swizzle >> 2) {
783774 case 0: /* 256B */
784775 block_size_bits = 8;
@@ -954,8 +945,7 @@ static int check_tiling_flags_gfx6(struct amdgpu_framebuffer *afb) · 169 unmodified lines
954945 {
955946 u64 micro_tile_mode;
956947
957− /* Zero swizzle mode means linear */
958− if (AMDGPU_TILING_GET(afb->tiling_flags, SWIZZLE_MODE) == 0)
948+ if (AMDGPU_TILING_GET(afb->tiling_flags, ARRAY_MODE) == 1) /* LINEAR_ALIGNED */
959949 return 0;
960950
961951 micro_tile_mode = AMDGPU_TILING_GET(afb->tiling_flags, MICRO_TILE_MODE);
@@ -1079,6 +1069,30 @@ static int amdgpu_display_verify_sizes(struct amdgpu_framebuffer *rfb) · 117 unmodified lines
10791069 block_width = 256 / format_info->cpp[i];
10801070 block_height = 1;
10811071 block_size_log2 = 8;
1072+ } else if (AMD_FMT_MOD_GET(TILE_VERSION, modifier) >= AMD_FMT_MOD_TILE_VER_GFX12) {
1073+ int swizzle = AMD_FMT_MOD_GET(TILE, modifier);
1074+
1075+ switch (swizzle) {
1076+ case AMD_FMT_MOD_TILE_GFX12_256B_2D:
1077+ block_size_log2 = 8;
1078+ break;
1079+ case AMD_FMT_MOD_TILE_GFX12_4K_2D:
1080+ block_size_log2 = 12;
1081+ break;
1082+ case AMD_FMT_MOD_TILE_GFX12_64K_2D:
1083+ block_size_log2 = 16;
1084+ break;
1085+ case AMD_FMT_MOD_TILE_GFX12_256K_2D:
1086+ block_size_log2 = 18;
1087+ break;
1088+ default:
1089+ drm_dbg_kms(rfb->base.dev,
1090+ "Gfx12 swizzle mode with unknown block size: %d\n", swizzle);
1091+ return -EINVAL;
1092+ }
1093+
1094+ get_block_dimensions(block_size_log2, format_info->cpp[i],
1095+ &block_width, &block_height);
10821096 } else {
10831097 int swizzle = AMD_FMT_MOD_GET(TILE, modifier);
10841098
@@ -1114,7 +1128,8 @@ static int amdgpu_display_verify_sizes(struct amdgpu_framebuffer *rfb) · 29 unmodified lines
11141128 return ret;
11151129 }
11161130
1117− if (AMD_FMT_MOD_GET(DCC, modifier)) {
1131+ if (AMD_FMT_MOD_GET(TILE_VERSION, modifier) <= AMD_FMT_MOD_TILE_VER_GFX11 &&
1132+ AMD_FMT_MOD_GET(DCC, modifier)) {
11181133 if (AMD_FMT_MOD_GET(DCC_RETILE, modifier)) {
11191134 block_size_log2 = get_dcc_block_size(modifier, false, false);
11201135 get_block_dimensions(block_size_log2 + 8, format_info->cpp[0],
@@ -1144,7 +1159,8 @@ static int amdgpu_display_verify_sizes(struct amdgpu_framebuffer *rfb) · 23 unmodified lines
11441159 }
11451160
11461161 static int amdgpu_display_get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb,
1147− uint64_t *tiling_flags, bool *tmz_surface)
1162+ uint64_t *tiling_flags, bool *tmz_surface,
1163+ bool *gfx12_dcc)
11481164 {
11491165 struct amdgpu_bo *rbo;
11501166 int r;
@@ -1152,6 +1168,7 @@ static int amdgpu_display_get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb · 1 unmodified line
11521168 if (!amdgpu_fb) {
11531169 *tiling_flags = 0;
11541170 *tmz_surface = false;
1171+ *gfx12_dcc = false;
11551172 return 0;
11561173 }
11571174
@@ -1165,11 +1182,9 @@ static int amdgpu_display_get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb · 7 unmodified lines
11651182 return r;
11661183 }
11671184
1168− if (tiling_flags)
1169− amdgpu_bo_get_tiling_flags(rbo, tiling_flags);
1170−
1171− if (tmz_surface)
1172− *tmz_surface = amdgpu_bo_encrypted(rbo);
1185+ amdgpu_bo_get_tiling_flags(rbo, tiling_flags);
1186+ *tmz_surface = amdgpu_bo_encrypted(rbo);
1187+ *gfx12_dcc = rbo->flags & AMDGPU_GEM_CREATE_GFX12_DCC;
11731188
11741189 amdgpu_bo_unreserve(rbo);
11751190
@@ -1238,7 +1253,8 @@ static int amdgpu_display_framebuffer_init(struct drm_device *dev, · 62 unmodified lines
12381253 }
12391254 }
12401255
1241− ret = amdgpu_display_get_fb_info(rfb, &rfb->tiling_flags, &rfb->tmz_surface);
1256+ ret = amdgpu_display_get_fb_info(rfb, &rfb->tiling_flags, &rfb->tmz_surface,
1257+ &rfb->gfx12_dcc);
12421258 if (ret)
12431259 return ret;
12441260
@@ -1252,7 +1268,11 @@ static int amdgpu_display_framebuffer_init(struct drm_device *dev, · 7 unmodified lines
12521268
12531269 if (!dev->mode_config.fb_modifiers_not_supported &&
12541270 !(rfb->base.flags & DRM_MODE_FB_MODIFIERS)) {
1255− ret = convert_tiling_flags_to_modifier(rfb);
1271+ if (amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(12, 0, 0))
1272+ ret = convert_tiling_flags_to_modifier_gfx12(rfb);
1273+ else
1274+ ret = convert_tiling_flags_to_modifier(rfb);
1275+
12561276 if (ret) {
12571277 drm_dbg_kms(dev, "Failed to convert tiling flags 0x%llX to a modifier",
12581278 rfb->tiling_flags);
drivers/gpu/drm/amd/amdgpu/amdgpu_gmc.c+1−0
@@ -848,6 +848,7 @@ void amdgpu_gmc_tmz_set(struct amdgpu_device *adev) · 847 unmodified lines
848848 case IP_VERSION(11, 0, 4):
849849 case IP_VERSION(11, 5, 0):
850850 case IP_VERSION(11, 5, 1):
851+ case IP_VERSION(11, 5, 2):
851852 /* Don't enable it by default yet.
852853 */
853854 if (amdgpu_tmz < 1) {
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h+1−0
@@ -300,6 +300,7 @@ struct amdgpu_framebuffer { · 299 unmodified lines
300300
301301 uint64_t tiling_flags;
302302 bool tmz_surface;
303+ bool gfx12_dcc;
303304
304305 /* caching for later use */
305306 uint64_t address;
drivers/gpu/drm/amd/amdgpu/amdgpu_psp.c+1−0
@@ -219,6 +219,7 @@ static int psp_early_init(void *handle) · 218 unmodified lines
219219 case IP_VERSION(13, 0, 11):
220220 case IP_VERSION(14, 0, 0):
221221 case IP_VERSION(14, 0, 1):
222+ case IP_VERSION(14, 0, 4):
222223 psp_v13_0_set_psp_funcs(psp);
223224 psp->boot_time_tmr = false;
224225 break;
drivers/gpu/drm/amd/amdgpu/amdgpu_ras.c+1−1
@@ -4565,7 +4565,7 @@ static void amdgpu_ras_boot_time_error_reporting(struct amdgpu_device *adev, · 4564 unmodified lines
45654565
45664566 socket_id = AMDGPU_RAS_GPU_ERR_SOCKET_ID(boot_error);
45674567 aid_id = AMDGPU_RAS_GPU_ERR_AID_ID(boot_error);
4568− hbm_id = AMDGPU_RAS_GPU_ERR_HBM_ID(boot_error);
4568+ hbm_id = ((1 == AMDGPU_RAS_GPU_ERR_HBM_ID(boot_error)) ? 0 : 1);
45694569
45704570 if (AMDGPU_RAS_GPU_ERR_MEM_TRAINING(boot_error))
45714571 dev_info(adev->dev,
drivers/gpu/drm/amd/amdgpu/amdgpu_vpe.c+1−0
@@ -302,6 +302,7 @@ static int vpe_early_init(void *handle) · 301 unmodified lines
302302
303303 switch (amdgpu_ip_version(adev, VPE_HWIP, 0)) {
304304 case IP_VERSION(6, 1, 0):
305+ case IP_VERSION(6, 1, 3):
305306 vpe_v6_1_set_funcs(vpe);
306307 break;
307308 case IP_VERSION(6, 1, 1):
drivers/gpu/drm/amd/amdgpu/gfx_v10_0.c+2−0
@@ -9287,6 +9287,7 @@ static void gfx_v10_ip_print(void *handle, struct drm_printer *p) · 9286 unmodified lines
92879287 if (!adev->gfx.ip_dump_gfx_queues)
92889288 return;
92899289
9290+ index = 0;
92909291 reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_10);
92919292 drm_printf(p, "\nnum_me: %d num_pipe: %d num_queue: %d\n",
92929293 adev->gfx.me.num_me,
@@ -9352,6 +9353,7 @@ static void gfx_v10_ip_dump(void *handle) · 59 unmodified lines
93529353 if (!adev->gfx.ip_dump_gfx_queues)
93539354 return;
93549355
9356+ index = 0;
93559357 reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_10);
93569358 amdgpu_gfx_off_ctrl(adev, false);
93579359 mutex_lock(&adev->srbm_mutex);
drivers/gpu/drm/amd/amdgpu/gfx_v11_0.c+14−6
@@ -93,6 +93,10 @@ MODULE_FIRMWARE("amdgpu/gc_11_5_1_pfp.bin"); · 92 unmodified lines
9393 MODULE_FIRMWARE("amdgpu/gc_11_5_1_me.bin");
9494 MODULE_FIRMWARE("amdgpu/gc_11_5_1_mec.bin");
9595 MODULE_FIRMWARE("amdgpu/gc_11_5_1_rlc.bin");
96+MODULE_FIRMWARE("amdgpu/gc_11_5_2_pfp.bin");
97+MODULE_FIRMWARE("amdgpu/gc_11_5_2_me.bin");
98+MODULE_FIRMWARE("amdgpu/gc_11_5_2_mec.bin");
99+MODULE_FIRMWARE("amdgpu/gc_11_5_2_rlc.bin");
96100
97101 static const struct amdgpu_hwip_reg_entry gc_reg_list_11_0[] = {
98102 SOC15_REG_ENTRY_STR(GC, 0, regGRBM_STATUS),
@@ -1054,6 +1058,7 @@ static int gfx_v11_0_gpu_early_init(struct amdgpu_device *adev) · 955 unmodified lines
10541058 case IP_VERSION(11, 0, 4):
10551059 case IP_VERSION(11, 5, 0):
10561060 case IP_VERSION(11, 5, 1):
1061+ case IP_VERSION(11, 5, 2):
10571062 adev->gfx.config.max_hw_contexts = 8;
10581063 adev->gfx.config.sc_prim_fifo_size_frontend = 0x20;
10591064 adev->gfx.config.sc_prim_fifo_size_backend = 0x100;
@@ -1534,6 +1539,7 @@ static int gfx_v11_0_sw_init(void *handle) · 474 unmodified lines
15341539 case IP_VERSION(11, 0, 4):
15351540 case IP_VERSION(11, 5, 0):
15361541 case IP_VERSION(11, 5, 1):
1542+ case IP_VERSION(11, 5, 2):
15371543 adev->gfx.me.num_me = 1;
15381544 adev->gfx.me.num_pipe_per_me = 1;
15391545 adev->gfx.me.num_queue_per_pipe = 1;
@@ -2782,7 +2788,8 @@ static int gfx_v11_0_wait_for_rlc_autoload_complete(struct amdgpu_device *adev) · 1242 unmodified lines
27822788 amdgpu_ip_version(adev, GC_HWIP, 0) ==
27832789 IP_VERSION(11, 0, 4) ||
27842790 amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(11, 5, 0) ||
2785− amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(11, 5, 1))
2791+ amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(11, 5, 1) ||
2792+ amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(11, 5, 2))
27862793 bootload_status = RREG32_SOC15(GC, 0,
27872794 regRLC_RLCS_BOOTLOAD_STATUS_gc_11_0_1);
27882795 else
@@ -5296,6 +5303,7 @@ static void gfx_v11_cntl_power_gating(struct amdgpu_device *adev, bool enable) · 2507 unmodified lines
52965303 case IP_VERSION(11, 0, 4):
52975304 case IP_VERSION(11, 5, 0):
52985305 case IP_VERSION(11, 5, 1):
5306+ case IP_VERSION(11, 5, 2):
52995307 WREG32_SOC15(GC, 0, regRLC_PG_DELAY_3, RLC_PG_DELAY_3_DEFAULT_GC_11_0_1);
53005308 break;
53015309 default:
@@ -5332,6 +5340,7 @@ static int gfx_v11_0_set_powergating_state(void *handle, · 30 unmodified lines
53325340 case IP_VERSION(11, 0, 4):
53335341 case IP_VERSION(11, 5, 0):
53345342 case IP_VERSION(11, 5, 1):
5343+ case IP_VERSION(11, 5, 2):
53355344 if (!enable)
53365345 amdgpu_gfx_off_ctrl(adev, false);
53375346
@@ -5364,6 +5373,7 @@ static int gfx_v11_0_set_clockgating_state(void *handle, · 26 unmodified lines
53645373 case IP_VERSION(11, 0, 4):
53655374 case IP_VERSION(11, 5, 0):
53665375 case IP_VERSION(11, 5, 1):
5376+ case IP_VERSION(11, 5, 2):
53675377 gfx_v11_0_update_gfx_clock_gating(adev,
53685378 state == AMD_CG_STATE_GATE);
53695379 break;
@@ -5604,11 +5614,7 @@ static void gfx_v11_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, · 234 unmodified lines
56045614 amdgpu_ring_write(ring, PACKET3(PACKET3_RELEASE_MEM, 6));
56055615 amdgpu_ring_write(ring, (PACKET3_RELEASE_MEM_GCR_SEQ |
56065616 PACKET3_RELEASE_MEM_GCR_GL2_WB |
5607− PACKET3_RELEASE_MEM_GCR_GL2_INV |
5608− PACKET3_RELEASE_MEM_GCR_GL2_US |
5609− PACKET3_RELEASE_MEM_GCR_GL1_INV |
5610− PACKET3_RELEASE_MEM_GCR_GLV_INV |
5611− PACKET3_RELEASE_MEM_GCR_GLM_INV |
5617+ PACKET3_RELEASE_MEM_GCR_GLM_INV | /* must be set with GLM_WB */
56125618 PACKET3_RELEASE_MEM_GCR_GLM_WB |
56135619 PACKET3_RELEASE_MEM_CACHE_POLICY(3) |
56145620 PACKET3_RELEASE_MEM_EVENT_TYPE(CACHE_FLUSH_AND_INV_TS_EVENT) |
@@ -6405,6 +6411,7 @@ static void gfx_v11_ip_print(void *handle, struct drm_printer *p) · 790 unmodified lines
64056411 if (!adev->gfx.ip_dump_gfx_queues)
64066412 return;
64076413
6414+ index = 0;
64086415 reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_11);
64096416 drm_printf(p, "\nnum_me: %d num_pipe: %d num_queue: %d\n",
64106417 adev->gfx.me.num_me,
@@ -6469,6 +6476,7 @@ static void gfx_v11_ip_dump(void *handle) · 58 unmodified lines
64696476 if (!adev->gfx.ip_dump_gfx_queues)
64706477 return;
64716478
6479+ index = 0;
64726480 reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_11);
64736481 amdgpu_gfx_off_ctrl(adev, false);
64746482 mutex_lock(&adev->srbm_mutex);
drivers/gpu/drm/amd/amdgpu/gfx_v12_0.c+0−22
@@ -4108,21 +4108,6 @@ static void gfx_v12_0_ring_emit_ib_compute(struct amdgpu_ring *ring, · 4107 unmodified lines
41084108 /* inherit vmid from mqd */
41094109 control |= 0x40000000;
41104110
4111− /* Currently, there is a high possibility to get wave ID mismatch
4112− * between ME and GDS, leading to a hw deadlock, because ME generates
4113− * different wave IDs than the GDS expects. This situation happens
4114− * randomly when at least 5 compute pipes use GDS ordered append.
4115− * The wave IDs generated by ME are also wrong after suspend/resume.
4116− * Those are probably bugs somewhere else in the kernel driver.
4117− *
4118− * Writing GDS_COMPUTE_MAX_WAVE_ID resets wave ID counters in ME and
4119− * GDS to 0 for this ring (me/pipe).
4120− */
4121− if (ib->flags & AMDGPU_IB_FLAG_RESET_GDS_MAX_WAVE_ID) {
4122− amdgpu_ring_write(ring, PACKET3(PACKET3_SET_CONFIG_REG, 1));
4123− amdgpu_ring_write(ring, regGDS_COMPUTE_MAX_WAVE_ID);
4124− }
4125−
41264111 amdgpu_ring_write(ring, PACKET3(PACKET3_INDIRECT_BUFFER, 2));
41274112 BUG_ON(ib->gpu_addr & 0x3); /* Dword align */
41284113 amdgpu_ring_write(ring,
@@ -4144,12 +4129,6 @@ static void gfx_v12_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, · 15 unmodified lines
41444129 amdgpu_ring_write(ring, PACKET3(PACKET3_RELEASE_MEM, 6));
41454130 amdgpu_ring_write(ring, (PACKET3_RELEASE_MEM_GCR_SEQ |
41464131 PACKET3_RELEASE_MEM_GCR_GL2_WB |
4147− PACKET3_RELEASE_MEM_GCR_GL2_INV |
4148− PACKET3_RELEASE_MEM_GCR_GL2_US |
4149− PACKET3_RELEASE_MEM_GCR_GL1_INV |
4150− PACKET3_RELEASE_MEM_GCR_GLV_INV |
4151− PACKET3_RELEASE_MEM_GCR_GLM_INV |
4152− PACKET3_RELEASE_MEM_GCR_GLM_WB |
41534132 PACKET3_RELEASE_MEM_CACHE_POLICY(3) |
41544133 PACKET3_RELEASE_MEM_EVENT_TYPE(CACHE_FLUSH_AND_INV_TS_EVENT) |
41554134 PACKET3_RELEASE_MEM_EVENT_INDEX(5)));
@@ -4727,7 +4706,6 @@ static const struct amdgpu_ring_funcs gfx_v12_0_ring_funcs_gfx = { · 571 unmodified lines
47274706 SOC15_FLUSH_GPU_TLB_NUM_REG_WAIT * 7 +
47284707 2 + /* VM_FLUSH */
47294708 8 + /* FENCE for VM_FLUSH */
4730− 20 + /* GDS switch */
47314709 5 + /* COND_EXEC */
47324710 7 + /* HDP_flush */
47334711 4 + /* VGT_flush */
drivers/gpu/drm/amd/amdgpu/gmc_v11_0.c+2−0
@@ -592,6 +592,7 @@ static void gmc_v11_0_set_gfxhub_funcs(struct amdgpu_device *adev) · 591 unmodified lines
592592 break;
593593 case IP_VERSION(11, 5, 0):
594594 case IP_VERSION(11, 5, 1):
595+ case IP_VERSION(11, 5, 2):
595596 adev->gfxhub.funcs = &gfxhub_v11_5_0_funcs;
596597 break;
597598 default:
@@ -754,6 +755,7 @@ static int gmc_v11_0_sw_init(void *handle) · 156 unmodified lines
754755 case IP_VERSION(11, 0, 4):
755756 case IP_VERSION(11, 5, 0):
756757 case IP_VERSION(11, 5, 1):
758+ case IP_VERSION(11, 5, 2):
757759 set_bit(AMDGPU_GFXHUB(0), adev->vmhubs_mask);
758760 set_bit(AMDGPU_MMHUB0(0), adev->vmhubs_mask);
759761 /*
drivers/gpu/drm/amd/amdgpu/imu_v11_0.c+1−0
@@ -38,6 +38,7 @@ MODULE_FIRMWARE("amdgpu/gc_11_0_3_imu.bin"); · 37 unmodified lines
3838 MODULE_FIRMWARE("amdgpu/gc_11_0_4_imu.bin");
3939 MODULE_FIRMWARE("amdgpu/gc_11_5_0_imu.bin");
4040 MODULE_FIRMWARE("amdgpu/gc_11_5_1_imu.bin");
41+MODULE_FIRMWARE("amdgpu/gc_11_5_2_imu.bin");
4142
4243 static int imu_v11_0_init_microcode(struct amdgpu_device *adev)
4344 {
drivers/gpu/drm/amd/amdgpu/mes_v11_0.c+2−0
@@ -51,6 +51,8 @@ MODULE_FIRMWARE("amdgpu/gc_11_5_0_mes_2.bin"); · 50 unmodified lines
5151 MODULE_FIRMWARE("amdgpu/gc_11_5_0_mes1.bin");
5252 MODULE_FIRMWARE("amdgpu/gc_11_5_1_mes_2.bin");
5353 MODULE_FIRMWARE("amdgpu/gc_11_5_1_mes1.bin");
54+MODULE_FIRMWARE("amdgpu/gc_11_5_2_mes_2.bin");
55+MODULE_FIRMWARE("amdgpu/gc_11_5_2_mes1.bin");
5456
5557 static int mes_v11_0_hw_init(void *handle);
5658 static int mes_v11_0_hw_fini(void *handle);
drivers/gpu/drm/amd/amdgpu/mmhub_v1_8.c+1−1
@@ -569,7 +569,7 @@ static bool mmhub_v1_8_query_utcl2_poison_status(struct amdgpu_device *adev, · 568 unmodified lines
569569 if (!amdgpu_sriov_vf(adev)) {
570570 /* clear page fault status and address */
571571 WREG32_P(SOC15_REG_OFFSET(MMHUB, hub_inst,
572− regVM_L2_PROTECTION_FAULT_STATUS), 1, ~1);
572+ regVM_L2_PROTECTION_FAULT_CNTL), 1, ~1);
573573 }
574574
575575 return fed;
drivers/gpu/drm/amd/amdgpu/psp_v13_0.c+3−0
@@ -57,6 +57,8 @@ MODULE_FIRMWARE("amdgpu/psp_14_0_0_toc.bin"); · 56 unmodified lines
5757 MODULE_FIRMWARE("amdgpu/psp_14_0_0_ta.bin");
5858 MODULE_FIRMWARE("amdgpu/psp_14_0_1_toc.bin");
5959 MODULE_FIRMWARE("amdgpu/psp_14_0_1_ta.bin");
60+MODULE_FIRMWARE("amdgpu/psp_14_0_4_toc.bin");
61+MODULE_FIRMWARE("amdgpu/psp_14_0_4_ta.bin");
6062
6163 /* For large FW files the time to complete can be very long */
6264 #define USBC_PD_POLLING_LIMIT_S 240
@@ -106,6 +108,7 @@ static int psp_v13_0_init_microcode(struct psp_context *psp) · 43 unmodified lines
106108 case IP_VERSION(13, 0, 11):
107109 case IP_VERSION(14, 0, 0):
108110 case IP_VERSION(14, 0, 1):
111+ case IP_VERSION(14, 0, 4):
109112 err = psp_init_toc_microcode(psp, ucode_prefix);
110113 if (err)
111114 return err;
drivers/gpu/drm/amd/amdgpu/sdma_v6_0.c+1−0
@@ -50,6 +50,7 @@ MODULE_FIRMWARE("amdgpu/sdma_6_0_2.bin"); · 49 unmodified lines
5050 MODULE_FIRMWARE("amdgpu/sdma_6_0_3.bin");
5151 MODULE_FIRMWARE("amdgpu/sdma_6_1_0.bin");
5252 MODULE_FIRMWARE("amdgpu/sdma_6_1_1.bin");
53+MODULE_FIRMWARE("amdgpu/sdma_6_1_2.bin");
5354
5455 #define SDMA1_REG_OFFSET 0x600
5556 #define SDMA0_HYP_DEC_REG_START 0x5880
drivers/gpu/drm/amd/amdgpu/soc21.c+28−0
@@ -389,6 +389,7 @@ soc21_asic_reset_method(struct amdgpu_device *adev) · 388 unmodified lines
389389 case IP_VERSION(13, 0, 11):
390390 case IP_VERSION(14, 0, 0):
391391 case IP_VERSION(14, 0, 1):
392+ case IP_VERSION(14, 0, 4):
392393 return AMD_RESET_METHOD_MODE2;
393394 default:
394395 if (amdgpu_dpm_is_baco_supported(adev))
@@ -752,6 +753,32 @@ static int soc21_common_early_init(void *handle) · 357 unmodified lines
752753 AMD_PG_SUPPORT_JPEG;
753754 adev->external_rev_id = adev->rev_id + 0xc1;
754755 break;
756+ case IP_VERSION(11, 5, 2):
757+ adev->cg_flags = AMD_CG_SUPPORT_VCN_MGCG |
758+ AMD_CG_SUPPORT_JPEG_MGCG |
759+ AMD_CG_SUPPORT_GFX_CGCG |
760+ AMD_CG_SUPPORT_GFX_CGLS |
761+ AMD_CG_SUPPORT_GFX_MGCG |
762+ AMD_CG_SUPPORT_GFX_FGCG |
763+ AMD_CG_SUPPORT_REPEATER_FGCG |
764+ AMD_CG_SUPPORT_GFX_PERF_CLK |
765+ AMD_CG_SUPPORT_GFX_3D_CGCG |
766+ AMD_CG_SUPPORT_GFX_3D_CGLS |
767+ AMD_CG_SUPPORT_MC_MGCG |
768+ AMD_CG_SUPPORT_MC_LS |
769+ AMD_CG_SUPPORT_HDP_LS |
770+ AMD_CG_SUPPORT_HDP_DS |
771+ AMD_CG_SUPPORT_HDP_SD |
772+ AMD_CG_SUPPORT_ATHUB_MGCG |
773+ AMD_CG_SUPPORT_ATHUB_LS |
774+ AMD_CG_SUPPORT_IH_CG |
775+ AMD_CG_SUPPORT_BIF_MGCG |
776+ AMD_CG_SUPPORT_BIF_LS;
777+ adev->pg_flags = AMD_PG_SUPPORT_VCN |
778+ AMD_PG_SUPPORT_JPEG |
779+ AMD_PG_SUPPORT_GFX_PG;
780+ adev->external_rev_id = adev->rev_id + 0x40;
781+ break;
755782 default:
756783 /* FIXME: not supported yet */
757784 return -EINVAL;
@@ -927,6 +954,7 @@ static int soc21_common_set_clockgating_state(void *handle, · 169 unmodified lines
927954 case IP_VERSION(7, 7, 1):
928955 case IP_VERSION(7, 11, 0):
929956 case IP_VERSION(7, 11, 1):
957+ case IP_VERSION(7, 11, 3):
930958 adev->nbio.funcs->update_medium_grain_clock_gating(adev,
931959 state == AMD_CG_STATE_GATE);
932960 adev->nbio.funcs->update_medium_grain_light_sleep(adev,
drivers/gpu/drm/amd/amdgpu/vpe_v6_1.c+1−0
@@ -34,6 +34,7 @@ · 33 unmodified lines
3434
3535 MODULE_FIRMWARE("amdgpu/vpe_6_1_0.bin");
3636 MODULE_FIRMWARE("amdgpu/vpe_6_1_1.bin");
37+MODULE_FIRMWARE("amdgpu/vpe_6_1_3.bin");
3738
3839 #define VPE_THREAD1_UCODE_OFFSET 0x8000
3940
drivers/gpu/drm/amd/amdkfd/kfd_crat.c+1−0
@@ -1678,6 +1678,7 @@ int kfd_get_gpu_cache_info(struct kfd_node *kdev, struct kfd_gpu_cache_info **pc · 1677 unmodified lines
16781678 case IP_VERSION(11, 0, 4):
16791679 case IP_VERSION(11, 5, 0):
16801680 case IP_VERSION(11, 5, 1):
1681+ case IP_VERSION(11, 5, 2):
16811682 case IP_VERSION(12, 0, 0):
16821683 case IP_VERSION(12, 0, 1):
16831684 num_of_cache_types =
drivers/gpu/drm/amd/amdkfd/kfd_device.c+7−0
@@ -99,6 +99,7 @@ static void kfd_device_info_set_sdma_info(struct kfd_dev *kfd) · 98 unmodified lines
9999 case IP_VERSION(6, 0, 3):
100100 case IP_VERSION(6, 1, 0):
101101 case IP_VERSION(6, 1, 1):
102+ case IP_VERSION(6, 1, 2):
102103 case IP_VERSION(7, 0, 0):
103104 case IP_VERSION(7, 0, 1):
104105 kfd->device_info.num_sdma_queues_per_engine = 8;
@@ -119,6 +120,7 @@ static void kfd_device_info_set_sdma_info(struct kfd_dev *kfd) · 14 unmodified lines
119120 case IP_VERSION(6, 0, 3):
120121 case IP_VERSION(6, 1, 0):
121122 case IP_VERSION(6, 1, 1):
123+ case IP_VERSION(6, 1, 2):
122124 case IP_VERSION(7, 0, 0):
123125 case IP_VERSION(7, 0, 1):
124126 /* Reserve 1 for paging and 1 for gfx */
@@ -175,6 +177,7 @@ static void kfd_device_info_set_event_interrupt_class(struct kfd_dev *kfd) · 50 unmodified lines
175177 case IP_VERSION(11, 0, 4):
176178 case IP_VERSION(11, 5, 0):
177179 case IP_VERSION(11, 5, 1):
180+ case IP_VERSION(11, 5, 2):
178181 kfd->device_info.event_interrupt_class = &event_interrupt_class_v11;
179182 break;
180183 case IP_VERSION(12, 0, 0):
@@ -438,6 +441,10 @@ struct kfd_dev *kgd2kfd_probe(struct amdgpu_device *adev, bool vf) · 257 unmodified lines
438441 gfx_target_version = 110501;
439442 f2g = &gfx_v11_kfd2kgd;
440443 break;
444+ case IP_VERSION(11, 5, 2):
445+ gfx_target_version = 110502;
446+ f2g = &gfx_v11_kfd2kgd;
447+ break;
441448 case IP_VERSION(12, 0, 0):
442449 gfx_target_version = 120000;
443450 f2g = &gfx_v12_kfd2kgd;
drivers/gpu/drm/amd/amdkfd/kfd_flat_memory.c+2−1
@@ -380,7 +380,8 @@ int kfd_init_apertures(struct kfd_process *process) · 379 unmodified lines
380380
381381 pdd = kfd_create_process_device_data(dev, process);
382382 if (!pdd) {
383− pr_err("Failed to create process device data\n");
383+ dev_err(dev->adev->dev,
384+ "Failed to create process device data\n");
384385 return -ENOMEM;
385386 }
386387 /*
drivers/gpu/drm/amd/amdkfd/kfd_kernel_queue.c+11−10
@@ -69,7 +69,7 @@ static bool kq_initialize(struct kernel_queue *kq, struct kfd_node *dev, · 68 unmodified lines
6969 kq->mqd_mgr = dev->dqm->mqd_mgrs[KFD_MQD_TYPE_HIQ];
7070 break;
7171 default:
72− pr_err("Invalid queue type %d\n", type);
72+ dev_err(dev->adev->dev, "Invalid queue type %d\n", type);
7373 return false;
7474 }
7575
@@ -79,13 +79,14 @@ static bool kq_initialize(struct kernel_queue *kq, struct kfd_node *dev, · 3 unmodified lines
7979 prop.doorbell_ptr = kfd_get_kernel_doorbell(dev->kfd, &prop.doorbell_off);
8080
8181 if (!prop.doorbell_ptr) {
82− pr_err("Failed to initialize doorbell");
82+ dev_err(dev->adev->dev, "Failed to initialize doorbell");
8383 goto err_get_kernel_doorbell;
8484 }
8585
8686 retval = kfd_gtt_sa_allocate(dev, queue_size, &kq->pq);
8787 if (retval != 0) {
88− pr_err("Failed to init pq queues size %d\n", queue_size);
88+ dev_err(dev->adev->dev, "Failed to init pq queues size %d\n",
89+ queue_size);
8990 goto err_pq_allocate_vidmem;
9091 }
9192
@@ -341,7 +342,7 @@ struct kernel_queue *kernel_queue_init(struct kfd_node *dev, · 249 unmodified lines
341342 if (kq_initialize(kq, dev, type, KFD_KERNEL_QUEUE_SIZE))
342343 return kq;
343344
344− pr_err("Failed to init kernel queue\n");
345+ dev_err(dev->adev->dev, "Failed to init kernel queue\n");
345346
346347 kfree(kq);
347348 return NULL;
@@ -360,26 +361,26 @@ static __attribute__((unused)) void test_kq(struct kfd_node *dev) · 12 unmodified lines
360361 uint32_t *buffer, i;
361362 int retval;
362363
363− pr_err("Starting kernel queue test\n");
364+ dev_err(dev->adev->dev, "Starting kernel queue test\n");
364365
365366 kq = kernel_queue_init(dev, KFD_QUEUE_TYPE_HIQ);
366367 if (unlikely(!kq)) {
367− pr_err(" Failed to initialize HIQ\n");
368− pr_err("Kernel queue test failed\n");
368+ dev_err(dev->adev->dev, " Failed to initialize HIQ\n");
369+ dev_err(dev->adev->dev, "Kernel queue test failed\n");
369370 return;
370371 }
371372
372373 retval = kq_acquire_packet_buffer(kq, 5, &buffer);
373374 if (unlikely(retval != 0)) {
374− pr_err(" Failed to acquire packet buffer\n");
375− pr_err("Kernel queue test failed\n");
375+ dev_err(dev->adev->dev, " Failed to acquire packet buffer\n");
376+ dev_err(dev->adev->dev, "Kernel queue test failed\n");
376377 return;
377378 }
378379 for (i = 0; i < 5; i++)
379380 buffer[i] = kq->nop_packet;
380381 kq_submit_packet(kq);
381382
382− pr_err("Ending kernel queue test\n");
383+ dev_err(dev->adev->dev, "Ending kernel queue test\n");
383384 }
384385
385386
drivers/gpu/drm/amd/amdkfd/kfd_mqd_manager.c+5−3
@@ -118,12 +118,14 @@ void mqd_symmetrically_map_cu_mask(struct mqd_manager *mm, · 117 unmodified lines
118118 * attention grabbing.
119119 */
120120 if (gfx_info->max_shader_engines > KFD_MAX_NUM_SE) {
121− pr_err("Exceeded KFD_MAX_NUM_SE, chip reports %d\n",
122− gfx_info->max_shader_engines);
121+ dev_err(mm->dev->adev->dev,
122+ "Exceeded KFD_MAX_NUM_SE, chip reports %d\n",
123+ gfx_info->max_shader_engines);
123124 return;
124125 }
125126 if (gfx_info->max_sh_per_se > KFD_MAX_NUM_SH_PER_SE) {
126− pr_err("Exceeded KFD_MAX_NUM_SH, chip reports %d\n",
127+ dev_err(mm->dev->adev->dev,
128+ "Exceeded KFD_MAX_NUM_SH, chip reports %d\n",
127129 gfx_info->max_sh_per_se * gfx_info->max_shader_engines);
128130 return;
129131 }
drivers/gpu/drm/amd/amdkfd/kfd_packet_manager.c+41−22
@@ -45,7 +45,8 @@ static void pm_calc_rlib_size(struct packet_manager *pm, · 44 unmodified lines
4545 unsigned int process_count, queue_count, compute_queue_count, gws_queue_count;
4646 unsigned int map_queue_size;
4747 unsigned int max_proc_per_quantum = 1;
48− struct kfd_node *dev = pm->dqm->dev;
48+ struct kfd_node *node = pm->dqm->dev;
49+ struct device *dev = node->adev->dev;
4950
5051 process_count = pm->dqm->processes_count;
5152 queue_count = pm->dqm->active_queue_count;
@@ -59,14 +60,14 @@ static void pm_calc_rlib_size(struct packet_manager *pm, · 7 unmodified lines
5960 */
6061 *over_subscription = false;
6162
62− if (dev->max_proc_per_quantum > 1)
63− max_proc_per_quantum = dev->max_proc_per_quantum;
63+ if (node->max_proc_per_quantum > 1)
64+ max_proc_per_quantum = node->max_proc_per_quantum;
6465
6566 if ((process_count > max_proc_per_quantum) ||
6667 compute_queue_count > get_cp_queues_num(pm->dqm) ||
6768 gws_queue_count > 1) {
6869 *over_subscription = true;
69− pr_debug("Over subscribed runlist\n");
70+ dev_dbg(dev, "Over subscribed runlist\n");
7071 }
7172
7273 map_queue_size = pm->pmf->map_queues_size;
@@ -81,7 +82,7 @@ static void pm_calc_rlib_size(struct packet_manager *pm, · 8 unmodified lines
8182 if (*over_subscription)
8283 *rlib_size += pm->pmf->runlist_size;
8384
84− pr_debug("runlist ib size %d\n", *rlib_size);
85+ dev_dbg(dev, "runlist ib size %d\n", *rlib_size);
8586 }
8687
8788 static int pm_allocate_runlist_ib(struct packet_manager *pm,
@@ -90,6 +91,8 @@ static int pm_allocate_runlist_ib(struct packet_manager *pm, · 2 unmodified lines
9091 unsigned int *rl_buffer_size,
9192 bool *is_over_subscription)
9293 {
94+ struct kfd_node *node = pm->dqm->dev;
95+ struct device *dev = node->adev->dev;
9396 int retval;
9497
9598 if (WARN_ON(pm->allocated))
@@ -99,11 +102,10 @@ static int pm_allocate_runlist_ib(struct packet_manager *pm, · 3 unmodified lines
99102
100103 mutex_lock(&pm->lock);
101104
102− retval = kfd_gtt_sa_allocate(pm->dqm->dev, *rl_buffer_size,
103− &pm->ib_buffer_obj);
105+ retval = kfd_gtt_sa_allocate(node, *rl_buffer_size, &pm->ib_buffer_obj);
104106
105107 if (retval) {
106− pr_err("Failed to allocate runlist IB\n");
108+ dev_err(dev, "Failed to allocate runlist IB\n");
107109 goto out;
108110 }
109111
@@ -125,6 +127,8 @@ static int pm_create_runlist_ib(struct packet_manager *pm, · 15 unmodified lines
125127 {
126128 unsigned int alloc_size_bytes;
127129 unsigned int *rl_buffer, rl_wptr, i;
130+ struct kfd_node *node = pm->dqm->dev;
131+ struct device *dev = node->adev->dev;
128132 int retval, processes_mapped;
129133 struct device_process_node *cur;
130134 struct qcm_process_device *qpd;
@@ -142,7 +146,7 @@ static int pm_create_runlist_ib(struct packet_manager *pm, · 11 unmodified lines
142146 *rl_size_bytes = alloc_size_bytes;
143147 pm->ib_size_bytes = alloc_size_bytes;
144148
145− pr_debug("Building runlist ib process count: %d queues count %d\n",
149+ dev_dbg(dev, "Building runlist ib process count: %d queues count %d\n",
146150 pm->dqm->processes_count, pm->dqm->active_queue_count);
147151
148152 /* build the run list ib packet */
@@ -150,7 +154,7 @@ static int pm_create_runlist_ib(struct packet_manager *pm, · 1 unmodified line
150154 qpd = cur->qpd;
151155 /* build map process packet */
152156 if (processes_mapped >= pm->dqm->processes_count) {
153− pr_debug("Not enough space left in runlist IB\n");
157+ dev_dbg(dev, "Not enough space left in runlist IB\n");
154158 pm_release_ib(pm);
155159 return -ENOMEM;
156160 }
@@ -167,7 +171,8 @@ static int pm_create_runlist_ib(struct packet_manager *pm, · 10 unmodified lines
167171 if (!kq->queue->properties.is_active)
168172 continue;
169173
170− pr_debug("static_queue, mapping kernel q %d, is debug status %d\n",
174+ dev_dbg(dev,
175+ "static_queue, mapping kernel q %d, is debug status %d\n",
171176 kq->queue->queue, qpd->is_debug);
172177
173178 retval = pm->pmf->map_queues(pm,
@@ -186,7 +191,8 @@ static int pm_create_runlist_ib(struct packet_manager *pm, · 12 unmodified lines
186191 if (!q->properties.is_active)
187192 continue;
188193
189− pr_debug("static_queue, mapping user queue %d, is debug status %d\n",
194+ dev_dbg(dev,
195+ "static_queue, mapping user queue %d, is debug status %d\n",
190196 q->queue, qpd->is_debug);
191197
192198 retval = pm->pmf->map_queues(pm,
@@ -203,11 +209,13 @@ static int pm_create_runlist_ib(struct packet_manager *pm, · 10 unmodified lines
203209 }
204210 }
205211
206− pr_debug("Finished map process and queues to runlist\n");
212+ dev_dbg(dev, "Finished map process and queues to runlist\n");
207213
208214 if (is_over_subscription) {
209215 if (!pm->is_over_subscription)
210− pr_warn("Runlist is getting oversubscribed. Expect reduced ROCm performance.\n");
216+ dev_warn(
217+ dev,
218+ "Runlist is getting oversubscribed. Expect reduced ROCm performance.\n");
211219 retval = pm->pmf->runlist(pm, &rl_buffer[rl_wptr],
212220 *rl_gpu_addr,
213221 alloc_size_bytes / sizeof(uint32_t),
@@ -273,6 +281,8 @@ void pm_uninit(struct packet_manager *pm) · 59 unmodified lines
273281 int pm_send_set_resources(struct packet_manager *pm,
274282 struct scheduling_resources *res)
275283 {
284+ struct kfd_node *node = pm->dqm->dev;
285+ struct device *dev = node->adev->dev;
276286 uint32_t *buffer, size;
277287 int retval = 0;
278288
@@ -282,7 +292,7 @@ int pm_send_set_resources(struct packet_manager *pm, · 3 unmodified lines
282292 size / sizeof(uint32_t),
283293 (unsigned int **)&buffer);
284294 if (!buffer) {
285− pr_err("Failed to allocate buffer on kernel queue\n");
295+ dev_err(dev, "Failed to allocate buffer on kernel queue\n");
286296 retval = -ENOMEM;
287297 goto out;
288298 }
@@ -344,6 +354,8 @@ fail_create_runlist_ib: · 55 unmodified lines
344354 int pm_send_query_status(struct packet_manager *pm, uint64_t fence_address,
345355 uint64_t fence_value)
346356 {
357+ struct kfd_node *node = pm->dqm->dev;
358+ struct device *dev = node->adev->dev;
347359 uint32_t *buffer, size;
348360 int retval = 0;
349361
@@ -355,7 +367,7 @@ int pm_send_query_status(struct packet_manager *pm, uint64_t fence_address, · 5 unmodified lines
355367 kq_acquire_packet_buffer(pm->priv_queue,
356368 size / sizeof(uint32_t), (unsigned int **)&buffer);
357369 if (!buffer) {
358− pr_err("Failed to allocate buffer on kernel queue\n");
370+ dev_err(dev, "Failed to allocate buffer on kernel queue\n");
359371 retval = -ENOMEM;
360372 goto out;
361373 }
@@ -373,6 +385,8 @@ out: · 11 unmodified lines
373385
374386 int pm_update_grace_period(struct packet_manager *pm, uint32_t grace_period)
375387 {
388+ struct kfd_node *node = pm->dqm->dev;
389+ struct device *dev = node->adev->dev;
376390 int retval = 0;
377391 uint32_t *buffer, size;
378392
@@ -386,7 +400,8 @@ int pm_update_grace_period(struct packet_manager *pm, uint32_t grace_period) · 7 unmodified lines
386400 (unsigned int **)&buffer);
387401
388402 if (!buffer) {
389− pr_err("Failed to allocate buffer on kernel queue\n");
403+ dev_err(dev,
404+ "Failed to allocate buffer on kernel queue\n");
390405 retval = -ENOMEM;
391406 goto out;
392407 }
@@ -407,6 +422,8 @@ int pm_send_unmap_queue(struct packet_manager *pm, · 14 unmodified lines
407422 enum kfd_unmap_queues_filter filter,
408423 uint32_t filter_param, bool reset)
409424 {
425+ struct kfd_node *node = pm->dqm->dev;
426+ struct device *dev = node->adev->dev;
410427 uint32_t *buffer, size;
411428 int retval = 0;
412429
@@ -415,7 +432,7 @@ int pm_send_unmap_queue(struct packet_manager *pm, · 2 unmodified lines
415432 kq_acquire_packet_buffer(pm->priv_queue,
416433 size / sizeof(uint32_t), (unsigned int **)&buffer);
417434 if (!buffer) {
418− pr_err("Failed to allocate buffer on kernel queue\n");
435+ dev_err(dev, "Failed to allocate buffer on kernel queue\n");
419436 retval = -ENOMEM;
420437 goto out;
421438 }
@@ -464,6 +481,8 @@ out: · 42 unmodified lines
464481
465482 int pm_debugfs_hang_hws(struct packet_manager *pm)
466483 {
484+ struct kfd_node *node = pm->dqm->dev;
485+ struct device *dev = node->adev->dev;
467486 uint32_t *buffer, size;
468487 int r = 0;
469488
@@ -475,16 +494,16 @@ int pm_debugfs_hang_hws(struct packet_manager *pm) · 5 unmodified lines
475494 kq_acquire_packet_buffer(pm->priv_queue,
476495 size / sizeof(uint32_t), (unsigned int **)&buffer);
477496 if (!buffer) {
478− pr_err("Failed to allocate buffer on kernel queue\n");
497+ dev_err(dev, "Failed to allocate buffer on kernel queue\n");
479498 r = -ENOMEM;
480499 goto out;
481500 }
482501 memset(buffer, 0x55, size);
483502 kq_submit_packet(pm->priv_queue);
484503
485− pr_info("Submitting %x %x %x %x %x %x %x to HIQ to hang the HWS.",
486− buffer[0], buffer[1], buffer[2], buffer[3],
487− buffer[4], buffer[5], buffer[6]);
504+ dev_info(dev, "Submitting %x %x %x %x %x %x %x to HIQ to hang the HWS.",
505+ buffer[0], buffer[1], buffer[2], buffer[3], buffer[4],
506+ buffer[5], buffer[6]);
488507 out:
489508 mutex_unlock(&pm->lock);
490509 return r;
drivers/gpu/drm/amd/amdkfd/kfd_process.c+15−9
@@ -1311,7 +1311,8 @@ int kfd_process_init_cwsr_apu(struct kfd_process *p, struct file *filep) · 1310 unmodified lines
13111311 if (IS_ERR_VALUE(qpd->tba_addr)) {
13121312 int err = qpd->tba_addr;
13131313
1314− pr_err("Failure to set tba address. error %d.\n", err);
1314+ dev_err(dev->adev->dev,
1315+ "Failure to set tba address. error %d.\n", err);
13151316 qpd->tba_addr = 0;
13161317 qpd->cwsr_kaddr = NULL;
13171318 return err;
@@ -1611,7 +1612,8 @@ struct kfd_process_device *kfd_create_process_device_data(struct kfd_node *dev, · 293 unmodified lines
16111612 &pdd->proc_ctx_cpu_ptr,
16121613 false);
16131614 if (retval) {
1614− pr_err("failed to allocate process context bo\n");
1615+ dev_err(dev->adev->dev,
1616+ "failed to allocate process context bo\n");
16151617 goto err_free_pdd;
16161618 }
16171619 memset(pdd->proc_ctx_cpu_ptr, 0, AMDGPU_MES_PROC_CTX_SIZE);
@@ -1676,7 +1678,7 @@ int kfd_process_device_init_vm(struct kfd_process_device *pdd, · 58 unmodified lines
16761678 &p->kgd_process_info,
16771679 &ef);
16781680 if (ret) {
1679− pr_err("Failed to create process VM object\n");
1681+ dev_err(dev->adev->dev, "Failed to create process VM object\n");
16801682 return ret;
16811683 }
16821684 RCU_INIT_POINTER(p->ef, ef);
@@ -1723,7 +1725,7 @@ struct kfd_process_device *kfd_bind_process_to_device(struct kfd_node *dev, · 40 unmodified lines
17231725
17241726 pdd = kfd_get_process_device_data(dev, p);
17251727 if (!pdd) {
1726− pr_err("Process device data doesn't exist\n");
1728+ dev_err(dev->adev->dev, "Process device data doesn't exist\n");
17271729 return ERR_PTR(-ENOMEM);
17281730 }
17291731
@@ -1833,6 +1835,7 @@ int kfd_process_evict_queues(struct kfd_process *p, uint32_t trigger) · 103 unmodified lines
18331835
18341836 for (i = 0; i < p->n_pdds; i++) {
18351837 struct kfd_process_device *pdd = p->pdds[i];
1838+ struct device *dev = pdd->dev->adev->dev;
18361839
18371840 kfd_smi_event_queue_eviction(pdd->dev, p->lead_thread->pid,
18381841 trigger);
@@ -1844,7 +1847,7 @@ int kfd_process_evict_queues(struct kfd_process *p, uint32_t trigger) · 5 unmodified lines
18441847 * them been add back since they actually not be saved right now.
18451848 */
18461849 if (r && r != -EIO) {
1847− pr_err("Failed to evict process queues\n");
1850+ dev_err(dev, "Failed to evict process queues\n");
18481851 goto fail;
18491852 }
18501853 n_evicted++;
@@ -1866,7 +1869,8 @@ fail: · 15 unmodified lines
18661869
18671870 if (pdd->dev->dqm->ops.restore_process_queues(pdd->dev->dqm,
18681871 &pdd->qpd))
1869− pr_err("Failed to restore queues\n");
1872+ dev_err(pdd->dev->adev->dev,
1873+ "Failed to restore queues\n");
18701874
18711875 n_evicted--;
18721876 }
@@ -1882,13 +1886,14 @@ int kfd_process_restore_queues(struct kfd_process *p) · 9 unmodified lines
18821886
18831887 for (i = 0; i < p->n_pdds; i++) {
18841888 struct kfd_process_device *pdd = p->pdds[i];
1889+ struct device *dev = pdd->dev->adev->dev;
18851890
18861891 kfd_smi_event_queue_restore(pdd->dev, p->lead_thread->pid);
18871892
18881893 r = pdd->dev->dqm->ops.restore_process_queues(pdd->dev->dqm,
18891894 &pdd->qpd);
18901895 if (r) {
1891− pr_err("Failed to restore process queues\n");
1896+ dev_err(dev, "Failed to restore process queues\n");
18921897 if (!ret)
18931898 ret = r;
18941899 }
@@ -2065,7 +2070,7 @@ int kfd_reserved_mem_mmap(struct kfd_node *dev, struct kfd_process *process, · 170 unmodified lines
20652070 struct qcm_process_device *qpd;
20662071
20672072 if ((vma->vm_end - vma->vm_start) != KFD_CWSR_TBA_TMA_SIZE) {
2068− pr_err("Incorrect CWSR mapping size.\n");
2073+ dev_err(dev->adev->dev, "Incorrect CWSR mapping size.\n");
20692074 return -EINVAL;
20702075 }
20712076
@@ -2077,7 +2082,8 @@ int kfd_reserved_mem_mmap(struct kfd_node *dev, struct kfd_process *process, · 5 unmodified lines
20772082 qpd->cwsr_kaddr = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
20782083 get_order(KFD_CWSR_TBA_TMA_SIZE));
20792084 if (!qpd->cwsr_kaddr) {
2080− pr_err("Error allocating per process CWSR buffer.\n");
2085+ dev_err(dev->adev->dev,
2086+ "Error allocating per process CWSR buffer.\n");
20812087 return -ENOMEM;
20822088 }
20832089
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c+58−5
@@ -7561,7 +7561,7 @@ static int dm_update_mst_vcpi_slots_for_dsc(struct drm_atomic_state *state, · 7560 unmodified lines
75617561 }
75627562 }
75637563
7564− if (j == dc_state->stream_count)
7564+ if (j == dc_state->stream_count || pbn_div == 0)
75657565 continue;
75667566
75677567 slot_num = DIV_ROUND_UP(pbn, pbn_div);
@@ -10462,6 +10462,7 @@ skip_modeset: · 2894 unmodified lines
1046210462 }
1046310463
1046410464 /* Update Freesync settings. */
10465+ reset_freesync_config_for_crtc(dm_new_crtc_state);
1046510466 get_freesync_config_for_crtc(dm_new_crtc_state,
1046610467 dm_new_conn_state);
1046710468
@@ -10666,12 +10667,14 @@ static int dm_check_cursor_fb(struct amdgpu_crtc *new_acrtc, · 198 unmodified lines
1066610667 * check tiling flags when the FB doesn't have a modifier.
1066710668 */
1066810669 if (!(fb->flags & DRM_MODE_FB_MODIFIERS)) {
10669− if (adev->family < AMDGPU_FAMILY_AI) {
10670+ if (adev->family >= AMDGPU_FAMILY_GC_12_0_0) {
10671+ linear = AMDGPU_TILING_GET(afb->tiling_flags, GFX12_SWIZZLE_MODE) == 0;
10672+ } else if (adev->family >= AMDGPU_FAMILY_AI) {
10673+ linear = AMDGPU_TILING_GET(afb->tiling_flags, SWIZZLE_MODE) == 0;
10674+ } else {
1067010675 linear = AMDGPU_TILING_GET(afb->tiling_flags, ARRAY_MODE) != DC_ARRAY_2D_TILED_THIN1 &&
1067110676 AMDGPU_TILING_GET(afb->tiling_flags, ARRAY_MODE) != DC_ARRAY_1D_TILED_THIN1 &&
1067210677 AMDGPU_TILING_GET(afb->tiling_flags, MICRO_TILE_MODE) == 0;
10673− } else {
10674− linear = AMDGPU_TILING_GET(afb->tiling_flags, SWIZZLE_MODE) == 0;
1067510678 }
1067610679 if (!linear) {
1067710680 DRM_DEBUG_ATOMIC("Cursor FB not linear");
@@ -11863,6 +11866,49 @@ static bool parse_edid_cea(struct amdgpu_dm_connector *aconnector, · 1185 unmodified lines
1186311866 return ret;
1186411867 }
1186511868
11869+static void parse_edid_displayid_vrr(struct drm_connector *connector,
11870+ struct edid *edid)
11871+{
11872+ u8 *edid_ext = NULL;
11873+ int i;
11874+ int j = 0;
11875+ u16 min_vfreq;
11876+ u16 max_vfreq;
11877+
11878+ if (edid == NULL || edid->extensions == 0)
11879+ return;
11880+
11881+ /* Find DisplayID extension */
11882+ for (i = 0; i < edid->extensions; i++) {
11883+ edid_ext = (void *)(edid + (i + 1));
11884+ if (edid_ext[0] == DISPLAYID_EXT)
11885+ break;
11886+ }
11887+
11888+ if (edid_ext == NULL)
11889+ return;
11890+
11891+ while (j < EDID_LENGTH) {
11892+ /* Get dynamic video timing range from DisplayID if available */
11893+ if (EDID_LENGTH - j > 13 && edid_ext[j] == 0x25 &&
11894+ (edid_ext[j+1] & 0xFE) == 0 && (edid_ext[j+2] == 9)) {
11895+ min_vfreq = edid_ext[j+9];
11896+ if (edid_ext[j+1] & 7)
11897+ max_vfreq = edid_ext[j+10] + ((edid_ext[j+11] & 3) << 8);
11898+ else
11899+ max_vfreq = edid_ext[j+10];
11900+
11901+ if (max_vfreq && min_vfreq) {
11902+ connector->display_info.monitor_range.max_vfreq = max_vfreq;
11903+ connector->display_info.monitor_range.min_vfreq = min_vfreq;
11904+
11905+ return;
11906+ }
11907+ }
11908+ j++;
11909+ }
11910+}
11911+
1186611912 static int parse_amd_vsdb(struct amdgpu_dm_connector *aconnector,
1186711913 struct edid *edid, struct amdgpu_hdmi_vsdb_info *vsdb_info)
1186811914 {
@@ -11983,6 +12029,11 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, · 114 unmodified lines
1198312029 if (!adev->dm.freesync_module)
1198412030 goto update;
1198512031
12032+ /* Some eDP panels only have the refresh rate range info in DisplayID */
12033+ if ((connector->display_info.monitor_range.min_vfreq == 0 ||
12034+ connector->display_info.monitor_range.max_vfreq == 0))
12035+ parse_edid_displayid_vrr(connector, edid);
12036+
1198612037 if (edid && (sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT ||
1198712038 sink->sink_signal == SIGNAL_TYPE_EDP)) {
1198812039 bool edid_check_required = false;
@@ -11990,9 +12041,11 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, · 1 unmodified line
1199012041 if (is_dp_capable_without_timing_msa(adev->dm.dc,
1199112042 amdgpu_dm_connector)) {
1199212043 if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) {
11993− freesync_capable = true;
1199412044 amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq;
1199512045 amdgpu_dm_connector->max_vfreq = connector->display_info.monitor_range.max_vfreq;
12046+ if (amdgpu_dm_connector->max_vfreq -
12047+ amdgpu_dm_connector->min_vfreq > 10)
12048+ freesync_capable = true;
1199612049 } else {
1199712050 edid_check_required = edid->version > 1 ||
1199812051 (edid->version == 1 &&
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_helpers.c+1−3
@@ -575,10 +575,8 @@ bool dm_helpers_dp_write_dpcd( · 574 unmodified lines
575575 {
576576 struct amdgpu_dm_connector *aconnector = link->priv;
577577
578− if (!aconnector) {
579− DRM_ERROR("Failed to find connector for link!");
578+ if (!aconnector)
580579 return false;
581− }
582580
583581 return drm_dp_dpcd_write(&aconnector->dm_dp_aux.aux,
584582 address, (uint8_t *)data, size) > 0;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_mst_types.c+4−2
@@ -23,6 +23,7 @@ · 22 unmodified lines
2323 *
2424 */
2525
26+#include <linux/vmalloc.h>
2627 #include <drm/display/drm_dp_helper.h>
2728 #include <drm/display/drm_dp_mst_helper.h>
2829 #include <drm/drm_atomic.h>
@@ -1491,9 +1492,10 @@ int pre_validate_dsc(struct drm_atomic_state *state, · 1462 unmodified lines
14911492 * from dm_state->context.
14921493 */
14931494
1494− local_dc_state = kmemdup(dm_state->context, sizeof(struct dc_state), GFP_KERNEL);
1495+ local_dc_state = vmalloc(sizeof(struct dc_state));
14951496 if (!local_dc_state)
14961497 return -ENOMEM;
1498+ memcpy(local_dc_state, dm_state->context, sizeof(struct dc_state));
14971499
14981500 for (i = 0; i < local_dc_state->stream_count; i++) {
14991501 struct dc_stream_state *stream = dm_state->context->streams[i];
@@ -1563,7 +1565,7 @@ clean_exit: · 63 unmodified lines
15631565 dc_stream_release(local_dc_state->streams[i]);
15641566 }
15651567
1566− kfree(local_dc_state);
1568+ vfree(local_dc_state);
15671569
15681570 return ret;
15691571 }
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_plane.c+80−28
@@ -352,6 +352,46 @@ static int amdgpu_dm_plane_fill_gfx9_plane_attributes_from_modifiers(struct amdg · 351 unmodified lines
352352 return ret;
353353 }
354354
355+static int amdgpu_dm_plane_fill_gfx12_plane_attributes_from_modifiers(struct amdgpu_device *adev,
356+ const struct amdgpu_framebuffer *afb,
357+ const enum surface_pixel_format format,
358+ const enum dc_rotation_angle rotation,
359+ const struct plane_size *plane_size,
360+ union dc_tiling_info *tiling_info,
361+ struct dc_plane_dcc_param *dcc,
362+ struct dc_plane_address *address,
363+ const bool force_disable_dcc)
364+{
365+ const uint64_t modifier = afb->base.modifier;
366+ int ret = 0;
367+
368+ /* TODO: Most of this function shouldn't be needed on GFX12. */
369+ amdgpu_dm_plane_fill_gfx9_tiling_info_from_device(adev, tiling_info);
370+
371+ tiling_info->gfx9.swizzle = amdgpu_dm_plane_modifier_gfx9_swizzle_mode(modifier);
372+
373+ if (amdgpu_dm_plane_modifier_has_dcc(modifier) && !force_disable_dcc) {
374+ int max_compressed_block = AMD_FMT_MOD_GET(DCC_MAX_COMPRESSED_BLOCK, modifier);
375+
376+ dcc->enable = 1;
377+ dcc->independent_64b_blks = max_compressed_block == 0;
378+
379+ if (max_compressed_block == 0)
380+ dcc->dcc_ind_blk = hubp_ind_block_64b;
381+ else if (max_compressed_block == 1)
382+ dcc->dcc_ind_blk = hubp_ind_block_128b;
383+ else
384+ dcc->dcc_ind_blk = hubp_ind_block_unconstrained;
385+ }
386+
387+ /* TODO: This seems wrong because there is no DCC plane on GFX12. */
388+ ret = amdgpu_dm_plane_validate_dcc(adev, format, rotation, tiling_info, dcc, address, plane_size);
389+ if (ret)
390+ drm_dbg_kms(adev_to_drm(adev), "amdgpu_dm_plane_validate_dcc: returned error: %d\n", ret);
391+
392+ return ret;
393+}
394+
355395 static void amdgpu_dm_plane_add_gfx10_1_modifiers(const struct amdgpu_device *adev,
356396 uint64_t **mods,
357397 uint64_t *size,
@@ -648,12 +688,13 @@ static void amdgpu_dm_plane_add_gfx11_modifiers(struct amdgpu_device *adev, · 290 unmodified lines
648688 static void amdgpu_dm_plane_add_gfx12_modifiers(struct amdgpu_device *adev,
649689 uint64_t **mods, uint64_t *size, uint64_t *capacity)
650690 {
651− uint64_t mod_64K_2D = AMD_FMT_MOD |
652− AMD_FMT_MOD_SET(TILE_VERSION, AMD_FMT_MOD_TILE_VER_GFX12) |
653− AMD_FMT_MOD_SET(TILE, AMD_FMT_MOD_TILE_GFX12_64K_2D);
691+ uint64_t ver = AMD_FMT_MOD | AMD_FMT_MOD_SET(TILE_VERSION, AMD_FMT_MOD_TILE_VER_GFX12);
654692
655− /* 64K without DCC */
656− amdgpu_dm_plane_add_modifier(mods, size, capacity, mod_64K_2D);
693+ /* Without DCC: */
694+ amdgpu_dm_plane_add_modifier(mods, size, capacity, ver | AMD_FMT_MOD_SET(TILE, AMD_FMT_MOD_TILE_GFX12_256K_2D));
695+ amdgpu_dm_plane_add_modifier(mods, size, capacity, ver | AMD_FMT_MOD_SET(TILE, AMD_FMT_MOD_TILE_GFX12_64K_2D));
696+ amdgpu_dm_plane_add_modifier(mods, size, capacity, ver | AMD_FMT_MOD_SET(TILE, AMD_FMT_MOD_TILE_GFX12_4K_2D));
697+ amdgpu_dm_plane_add_modifier(mods, size, capacity, ver | AMD_FMT_MOD_SET(TILE, AMD_FMT_MOD_TILE_GFX12_256B_2D));
657698 amdgpu_dm_plane_add_modifier(mods, size, capacity, DRM_FORMAT_MOD_LINEAR);
658699 }
659700
@@ -835,7 +876,15 @@ int amdgpu_dm_plane_fill_plane_buffer_attributes(struct amdgpu_device *adev, · 175 unmodified lines
835876 upper_32_bits(chroma_addr);
836877 }
837878
838− if (adev->family >= AMDGPU_FAMILY_AI) {
879+ if (adev->family >= AMDGPU_FAMILY_GC_12_0_0) {
880+ ret = amdgpu_dm_plane_fill_gfx12_plane_attributes_from_modifiers(adev, afb, format,
881+ rotation, plane_size,
882+ tiling_info, dcc,
883+ address,
884+ force_disable_dcc);
885+ if (ret)
886+ return ret;
887+ } else if (adev->family >= AMDGPU_FAMILY_AI) {
839888 ret = amdgpu_dm_plane_fill_gfx9_plane_attributes_from_modifiers(adev, afb, format,
840889 rotation, plane_size,
841890 tiling_info, dcc,
@@ -1419,8 +1468,6 @@ static bool amdgpu_dm_plane_format_mod_supported(struct drm_plane *plane, · 577 unmodified lines
14191468 const struct drm_format_info *info = drm_format_info(format);
14201469 int i;
14211470
1422− enum dm_micro_swizzle microtile = amdgpu_dm_plane_modifier_gfx9_swizzle_mode(modifier) & 3;
1423−
14241471 if (!info)
14251472 return false;
14261473
@@ -1442,29 +1489,34 @@ static bool amdgpu_dm_plane_format_mod_supported(struct drm_plane *plane, · 15 unmodified lines
14421489 if (i == plane->modifier_count)
14431490 return false;
14441491
1445− /*
1446− * For D swizzle the canonical modifier depends on the bpp, so check
1447− * it here.
1448− */
1449− if (AMD_FMT_MOD_GET(TILE_VERSION, modifier) == AMD_FMT_MOD_TILE_VER_GFX9 &&
1450− adev->family >= AMDGPU_FAMILY_NV) {
1451− if (microtile == MICRO_SWIZZLE_D && info->cpp[0] == 4)
1452− return false;
1453− }
1454−
1455− if (adev->family >= AMDGPU_FAMILY_RV && microtile == MICRO_SWIZZLE_D &&
1456− info->cpp[0] < 8)
1457− return false;
1492+ /* GFX12 doesn't have these limitations. */
1493+ if (AMD_FMT_MOD_GET(TILE_VERSION, modifier) <= AMD_FMT_MOD_TILE_VER_GFX11) {
1494+ enum dm_micro_swizzle microtile = amdgpu_dm_plane_modifier_gfx9_swizzle_mode(modifier) & 3;
14581495
1459− if (amdgpu_dm_plane_modifier_has_dcc(modifier)) {
1460− /* Per radeonsi comments 16/64 bpp are more complicated. */
1461− if (info->cpp[0] != 4)
1462− return false;
1463− /* We support multi-planar formats, but not when combined with
1464− * additional DCC metadata planes.
1496+ /*
1497+ * For D swizzle the canonical modifier depends on the bpp, so check
1498+ * it here.
14651499 */
1466− if (info->num_planes > 1)
1500+ if (AMD_FMT_MOD_GET(TILE_VERSION, modifier) == AMD_FMT_MOD_TILE_VER_GFX9 &&
1501+ adev->family >= AMDGPU_FAMILY_NV) {
1502+ if (microtile == MICRO_SWIZZLE_D && info->cpp[0] == 4)
1503+ return false;
1504+ }
1505+
1506+ if (adev->family >= AMDGPU_FAMILY_RV && microtile == MICRO_SWIZZLE_D &&
1507+ info->cpp[0] < 8)
14671508 return false;
1509+
1510+ if (amdgpu_dm_plane_modifier_has_dcc(modifier)) {
1511+ /* Per radeonsi comments 16/64 bpp are more complicated. */
1512+ if (info->cpp[0] != 4)
1513+ return false;
1514+ /* We support multi-planar formats, but not when combined with
1515+ * additional DCC metadata planes.
1516+ */
1517+ if (info->num_planes > 1)
1518+ return false;
1519+ }
14681520 }
14691521
14701522 return true;
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_psr.c+1−1
@@ -158,7 +158,7 @@ void amdgpu_dm_psr_enable(struct dc_stream_state *stream) · 157 unmodified lines
158158 DRM_DEBUG_DRIVER("Enabling psr...\n");
159159
160160 vsync_rate_hz = div64_u64(div64_u64((
161− stream->timing.pix_clk_100hz * 100),
161+ stream->timing.pix_clk_100hz * (uint64_t)100),
162162 stream->timing.v_total),
163163 stream->timing.h_total);
164164
drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c+1−1
@@ -1853,7 +1853,7 @@ static void calculate_bandwidth( · 1852 unmodified lines
18531853 /*compute total time to request one chunk from each active display pipe*/
18541854 for (i = 0; i <= maximum_number_of_surfaces - 1; i++) {
18551855 if (data->enable[i]) {
1856− data->chunk_request_time = bw_add(data->chunk_request_time, (bw_div((bw_div(bw_int_to_fixed(pixels_per_chunk * data->bytes_per_pixel[i]), data->useful_bytes_per_request[i])), bw_min2(sclk[data->sclk_level], bw_div(data->dispclk, bw_int_to_fixed(2))))));
1856+ data->chunk_request_time = bw_add(data->chunk_request_time, (bw_div((bw_div(bw_int_to_fixed(pixels_per_chunk * (int64_t)data->bytes_per_pixel[i]), data->useful_bytes_per_request[i])), bw_min2(sclk[data->sclk_level], bw_div(data->dispclk, bw_int_to_fixed(2))))));
18571857 }
18581858 }
18591859 /*compute total time to request cursor data*/
drivers/gpu/drm/amd/display/dc/clk_mgr/dce100/dce_clk_mgr.c+1−1
@@ -131,7 +131,7 @@ int dce_get_dp_ref_freq_khz(struct clk_mgr *clk_mgr_base) · 130 unmodified lines
131131 struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base);
132132 int dprefclk_wdivider;
133133 int dprefclk_src_sel;
134− int dp_ref_clk_khz = 600000;
134+ int dp_ref_clk_khz;
135135 int target_div;
136136
137137 /* ASSERT DP Reference Clock source is from DFS*/
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn32/dcn32_clk_mgr.c+1−1
@@ -576,7 +576,7 @@ static void dcn32_auto_dpm_test_log( · 575 unmodified lines
576576 p_state_list[i] = curr_pipe_ctx->p_state_type;
577577
578578 refresh_rate = (curr_pipe_ctx->stream->timing.pix_clk_100hz * (uint64_t)100 +
579− curr_pipe_ctx->stream->timing.v_total * curr_pipe_ctx->stream->timing.h_total - (uint64_t)1);
579+ curr_pipe_ctx->stream->timing.v_total * (uint64_t)curr_pipe_ctx->stream->timing.h_total - (uint64_t)1);
580580 refresh_rate = div_u64(refresh_rate, curr_pipe_ctx->stream->timing.v_total);
581581 refresh_rate = div_u64(refresh_rate, curr_pipe_ctx->stream->timing.h_total);
582582 disp_src_refresh_list[i] = refresh_rate;
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn35/dcn35_clk_mgr.c+2−2
@@ -137,8 +137,8 @@ static void dcn35_disable_otg_wa(struct clk_mgr *clk_mgr_base, struct dc_state * · 136 unmodified lines
137137 if (pipe->stream && (pipe->stream->dpms_off || dc_is_virtual_signal(pipe->stream->signal) ||
138138 !pipe->stream->link_enc)) {
139139 if (disable) {
140− if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->immediate_disable_crtc)
141− pipe->stream_res.tg->funcs->immediate_disable_crtc(pipe->stream_res.tg);
140+ if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->disable_crtc)
141+ pipe->stream_res.tg->funcs->disable_crtc(pipe->stream_res.tg);
142142
143143 reset_sync_context_for_pipe(dc, context, i);
144144 } else {
drivers/gpu/drm/amd/display/dc/clk_mgr/dcn401/dcn401_clk_mgr.c+20−18
@@ -306,27 +306,29 @@ static void dcn401_update_clocks_update_dtb_dto(struct clk_mgr_internal *clk_mgr · 305 unmodified lines
306306 struct dc_state *context,
307307 int ref_dtbclk_khz)
308308 {
309− struct dccg *dccg = clk_mgr->dccg;
310− uint32_t tg_mask = 0;
311309 int i;
310+ struct dccg *dccg = clk_mgr->dccg;
311+ struct pipe_ctx *otg_master;
312+ bool use_hpo_encoder;
312313
313− for (i = 0; i < clk_mgr->base.ctx->dc->res_pool->pipe_count; i++) {
314− struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
315−
316− /* use mask to program DTO once per tg */
317− if (pipe_ctx->stream_res.tg &&
318− !(tg_mask & (1 << pipe_ctx->stream_res.tg->inst))) {
319− tg_mask |= (1 << pipe_ctx->stream_res.tg->inst);
320−
321− if (dccg->ctx->dc->link_srv->dp_is_128b_132b_signal(pipe_ctx)) {
322− pipe_ctx->clock_source->funcs->program_pix_clk(
323− pipe_ctx->clock_source,
324− &pipe_ctx->stream_res.pix_clk_params,
325− dccg->ctx->dc->link_srv->dp_get_encoding_format(&pipe_ctx->link_config.dp_link_settings),
326− &pipe_ctx->pll_settings);
327− }
328314
329− }
315+ for (i = 0; i < context->stream_count; i++) {
316+ otg_master = resource_get_otg_master_for_stream(
317+ &context->res_ctx, context->streams[i]);
318+ ASSERT(otg_master);
319+ ASSERT(otg_master->clock_source);
320+ ASSERT(otg_master->clock_source->funcs->program_pix_clk);
321+ ASSERT(otg_master->stream_res.pix_clk_params.controller_id >= CONTROLLER_ID_D0);
322+
323+ use_hpo_encoder = dccg->ctx->dc->link_srv->dp_is_128b_132b_signal(otg_master);
324+ if (!use_hpo_encoder)
325+ continue;
326+
327+ otg_master->clock_source->funcs->program_pix_clk(
328+ otg_master->clock_source,
329+ &otg_master->stream_res.pix_clk_params,
330+ dccg->ctx->dc->link_srv->dp_get_encoding_format(&otg_master->link_config.dp_link_settings),
331+ &otg_master->pll_settings);
330332 }
331333 }
332334
drivers/gpu/drm/amd/display/dc/core/dc_resource.c+4−4
@@ -888,21 +888,21 @@ static struct rect calculate_plane_rec_in_timing_active( · 887 unmodified lines
888888 struct rect rec_out = {0};
889889 struct fixed31_32 temp;
890890
891− temp = dc_fixpt_from_fraction(rec_in->x * stream->dst.width,
891+ temp = dc_fixpt_from_fraction(rec_in->x * (long long)stream->dst.width,
892892 stream->src.width);
893893 rec_out.x = stream->dst.x + dc_fixpt_round(temp);
894894
895895 temp = dc_fixpt_from_fraction(
896− (rec_in->x + rec_in->width) * stream->dst.width,
896+ (rec_in->x + rec_in->width) * (long long)stream->dst.width,
897897 stream->src.width);
898898 rec_out.width = stream->dst.x + dc_fixpt_round(temp) - rec_out.x;
899899
900− temp = dc_fixpt_from_fraction(rec_in->y * stream->dst.height,
900+ temp = dc_fixpt_from_fraction(rec_in->y * (long long)stream->dst.height,
901901 stream->src.height);
902902 rec_out.y = stream->dst.y + dc_fixpt_round(temp);
903903
904904 temp = dc_fixpt_from_fraction(
905− (rec_in->y + rec_in->height) * stream->dst.height,
905+ (rec_in->y + rec_in->height) * (long long)stream->dst.height,
906906 stream->src.height);
907907 rec_out.height = stream->dst.y + dc_fixpt_round(temp) - rec_out.y;
908908
drivers/gpu/drm/amd/display/dc/core/dc_stream.c+3−3
@@ -975,7 +975,7 @@ static int dc_stream_calculate_flickerless_refresh_rate(struct dc_stream_state * · 974 unmodified lines
975975 }
976976
977977 if (search_for_max_increase)
978− return (int)div64_s64((long long)stream->timing.pix_clk_100hz*100, stream->timing.v_total*stream->timing.h_total);
978+ return (int)div64_s64((long long)stream->timing.pix_clk_100hz*100, stream->timing.v_total*(long long)stream->timing.h_total);
979979 else
980980 return stream->lumin_data.refresh_rate_hz[0];
981981 }
@@ -1024,7 +1024,7 @@ static unsigned int dc_stream_get_max_flickerless_instant_vtotal_delta(struct dc · 42 unmodified lines
10241024 if (stream->timing.v_total * stream->timing.h_total == 0)
10251025 return 0;
10261026
1027− int current_refresh_hz = (int)div64_s64((long long)stream->timing.pix_clk_100hz*100, stream->timing.v_total*stream->timing.h_total);
1027+ int current_refresh_hz = (int)div64_s64((long long)stream->timing.pix_clk_100hz*100, stream->timing.v_total*(long long)stream->timing.h_total);
10281028
10291029 int safe_refresh_hz = dc_stream_calculate_flickerless_refresh_rate(stream,
10301030 dc_stream_get_brightness_millinits_from_refresh(stream, current_refresh_hz),
@@ -1032,7 +1032,7 @@ static unsigned int dc_stream_get_max_flickerless_instant_vtotal_delta(struct dc · 1 unmodified line
10321032 is_gaming,
10331033 increase);
10341034
1035− int safe_refresh_v_total = (int)div64_s64((long long)stream->timing.pix_clk_100hz*100, safe_refresh_hz*stream->timing.h_total);
1035+ int safe_refresh_v_total = (int)div64_s64((long long)stream->timing.pix_clk_100hz*100, safe_refresh_hz*(long long)stream->timing.h_total);
10361036
10371037 if (increase)
10381038 return (((int) stream->timing.v_total - safe_refresh_v_total) >= 0) ? (stream->timing.v_total - safe_refresh_v_total) : 0;
drivers/gpu/drm/amd/display/dc/dc.h+3−1
@@ -55,7 +55,7 @@ struct aux_payload; · 54 unmodified lines
5555 struct set_config_cmd_payload;
5656 struct dmub_notification;
5757
58−#define DC_VER "3.2.290"
58+#define DC_VER "3.2.291"
5959
6060 #define MAX_SURFACES 3
6161 #define MAX_PLANES 6
@@ -293,6 +293,8 @@ struct dc_caps { · 231 unmodified lines
293293 bool cursor_not_scaled;
294294 bool dcmode_power_limits_present;
295295 bool sequential_ono;
296+ /* Conservative limit for DCC cases which require ODM4:1 to support*/
297+ uint32_t dcc_plane_width_limit;
296298 };
297299
298300 struct dc_bug_wa {
drivers/gpu/drm/amd/display/dc/dce/dce_audio.c+3−2
@@ -353,7 +353,7 @@ static uint32_t calculate_required_audio_bw_in_symbols( · 352 unmodified lines
353353 /* DP spec recommends between 1.05 to 1.1 safety margin to prevent sample under-run */
354354 struct fixed31_32 audio_sdp_margin = dc_fixpt_from_fraction(110, 100);
355355 struct fixed31_32 horizontal_line_freq_khz = dc_fixpt_from_fraction(
356− crtc_info->requested_pixel_clock_100Hz, crtc_info->h_total * 10);
356+ crtc_info->requested_pixel_clock_100Hz, (long long)crtc_info->h_total * 10);
357357 struct fixed31_32 samples_per_line;
358358 struct fixed31_32 layouts_per_line;
359359 struct fixed31_32 symbols_per_sdp_max_layout;
@@ -455,7 +455,8 @@ static uint32_t calculate_available_hblank_bw_in_symbols( · 95 unmodified lines
455455 available_hblank_bw -= crtc_info->dsc_num_slices * 4; /* EOC overhead */
456456
457457 if (available_hblank_bw < dp_link_info->hblank_min_symbol_width)
458− available_hblank_bw = dp_link_info->hblank_min_symbol_width;
458+ /* Each symbol takes 4 frames */
459+ available_hblank_bw = 4 * dp_link_info->hblank_min_symbol_width;
459460
460461 if (available_hblank_bw < 12)
461462 available_hblank_bw = 0;
drivers/gpu/drm/amd/display/dc/dce/dce_clock_source.c+4−4
@@ -217,7 +217,7 @@ static bool calc_fb_divider_checking_tolerance( · 216 unmodified lines
217217 actual_calc_clk_100hz = (uint64_t)feedback_divider *
218218 calc_pll_cs->fract_fb_divider_factor +
219219 fract_feedback_divider;
220− actual_calc_clk_100hz *= calc_pll_cs->ref_freq_khz * 10;
220+ actual_calc_clk_100hz *= (uint64_t)calc_pll_cs->ref_freq_khz * 10;
221221 actual_calc_clk_100hz =
222222 div_u64(actual_calc_clk_100hz,
223223 ref_divider * post_divider *
@@ -680,7 +680,7 @@ static bool calculate_ss( · 456 unmodified lines
680680 * so have to divided by 100 * 100*/
681681 ss_amount = dc_fixpt_mul(
682682 fb_div, dc_fixpt_from_fraction(ss_data->percentage,
683− 100 * ss_data->percentage_divider));
683+ 100 * (long long)ss_data->percentage_divider));
684684 ds_data->feedback_amount = dc_fixpt_floor(ss_amount);
685685
686686 ss_nslip_amount = dc_fixpt_sub(ss_amount,
@@ -695,8 +695,8 @@ static bool calculate_ss( · 8 unmodified lines
695695
696696 /* compute SS_STEP_SIZE_DSFRAC */
697697 modulation_time = dc_fixpt_from_fraction(
698− pll_settings->reference_freq * 1000,
699− pll_settings->reference_divider * ss_data->modulation_freq_hz);
698+ pll_settings->reference_freq * (uint64_t)1000,
699+ pll_settings->reference_divider * (uint64_t)ss_data->modulation_freq_hz);
700700
701701 if (ss_data->flags.CENTER_SPREAD)
702702 modulation_time = dc_fixpt_div_int(modulation_time, 4);
drivers/gpu/drm/amd/display/dc/dce/dce_panel_cntl.c+1−1
@@ -218,7 +218,7 @@ static void dce_driver_set_backlight(struct panel_cntl *panel_cntl, · 217 unmodified lines
218218 * contain integer component, lower 16 bits contain fractional component
219219 * of active duty cycle e.g. 0x21BDC0 = 0xEFF0 * 0x24
220220 */
221− active_duty_cycle = backlight_pwm_u16_16 * masked_pwm_period;
221+ active_duty_cycle = backlight_pwm_u16_16 * (uint64_t)masked_pwm_period;
222222
223223 /* 1.3 Calculate 16 bit active duty cycle from integer and fractional
224224 * components shift by bitCount then mask 16 bits and add rounding bit
drivers/gpu/drm/amd/display/dc/dcn10/Makefile+0−1
@@ -27,7 +27,6 @@ DCN10 = dcn10_ipp.o \ · 26 unmodified lines
2727 dcn10_opp.o \
2828 dcn10_mpc.o \
2929 dcn10_cm_common.o \
30− dcn10_stream_encoder.o dcn10_link_encoder.o
3130
3231 AMD_DAL_DCN10 = $(addprefix $(AMDDALPATH)/dc/dcn10/,$(DCN10))
3332
drivers/gpu/drm/amd/display/dc/dcn20/Makefile+0−1
@@ -2,7 +2,6 @@ · 1 unmodified line
22 # Copyright © 2019-2024 Advanced Micro Devices, Inc. All rights reserved.
33
44 DCN20 = dcn20_mpc.o dcn20_opp.o dcn20_mmhubbub.o \
5− dcn20_stream_encoder.o dcn20_link_encoder.o \
65 dcn20_vmid.o dcn20_dwb.o dcn20_dwb_scl.o
76
87 AMD_DAL_DCN20 = $(addprefix $(AMDDALPATH)/dc/dcn20/,$(DCN20))
drivers/gpu/drm/amd/display/dc/dcn30/Makefile+0−2
@@ -25,12 +25,10 @@ · 24 unmodified lines
2525
2626 DCN30 := dcn30_mpc.o dcn30_vpg.o \
2727 dcn30_afmt.o \
28− dcn30_dio_stream_encoder.o \
2928 dcn30_dwb.o \
3029 dcn30_dwb_cm.o \
3130 dcn30_cm_common.o \
3231 dcn30_mmhubbub.o \
33− dcn30_dio_link_encoder.o
3432
3533
3634
drivers/gpu/drm/amd/display/dc/dcn31/Makefile+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
44 #
55 # Makefile for dcn31.
66
7−DCN31 = dcn31_dio_link_encoder.o dcn31_panel_cntl.o \
7+DCN31 = dcn31_panel_cntl.o \
88 dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \
99 dcn31_afmt.o dcn31_vpg.o
1010
drivers/gpu/drm/amd/display/dc/dio/Makefile+36−0
@@ -24,6 +24,42 @@ · 23 unmodified lines
2424 #
2525
2626 ifdef CONFIG_DRM_AMD_DC_FP
27+###############################################################################
28+# DCN10
29+###############################################################################
30+DIO_DCN10 = dcn10_link_encoder.o dcn10_stream_encoder.o
31+
32+AMD_DAL_DIO_DCN10 = $(addprefix $(AMDDALPATH)/dc/dio/dcn10/,$(DIO_DCN10))
33+
34+AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN10)
35+
36+###############################################################################
37+# DCN20
38+###############################################################################
39+DIO_DCN20 = dcn20_link_encoder.o dcn20_stream_encoder.o
40+
41+AMD_DAL_DIO_DCN20 = $(addprefix $(AMDDALPATH)/dc/dio/dcn20/,$(DIO_DCN20))
42+
43+AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN20)
44+
45+###############################################################################
46+# DCN30
47+###############################################################################
48+DIO_DCN30 = dcn30_dio_link_encoder.o dcn30_dio_stream_encoder.o
49+
50+AMD_DAL_DIO_DCN30 = $(addprefix $(AMDDALPATH)/dc/dio/dcn30/,$(DIO_DCN30))
51+
52+AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN30)
53+
54+###############################################################################
55+# DCN31
56+###############################################################################
57+DIO_DCN31 = dcn31_dio_link_encoder.o
58+
59+AMD_DAL_DIO_DCN31 = $(addprefix $(AMDDALPATH)/dc/dio/dcn31/,$(DIO_DCN31))
60+
61+AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN31)
62+
2763 ###############################################################################
2864 # DCN32
2965 ###############################################################################
drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_link_encoder.crenamed from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.c+0−0

File renamed without changes.

drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_link_encoder.hrenamed from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_link_encoder.h+0−0

File renamed without changes.

drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.crenamed from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.c+0−0

File renamed without changes.

drivers/gpu/drm/amd/display/dc/dio/dcn10/dcn10_stream_encoder.hrenamed from drivers/gpu/drm/amd/display/dc/dcn10/dcn10_stream_encoder.h+0−0

File renamed without changes.

drivers/gpu/drm/amd/display/dc/dio/dcn20/dcn20_link_encoder.crenamed from drivers/gpu/drm/amd/display/dc/dcn20/dcn20_link_encoder.c+0−0

File renamed without changes.

drivers/gpu/drm/amd/display/dc/dio/dcn20/dcn20_link_encoder.hrenamed from drivers/gpu/drm/amd/display/dc/dcn20/dcn20_link_encoder.h+0−0

File renamed without changes.

drivers/gpu/drm/amd/display/dc/dio/dcn20/dcn20_stream_encoder.crenamed from drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.c+0−0

File renamed without changes.

drivers/gpu/drm/amd/display/dc/dio/dcn20/dcn20_stream_encoder.hrenamed from drivers/gpu/drm/amd/display/dc/dcn20/dcn20_stream_encoder.h+0−0

File renamed without changes.

drivers/gpu/drm/amd/display/dc/dio/dcn30/dcn30_dio_link_encoder.crenamed from drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_link_encoder.c+0−0

File renamed without changes.

drivers/gpu/drm/amd/display/dc/dio/dcn30/dcn30_dio_link_encoder.hrenamed from drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_link_encoder.h+0−0

File renamed without changes.

drivers/gpu/drm/amd/display/dc/dio/dcn30/dcn30_dio_stream_encoder.crenamed from drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.c+0−0

File renamed without changes.

drivers/gpu/drm/amd/display/dc/dio/dcn30/dcn30_dio_stream_encoder.hrenamed from drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dio_stream_encoder.h+0−0

File renamed without changes.

drivers/gpu/drm/amd/display/dc/dio/dcn31/dcn31_dio_link_encoder.crenamed from drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dio_link_encoder.c+0−0

File renamed without changes.

drivers/gpu/drm/amd/display/dc/dio/dcn31/dcn31_dio_link_encoder.hrenamed from drivers/gpu/drm/amd/display/dc/dcn31/dcn31_dio_link_encoder.h+0−0

File renamed without changes.

drivers/gpu/drm/amd/display/dc/dml/dcn32/dcn32_fpu.c+1−1
@@ -997,7 +997,7 @@ static bool subvp_subvp_admissable(struct dc *dc, · 996 unmodified lines
997997 if (pipe->plane_state && !pipe->top_pipe &&
998998 dc_state_get_pipe_subvp_type(context, pipe) == SUBVP_MAIN) {
999999 refresh_rate = (pipe->stream->timing.pix_clk_100hz * (uint64_t)100 +
1000− pipe->stream->timing.v_total * pipe->stream->timing.h_total - (uint64_t)1);
1000+ pipe->stream->timing.v_total * (uint64_t)pipe->stream->timing.h_total - (uint64_t)1);
10011001 refresh_rate = div_u64(refresh_rate, pipe->stream->timing.v_total);
10021002 refresh_rate = div_u64(refresh_rate, pipe->stream->timing.h_total);
10031003
drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_32.c+3−0
@@ -3364,6 +3364,9 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 3363 unmodified lines
33643364 &mode_lib->vba.UrgentBurstFactorLumaPre[k],
33653365 &mode_lib->vba.UrgentBurstFactorChromaPre[k],
33663366 &mode_lib->vba.NotUrgentLatencyHidingPre[k]);
3367+
3368+ v->cursor_bw_pre[k] = mode_lib->vba.NumberOfCursors[k] * mode_lib->vba.CursorWidth[k][0] * mode_lib->vba.CursorBPP[k][0] /
3369+ 8.0 / (mode_lib->vba.HTotal[k] / mode_lib->vba.PixelClock[k]) * v->VRatioPreY[i][j][k];
33673370 }
33683371
33693372 {
drivers/gpu/drm/amd/display/dc/dml2/dml21/dml21_wrapper.c+12−10
@@ -197,9 +197,14 @@ static bool dml21_mode_check_and_programming(const struct dc *in_dc, struct dc_s · 196 unmodified lines
197197 memset(&dml_ctx->v21.dml_to_dc_pipe_mapping, 0, sizeof(struct dml2_dml_to_dc_pipe_mapping));
198198 memset(&dml_ctx->v21.mode_programming.dml2_instance->scratch.build_mode_programming_locals.mode_programming_params, 0, sizeof(struct dml2_core_mode_programming_in_out));
199199
200− if (!context || context->stream_count == 0)
200+ if (!context)
201201 return true;
202202
203+ if (context->stream_count == 0) {
204+ dml21_build_fams2_programming(in_dc, context, dml_ctx);
205+ return true;
206+ }
207+
203208 /* scrub phantom's from current dc_state */
204209 dml_ctx->config.svp_pstate.callbacks.remove_phantom_streams_and_planes(in_dc, context);
205210 dml_ctx->config.svp_pstate.callbacks.release_phantom_streams_and_planes(in_dc, context);
@@ -280,7 +285,8 @@ bool dml21_validate(const struct dc *in_dc, struct dc_state *context, struct dml · 74 unmodified lines
280285
281286 void dml21_prepare_mcache_programming(struct dc *in_dc, struct dc_state *context, struct dml2_context *dml_ctx)
282287 {
283− unsigned int num_pipes, dml_prog_idx, dml_phantom_prog_idx, dc_pipe_index;
288+ unsigned int dml_prog_idx, dml_phantom_prog_idx, dc_pipe_index;
289+ int num_pipes;
284290 struct pipe_ctx *dc_main_pipes[__DML2_WRAPPER_MAX_STREAMS_PLANES__];
285291 struct pipe_ctx *dc_phantom_pipes[__DML2_WRAPPER_MAX_STREAMS_PLANES__] = {0};
286292
@@ -314,10 +320,8 @@ void dml21_prepare_mcache_programming(struct dc *in_dc, struct dc_state *context · 27 unmodified lines
314320 }
315321
316322 num_pipes = dml21_find_dc_pipes_for_plane(in_dc, context, dml_ctx, dc_main_pipes, dc_phantom_pipes, dml_prog_idx);
317−
318− if (num_pipes <= 0 ||
319− dc_main_pipes[0]->stream == NULL ||
320− dc_main_pipes[0]->plane_state == NULL)
323+ if (num_pipes <= 0 || dc_main_pipes[0]->stream == NULL ||
324+ dc_main_pipes[0]->plane_state == NULL)
321325 continue;
322326
323327 /* get config for each pipe */
@@ -356,10 +360,8 @@ void dml21_prepare_mcache_programming(struct dc *in_dc, struct dc_state *context · 32 unmodified lines
356360 pln_prog = &dml_ctx->v21.mode_programming.programming->plane_programming[dml_prog_idx];
357361
358362 num_pipes = dml21_find_dc_pipes_for_plane(in_dc, context, dml_ctx, dc_main_pipes, dc_phantom_pipes, dml_prog_idx);
359−
360− if (num_pipes <= 0 ||
361− dc_main_pipes[0]->stream == NULL ||
362− dc_main_pipes[0]->plane_state == NULL)
363+ if (num_pipes <= 0 || dc_main_pipes[0]->stream == NULL ||
364+ dc_main_pipes[0]->plane_state == NULL)
363365 continue;
364366
365367 /* get config for each pipe */
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_core/dml2_core_factory.c+1−1
@@ -11,7 +11,7 @@ bool dml2_core_create(enum dml2_project_id project_id, struct dml2_core_instance · 10 unmodified lines
1111 {
1212 bool result = false;
1313
14− if (out == 0)
14+ if (!out)
1515 return false;
1616
1717 memset(out, 0, sizeof(struct dml2_core_instance));
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_dpmm/dml2_dpmm_factory.c+1−1
@@ -21,7 +21,7 @@ bool dml2_dpmm_create(enum dml2_project_id project_id, struct dml2_dpmm_instance · 20 unmodified lines
2121 {
2222 bool result = false;
2323
24− if (out == 0)
24+ if (!out)
2525 return false;
2626
2727 memset(out, 0, sizeof(struct dml2_dpmm_instance));
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_mcg/dml2_mcg_factory.c+1−1
@@ -16,7 +16,7 @@ bool dml2_mcg_create(enum dml2_project_id project_id, struct dml2_mcg_instance * · 15 unmodified lines
1616 {
1717 bool result = false;
1818
19− if (out == 0)
19+ if (!out)
2020 return false;
2121
2222 memset(out, 0, sizeof(struct dml2_mcg_instance));
drivers/gpu/drm/amd/display/dc/dml2/dml21/src/dml2_pmo/dml2_pmo_factory.c+1−1
@@ -28,7 +28,7 @@ bool dml2_pmo_create(enum dml2_project_id project_id, struct dml2_pmo_instance * · 27 unmodified lines
2828 {
2929 bool result = false;
3030
31− if (out == 0)
31+ if (!out)
3232 return false;
3333
3434 memset(out, 0, sizeof(struct dml2_pmo_instance));
drivers/gpu/drm/amd/display/dc/dml2/dml2_translation_helper.c+1−0
@@ -296,6 +296,7 @@ void dml2_init_socbb_params(struct dml2_context *dml2, const struct dc *in_dc, s · 295 unmodified lines
296296 out->round_trip_ping_latency_dcfclk_cycles = 106;
297297 out->smn_latency_us = 2;
298298 out->dispclk_dppclk_vco_speed_mhz = 3600;
299+ out->pct_ideal_dram_bw_after_urgent_pixel_only = 65.0;
299300 break;
300301
301302 case dml_project_dcn401:
drivers/gpu/drm/amd/display/dc/dml2/dml2_utils.c+3−11
@@ -288,13 +288,12 @@ void dml2_calculate_rq_and_dlg_params(const struct dc *dc, struct dc_state *cont · 287 unmodified lines
288288 {
289289 unsigned int dc_pipe_ctx_index, dml_pipe_idx, plane_id;
290290 enum mall_stream_type pipe_mall_type;
291− bool unbounded_req_enabled = false;
292291 struct dml2_calculate_rq_and_dlg_params_scratch *s = &in_ctx->v20.scratch.calculate_rq_and_dlg_params_scratch;
293292
294293 context->bw_ctx.bw.dcn.clk.dcfclk_deep_sleep_khz = (unsigned int)in_ctx->v20.dml_core_ctx.mp.DCFCLKDeepSleep * 1000;
295294 context->bw_ctx.bw.dcn.clk.dppclk_khz = 0;
296295
297− if (in_ctx->v20.dml_core_ctx.ms.support.FCLKChangeSupport[in_ctx->v20.scratch.mode_support_params.out_lowest_state_idx] == dml_fclock_change_unsupported)
296+ if (in_ctx->v20.dml_core_ctx.ms.support.FCLKChangeSupport[0] == dml_fclock_change_unsupported)
298297 context->bw_ctx.bw.dcn.clk.fclk_p_state_change_support = false;
299298 else
300299 context->bw_ctx.bw.dcn.clk.fclk_p_state_change_support = true;
@@ -302,14 +301,6 @@ void dml2_calculate_rq_and_dlg_params(const struct dc *dc, struct dc_state *cont · 1 unmodified line
302301 if (context->bw_ctx.bw.dcn.clk.dispclk_khz < dc->debug.min_disp_clk_khz)
303302 context->bw_ctx.bw.dcn.clk.dispclk_khz = dc->debug.min_disp_clk_khz;
304303
305− unbounded_req_enabled = in_ctx->v20.dml_core_ctx.ms.UnboundedRequestEnabledThisState;
306−
307− if (unbounded_req_enabled && pipe_cnt > 1) {
308− // Unbounded requesting should not ever be used when more than 1 pipe is enabled.
309− //ASSERT(false);
310− unbounded_req_enabled = false;
311− }
312−
313304 context->bw_ctx.bw.dcn.compbuf_size_kb = in_ctx->v20.dml_core_ctx.ip.config_return_buffer_size_in_kbytes;
314305
315306 for (dc_pipe_ctx_index = 0; dc_pipe_ctx_index < pipe_cnt; dc_pipe_ctx_index++) {
@@ -344,7 +335,8 @@ void dml2_calculate_rq_and_dlg_params(const struct dc *dc, struct dc_state *cont · 28 unmodified lines
344335 context->res_ctx.pipe_ctx[dc_pipe_ctx_index].unbounded_req = false;
345336 } else {
346337 context->res_ctx.pipe_ctx[dc_pipe_ctx_index].det_buffer_size_kb = dml_get_det_buffer_size_kbytes(&context->bw_ctx.dml2->v20.dml_core_ctx, dml_pipe_idx);
347− context->res_ctx.pipe_ctx[dc_pipe_ctx_index].unbounded_req = unbounded_req_enabled;
338+ // Unbounded requesting should not ever be used when more than 1 pipe is enabled.
339+ context->res_ctx.pipe_ctx[dc_pipe_ctx_index].unbounded_req = in_ctx->v20.dml_core_ctx.ms.UnboundedRequestEnabledThisState;
348340 }
349341
350342 context->bw_ctx.bw.dcn.compbuf_size_kb -= context->res_ctx.pipe_ctx[dc_pipe_ctx_index].det_buffer_size_kb;
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.c+0−15
@@ -626,21 +626,6 @@ static bool dml2_validate_and_build_resource(const struct dc *in_dc, struct dc_s · 625 unmodified lines
626626
627627 if (result) {
628628 unsigned int lowest_state_idx = s->mode_support_params.out_lowest_state_idx;
629− double min_fclk_mhz_for_urgent_workaround = (double)dml2->config.min_fclk_for_urgent_workaround_khz / 1000.0;
630− double max_frac_urgent = (double)dml2->config.max_frac_urgent_for_min_fclk_x1000 / 1000.0;
631−
632− if (min_fclk_mhz_for_urgent_workaround > 0.0 && max_frac_urgent > 0.0 &&
633− (dml2->v20.dml_core_ctx.mp.FractionOfUrgentBandwidth > max_frac_urgent ||
634− dml2->v20.dml_core_ctx.mp.FractionOfUrgentBandwidthImmediateFlip > max_frac_urgent)) {
635− unsigned int forced_lowest_state_idx = lowest_state_idx;
636−
637− while (forced_lowest_state_idx < dml2->v20.dml_core_ctx.states.num_states &&
638− dml2->v20.dml_core_ctx.states.state_array[forced_lowest_state_idx].fabricclk_mhz <= min_fclk_mhz_for_urgent_workaround) {
639− forced_lowest_state_idx += 1;
640− }
641− lowest_state_idx = forced_lowest_state_idx;
642− }
643−
644629 out_clks.dispclk_khz = (unsigned int)dml2->v20.dml_core_ctx.mp.Dispclk_calculated * 1000;
645630 out_clks.p_state_supported = s->mode_support_info.DRAMClockChangeSupport[0] != dml_dram_clock_change_unsupported;
646631 if (in_dc->config.use_default_clock_table &&
drivers/gpu/drm/amd/display/dc/dml2/dml2_wrapper.h+0−2
@@ -237,8 +237,6 @@ struct dml2_configuration_options { · 236 unmodified lines
237237 bool use_clock_dc_limits;
238238 bool gpuvm_enable;
239239 struct dml2_soc_bb *bb_from_dmub;
240− int max_frac_urgent_for_min_fclk_x1000;
241− int min_fclk_for_urgent_workaround_khz;
242240 };
243241
244242 /*
drivers/gpu/drm/amd/display/dc/hubbub/dcn401/dcn401_hubbub.c+6−0
@@ -829,6 +829,7 @@ bool hubbub401_get_dcc_compression_cap(struct hubbub *hubbub, · 828 unmodified lines
829829 struct dc_surface_dcc_cap *output)
830830 {
831831 struct dc *dc = hubbub->ctx->dc;
832+ const unsigned int max_dcc_plane_width = dc->caps.dcc_plane_width_limit;
832833 /* DCN4_Programming_Guide_DCHUB.docx, Section 5.11.2.2 */
833834 enum dcc_control dcc_control;
834835 unsigned int plane0_bpe, plane1_bpe;
@@ -843,6 +844,11 @@ bool hubbub401_get_dcc_compression_cap(struct hubbub *hubbub, · 8 unmodified lines
843844 if (dc->debug.disable_dcc == DCC_DISABLE)
844845 return false;
845846
847+ /* Conservatively disable DCC for cases where ODM4:1 may be required. */
848+ if (max_dcc_plane_width != 0 &&
849+ (input->surface_size.width > max_dcc_plane_width || input->plane1_size.width > max_dcc_plane_width))
850+ return false;
851+
846852 switch (input->format) {
847853 default:
848854 is_dual_plane = false;
drivers/gpu/drm/amd/display/dc/hubp/dcn401/dcn401_hubp.c+13−2
@@ -677,12 +677,23 @@ void hubp401_cursor_set_position( · 676 unmodified lines
677677 int rec_x_offset = x_pos - pos->x_hotspot;
678678 int rec_y_offset = y_pos - pos->y_hotspot;
679679 int dst_x_offset;
680− int x_pos_viewport = x_pos * param->viewport.width / param->recout.width;
681− int x_hot_viewport = pos->x_hotspot * param->viewport.width / param->recout.width;
680+ int x_pos_viewport = 0;
681+ int x_hot_viewport = 0;
682682 uint32_t cur_en = pos->enable ? 1 : 0;
683683
684684 hubp->curs_pos = *pos;
685685
686+ /* Recout is zero for pipes if the entire dst_rect is contained
687+ * within preceeding ODM slices.
688+ */
689+ if (param->recout.width) {
690+ x_pos_viewport = x_pos * param->viewport.width / param->recout.width;
691+ x_hot_viewport = pos->x_hotspot * param->viewport.width / param->recout.width;
692+ } else {
693+ ASSERT(!cur_en || x_pos == 0);
694+ ASSERT(!cur_en || pos->x_hotspot == 0);
695+ }
696+
686697 /*
687698 * Guard aganst cursor_set_position() from being called with invalid
688699 * attributes
drivers/gpu/drm/amd/display/dc/hwss/dce110/dce110_hwseq.c+57−5
@@ -1305,13 +1305,65 @@ static void populate_audio_dp_link_info( · 1304 unmodified lines
13051305
13061306 dp_link_info->link_bandwidth_kbps = dc_fixpt_floor(link_bw_kbps);
13071307
1308− /* HW minimum for 128b/132b HBlank is 4 frame symbols.
1309− * TODO: Plumb the actual programmed HBlank min symbol width to here.
1308+ /* Calculates hblank_min_symbol_width for 128b/132b
1309+ * Corresponding HBLANK_MIN_SYMBOL_WIDTH register is calculated as:
1310+ * floor(h_blank * bits_per_pixel / 128)
13101311 */
1311− if (dp_link_info->encoding == DP_128b_132b_ENCODING)
1312− dp_link_info->hblank_min_symbol_width = 4;
1313− else
1312+ if (dp_link_info->encoding == DP_128b_132b_ENCODING) {
1313+ struct dc_crtc_timing *crtc_timing = &pipe_ctx->stream->timing;
1314+
1315+ uint32_t h_active = crtc_timing->h_addressable + crtc_timing->h_border_left
1316+ + crtc_timing->h_border_right;
1317+ uint32_t h_blank = crtc_timing->h_total - h_active;
1318+
1319+ uint32_t bpp;
1320+
1321+ if (crtc_timing->flags.DSC) {
1322+ bpp = crtc_timing->dsc_cfg.bits_per_pixel;
1323+ } else {
1324+ /* When the timing is using DSC, dsc_cfg.bits_per_pixel is in 16th bits.
1325+ * The bpp in this path is scaled to 16th bits so the final calculation
1326+ * is correct for both cases.
1327+ */
1328+ bpp = 16;
1329+ switch (crtc_timing->display_color_depth) {
1330+ case COLOR_DEPTH_666:
1331+ bpp *= 18;
1332+ break;
1333+ case COLOR_DEPTH_888:
1334+ bpp *= 24;
1335+ break;
1336+ case COLOR_DEPTH_101010:
1337+ bpp *= 30;
1338+ break;
1339+ case COLOR_DEPTH_121212:
1340+ bpp *= 36;
1341+ break;
1342+ default:
1343+ bpp = 0;
1344+ break;
1345+ }
1346+
1347+ switch (crtc_timing->pixel_encoding) {
1348+ case PIXEL_ENCODING_YCBCR422:
1349+ bpp = bpp * 2 / 3;
1350+ break;
1351+ case PIXEL_ENCODING_YCBCR420:
1352+ bpp /= 2;
1353+ break;
1354+ default:
1355+ break;
1356+ }
1357+ }
1358+
1359+ /* Min symbol width = floor(h_blank * (bpp/16) / 128) */
1360+ dp_link_info->hblank_min_symbol_width = dc_fixpt_floor(
1361+ dc_fixpt_div(dc_fixpt_from_int(h_blank * bpp),
1362+ dc_fixpt_from_int(128 / 16)));
1363+
1364+ } else {
13141365 dp_link_info->hblank_min_symbol_width = 0;
1366+ }
13151367 }
13161368
13171369 static void build_audio_output(
drivers/gpu/drm/amd/display/dc/hwss/dcn10/dcn10_hwseq.c+1−1
@@ -2208,7 +2208,7 @@ static int dcn10_align_pixel_clocks(struct dc *dc, int group_size, · 2207 unmodified lines
22082208 grouped_pipes[i]->stream->signal)) {
22092209 embedded = i;
22102210 master = i;
2211− phase[i] = embedded_pix_clk_100hz*100;
2211+ phase[i] = embedded_pix_clk_100hz*(uint64_t)100;
22122212 modulo[i] = dp_ref_clk_100hz*100;
22132213 } else {
22142214
drivers/gpu/drm/amd/display/dc/hwss/dcn21/dcn21_hwseq.c+6−0
@@ -183,6 +183,12 @@ void dcn21_set_abm_immediate_disable(struct pipe_ctx *pipe_ctx) · 182 unmodified lines
183183 struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl;
184184 struct dmcu *dmcu = pipe_ctx->stream->ctx->dc->res_pool->dmcu;
185185
186+ // make a short term w/a for an issue that backlight ramping unexpectedly paused in the middle,
187+ // will decouple backlight from ABM and redefine DMUB interface, then this w/a could be removed
188+ if (pipe_ctx->stream->abm_level == 0 || pipe_ctx->stream->abm_level == ABM_LEVEL_IMMEDIATE_DISABLE) {
189+ return;
190+ }
191+
186192 if (dmcu) {
187193 dce110_set_abm_immediate_disable(pipe_ctx);
188194 return;
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.c+38−9
@@ -1088,6 +1088,17 @@ static bool dcn401_can_pipe_disable_cursor(struct pipe_ctx *pipe_ctx) · 1087 unmodified lines
10881088 return false;
10891089 }
10901090
1091+void adjust_hotspot_between_slices_for_2x_magnify(uint32_t cursor_width, struct dc_cursor_position *pos_cpy)
1092+{
1093+ if (cursor_width <= 128) {
1094+ pos_cpy->x_hotspot /= 2;
1095+ pos_cpy->x_hotspot += 1;
1096+ } else {
1097+ pos_cpy->x_hotspot /= 2;
1098+ pos_cpy->x_hotspot += 2;
1099+ }
1100+}
1101+
10911102 void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx)
10921103 {
10931104 struct dc_cursor_position pos_cpy = pipe_ctx->stream->cursor_position;
@@ -1109,12 +1120,21 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx) · 15 unmodified lines
11091120 int prev_odm_width = 0;
11101121 int prev_odm_offset = 0;
11111122 struct pipe_ctx *prev_odm_pipe = NULL;
1123+ bool mpc_combine_on = false;
1124+ int bottom_pipe_x_pos = 0;
11121125
11131126 int x_pos = pos_cpy.x;
11141127 int y_pos = pos_cpy.y;
11151128 int recout_x_pos = 0;
11161129 int recout_y_pos = 0;
11171130
1131+ if ((pipe_ctx->top_pipe != NULL) || (pipe_ctx->bottom_pipe != NULL)) {
1132+ if ((pipe_ctx->plane_state->src_rect.width != pipe_ctx->plane_res.scl_data.viewport.width) ||
1133+ (pipe_ctx->plane_state->src_rect.height != pipe_ctx->plane_res.scl_data.viewport.height)) {
1134+ mpc_combine_on = true;
1135+ }
1136+ }
1137+
11181138 /* DCN4 moved cursor composition after Scaler, so in HW it is in
11191139 * recout space and for HW Cursor position programming need to
11201140 * translate to recout space.
@@ -1177,15 +1197,8 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx) · 56 unmodified lines
11771197
11781198 if (x_pos < 0) {
11791199 pos_cpy.x_hotspot -= x_pos;
1180− if ((odm_combine_on) && (hubp->curs_attr.attribute_flags.bits.ENABLE_MAGNIFICATION)) {
1181− if (hubp->curs_attr.width <= 128) {
1182− pos_cpy.x_hotspot /= 2;
1183− pos_cpy.x_hotspot += 1;
1184− } else {
1185− pos_cpy.x_hotspot /= 2;
1186− pos_cpy.x_hotspot += 2;
1187− }
1188− }
1200+ if (hubp->curs_attr.attribute_flags.bits.ENABLE_MAGNIFICATION)
1201+ adjust_hotspot_between_slices_for_2x_magnify(hubp->curs_attr.width, &pos_cpy);
11891202 x_pos = 0;
11901203 }
11911204
@@ -1194,6 +1207,22 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx) · 2 unmodified lines
11941207 y_pos = 0;
11951208 }
11961209
1210+ /* If the position on bottom MPC pipe is negative then we need to add to the hotspot and
1211+ * adjust x_pos on bottom pipe to make cursor visible when crossing between MPC slices.
1212+ */
1213+ if (mpc_combine_on &&
1214+ pipe_ctx->top_pipe &&
1215+ (pipe_ctx == pipe_ctx->top_pipe->bottom_pipe)) {
1216+
1217+ bottom_pipe_x_pos = x_pos - pipe_ctx->plane_res.scl_data.recout.x;
1218+ if (bottom_pipe_x_pos < 0) {
1219+ x_pos = pipe_ctx->plane_res.scl_data.recout.x;
1220+ pos_cpy.x_hotspot -= bottom_pipe_x_pos;
1221+ if (hubp->curs_attr.attribute_flags.bits.ENABLE_MAGNIFICATION)
1222+ adjust_hotspot_between_slices_for_2x_magnify(hubp->curs_attr.width, &pos_cpy);
1223+ }
1224+ }
1225+
11971226 pos_cpy.x = (uint32_t)x_pos;
11981227 pos_cpy.y = (uint32_t)y_pos;
11991228
drivers/gpu/drm/amd/display/dc/hwss/dcn401/dcn401_hwseq.h+1−0
@@ -80,4 +80,5 @@ void dcn401_unblank_stream(struct pipe_ctx *pipe_ctx, struct dc_link_settings *l · 79 unmodified lines
8080 void dcn401_hardware_release(struct dc *dc);
8181 void dcn401_update_odm(struct dc *dc, struct dc_state *context,
8282 struct pipe_ctx *otg_master);
83+void adjust_hotspot_between_slices_for_2x_magnify(uint32_t cursor_width, struct dc_cursor_position *pos_cpy);
8384 #endif /* __DC_HWSS_DCN401_H__ */
drivers/gpu/drm/amd/display/dc/link/protocols/link_edp_panel_control.c+1−1
@@ -763,7 +763,7 @@ bool edp_setup_psr(struct dc_link *link, · 762 unmodified lines
763763
764764 psr_context->crtcTimingVerticalTotal = stream->timing.v_total;
765765 psr_context->vsync_rate_hz = div64_u64(div64_u64((stream->
766− timing.pix_clk_100hz * 100),
766+ timing.pix_clk_100hz * (u64)100),
767767 stream->timing.v_total),
768768 stream->timing.h_total);
769769
drivers/gpu/drm/amd/display/dc/resource/dcn314/dcn314_resource.c+0−22
@@ -1695,25 +1695,6 @@ static void dcn314_get_panel_config_defaults(struct dc_panel_config *panel_confi · 1694 unmodified lines
16951695 *panel_config = panel_config_defaults;
16961696 }
16971697
1698−static bool filter_modes_for_single_channel_workaround(struct dc *dc,
1699− struct dc_state *context)
1700−{
1701− // Filter 2K@240Hz+8K@24fps above combination timing if memory only has single dimm LPDDR
1702− if (dc->clk_mgr->bw_params->vram_type == 34 &&
1703− dc->clk_mgr->bw_params->num_channels < 2 &&
1704− context->stream_count > 1) {
1705− int total_phy_pix_clk = 0;
1706−
1707− for (int i = 0; i < context->stream_count; i++)
1708− if (context->res_ctx.pipe_ctx[i].stream)
1709− total_phy_pix_clk += context->res_ctx.pipe_ctx[i].stream->phy_pix_clk;
1710−
1711− if (total_phy_pix_clk >= (1148928+826260)) //2K@240Hz+8K@24fps
1712− return true;
1713− }
1714− return false;
1715−}
1716−
17171698 bool dcn314_validate_bandwidth(struct dc *dc,
17181699 struct dc_state *context,
17191700 bool fast_validate)
@@ -1732,9 +1713,6 @@ bool dcn314_validate_bandwidth(struct dc *dc, · 12 unmodified lines
17321713 if (!pipes)
17331714 goto validate_fail;
17341715
1735− if (filter_modes_for_single_channel_workaround(dc, context))
1736− goto validate_fail;
1737−
17381716 DC_FP_START();
17391717 // do not support self refresh only
17401718 out = dcn30_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, false);
drivers/gpu/drm/amd/display/dc/resource/dcn315/dcn315_resource.c+1−1
@@ -1760,7 +1760,7 @@ static int dcn315_populate_dml_pipes_from_context( · 1759 unmodified lines
17601760 bool split_required = pipe->stream->timing.pix_clk_100hz >= dcn_get_max_non_odm_pix_rate_100hz(&dc->dml.soc)
17611761 || (pipe->plane_state && pipe->plane_state->src_rect.width > 5120);
17621762
1763− if (remaining_det_segs > MIN_RESERVED_DET_SEGS)
1763+ if (remaining_det_segs > MIN_RESERVED_DET_SEGS && crb_pipes != 0)
17641764 pipes[pipe_cnt].pipe.src.det_size_override += (remaining_det_segs - MIN_RESERVED_DET_SEGS) / crb_pipes +
17651765 (crb_idx < (remaining_det_segs - MIN_RESERVED_DET_SEGS) % crb_pipes ? 1 : 0);
17661766 if (pipes[pipe_cnt].pipe.src.det_size_override > 2 * DCN3_15_MAX_DET_SEGS) {
drivers/gpu/drm/amd/display/dc/resource/dcn35/dcn35_resource.c+0−2
@@ -2153,8 +2153,6 @@ static bool dcn35_resource_construct( · 2152 unmodified lines
21532153
21542154 dc->dml2_options.max_segments_per_hubp = 24;
21552155 dc->dml2_options.det_segment_size = DCN3_2_DET_SEG_SIZE;/*todo*/
2156− dc->dml2_options.max_frac_urgent_for_min_fclk_x1000 = 900;
2157− dc->dml2_options.min_fclk_for_urgent_workaround_khz = 400 * 1000;
21582156
21592157 if (dc->config.sdpif_request_limit_words_per_umc == 0)
21602158 dc->config.sdpif_request_limit_words_per_umc = 16;/*todo*/
drivers/gpu/drm/amd/display/dc/resource/dcn401/dcn401_resource.c+3−0
@@ -1822,6 +1822,9 @@ static bool dcn401_resource_construct( · 1821 unmodified lines
18221822 dc->caps.extended_aux_timeout_support = true;
18231823 dc->caps.dmcub_support = true;
18241824
1825+ if (ASICREV_IS_GC_12_0_1_A0(dc->ctx->asic_id.hw_internal_rev))
1826+ dc->caps.dcc_plane_width_limit = 7680;
1827+
18251828 /* Color pipeline capabilities */
18261829 dc->caps.color.dpp.dcn_arch = 1;
18271830 dc->caps.color.dpp.input_lut_shared = 0;
drivers/gpu/drm/amd/display/dc/spl/dc_spl.c+4−4
@@ -110,21 +110,21 @@ static struct spl_rect calculate_plane_rec_in_timing_active( · 109 unmodified lines
110110 struct fixed31_32 temp;
111111
112112
113− temp = dc_fixpt_from_fraction(rec_in->x * stream_dst->width,
113+ temp = dc_fixpt_from_fraction(rec_in->x * (long long)stream_dst->width,
114114 stream_src->width);
115115 rec_out.x = stream_dst->x + dc_fixpt_round(temp);
116116
117117 temp = dc_fixpt_from_fraction(
118− (rec_in->x + rec_in->width) * stream_dst->width,
118+ (rec_in->x + rec_in->width) * (long long)stream_dst->width,
119119 stream_src->width);
120120 rec_out.width = stream_dst->x + dc_fixpt_round(temp) - rec_out.x;
121121
122− temp = dc_fixpt_from_fraction(rec_in->y * stream_dst->height,
122+ temp = dc_fixpt_from_fraction(rec_in->y * (long long)stream_dst->height,
123123 stream_src->height);
124124 rec_out.y = stream_dst->y + dc_fixpt_round(temp);
125125
126126 temp = dc_fixpt_from_fraction(
127− (rec_in->y + rec_in->height) * stream_dst->height,
127+ (rec_in->y + rec_in->height) * (long long)stream_dst->height,
128128 stream_src->height);
129129 rec_out.height = stream_dst->y + dc_fixpt_round(temp) - rec_out.y;
130130
drivers/gpu/drm/amd/display/dmub/dmub_srv.h+1−0
@@ -299,6 +299,7 @@ struct dmub_srv_hw_params { · 298 unmodified lines
299299 enum dmub_memory_access_type mem_access_type;
300300 enum dmub_ips_disable_type disable_ips;
301301 bool disallow_phy_access;
302+ bool disable_sldo_opt;
302303 };
303304
304305 /**
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h+4−1
@@ -684,7 +684,8 @@ union dmub_fw_boot_options { · 683 unmodified lines
684684 uint32_t ips_pg_disable: 1; /* 1 to disable ONO domains power gating*/
685685 uint32_t ips_disable: 3; /* options to disable ips support*/
686686 uint32_t ips_sequential_ono: 1; /**< 1 to enable sequential ONO IPS sequence */
687− uint32_t reserved : 8; /**< reserved */
687+ uint32_t disable_sldo_opt: 1; /**< 1 to disable SLDO optimizations */
688+ uint32_t reserved : 7; /**< reserved */
688689 } bits; /**< boot bits */
689690 uint32_t all; /**< 32-bit access to bits */
690691 };
@@ -3326,6 +3327,7 @@ enum replay_state { · 2635 unmodified lines
33263327 REPLAY_STATE_1 = 0x10,
33273328 REPLAY_STATE_1A = 0x11,
33283329 REPLAY_STATE_2 = 0x20,
3330+ REPLAY_STATE_2A = 0x21,
33293331 REPLAY_STATE_3 = 0x30,
33303332 REPLAY_STATE_3INIT = 0x31,
33313333 REPLAY_STATE_4 = 0x40,
@@ -3333,6 +3335,7 @@ enum replay_state { · 1 unmodified line
33333335 REPLAY_STATE_4B = 0x42,
33343336 REPLAY_STATE_4C = 0x43,
33353337 REPLAY_STATE_4D = 0x44,
3338+ REPLAY_STATE_4E = 0x45,
33363339 REPLAY_STATE_4B_LOCKED = 0x4A,
33373340 REPLAY_STATE_4C_UNLOCKED = 0x4B,
33383341 REPLAY_STATE_5 = 0x50,
drivers/gpu/drm/amd/display/dmub/src/dmub_dcn35.c+1−0
@@ -424,6 +424,7 @@ void dmub_dcn35_enable_dmub_boot_options(struct dmub_srv *dmub, const struct dmu · 423 unmodified lines
424424 boot_options.bits.disable_clk_gate = params->disable_clock_gate;
425425 boot_options.bits.ips_disable = params->disable_ips;
426426 boot_options.bits.ips_sequential_ono = params->ips_sequential_ono;
427+ boot_options.bits.disable_sldo_opt = params->disable_sldo_opt;
427428
428429 REG_WRITE(DMCUB_SCRATCH14, boot_options.all);
429430 }
drivers/gpu/drm/amd/display/modules/freesync/freesync.c+1−1
@@ -1002,7 +1002,7 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync, · 1001 unmodified lines
10021002
10031003 if (stream->ctx->dc->caps.max_v_total != 0 && stream->timing.h_total != 0) {
10041004 min_hardware_refresh_in_uhz = div64_u64((stream->timing.pix_clk_100hz * 100000000ULL),
1005− (stream->timing.h_total * stream->ctx->dc->caps.max_v_total));
1005+ (stream->timing.h_total * (long long)stream->ctx->dc->caps.max_v_total));
10061006 }
10071007 /* Limit minimum refresh rate to what can be supported by hardware */
10081008 min_refresh_in_uhz = min_hardware_refresh_in_uhz > in_config->min_refresh_in_uhz ?
drivers/gpu/drm/amd/include/atomfirmware.h+1−1
@@ -734,7 +734,7 @@ struct atom_gpio_pin_lut_v2_1 · 733 unmodified lines
734734 {
735735 struct atom_common_table_header table_header;
736736 /*the real number of this included in the structure is calcualted by using the (whole structure size - the header size)/size of atom_gpio_pin_lut */
737− struct atom_gpio_pin_assignment gpio_pin[8];
737+ struct atom_gpio_pin_assignment gpio_pin[];
738738 };
739739
740740
drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c+1−0
@@ -727,6 +727,7 @@ static int smu_set_funcs(struct amdgpu_device *adev) · 726 unmodified lines
727727 break;
728728 case IP_VERSION(14, 0, 0):
729729 case IP_VERSION(14, 0, 1):
730+ case IP_VERSION(14, 0, 4):
730731 smu_v14_0_0_set_ppt_funcs(smu);
731732 break;
732733 case IP_VERSION(14, 0, 2):
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0.c+8−12
@@ -136,8 +136,7 @@ int smu_v14_0_load_microcode(struct smu_context *smu) · 135 unmodified lines
136136 1 & ~MP1_SMN_PUB_CTRL__LX3_RESET_MASK);
137137
138138 for (i = 0; i < adev->usec_timeout; i++) {
139− if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||
140− amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
139+ if (smu->is_apu)
141140 mp1_fw_flags = RREG32_PCIE(MP1_Public |
142141 (smnMP1_FIRMWARE_FLAGS_14_0_0 & 0xffffffff));
143142 else
@@ -210,8 +209,7 @@ int smu_v14_0_check_fw_status(struct smu_context *smu) · 66 unmodified lines
210209 struct amdgpu_device *adev = smu->adev;
211210 uint32_t mp1_fw_flags;
212211
213− if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||
214− amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
212+ if (smu->is_apu)
215213 mp1_fw_flags = RREG32_PCIE(MP1_Public |
216214 (smnMP1_FIRMWARE_FLAGS_14_0_0 & 0xffffffff));
217215 else
@@ -245,6 +243,7 @@ int smu_v14_0_check_fw_version(struct smu_context *smu) · 27 unmodified lines
245243
246244 switch (amdgpu_ip_version(adev, MP1_HWIP, 0)) {
247245 case IP_VERSION(14, 0, 0):
246+ case IP_VERSION(14, 0, 4):
248247 smu->smc_driver_if_version = SMU14_DRIVER_IF_VERSION_SMU_V14_0_0;
249248 break;
250249 case IP_VERSION(14, 0, 1):
@@ -759,6 +758,7 @@ int smu_v14_0_gfx_off_control(struct smu_context *smu, bool enable) · 508 unmodified lines
759758 case IP_VERSION(14, 0, 1):
760759 case IP_VERSION(14, 0, 2):
761760 case IP_VERSION(14, 0, 3):
761+ case IP_VERSION(14, 0, 4):
762762 if (!(adev->pm.pp_feature & PP_GFXOFF_MASK))
763763 return 0;
764764 if (enable)
@@ -866,8 +866,7 @@ static int smu_v14_0_set_irq_state(struct amdgpu_device *adev, · 101 unmodified lines
866866 WREG32_SOC15(THM, 0, regTHM_THERMAL_INT_ENA, 0);
867867
868868 /* For MP1 SW irqs */
869− if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||
870− amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) {
869+ if (smu->is_apu) {
871870 val = RREG32_SOC15(MP1, 0, regMP1_SMN_IH_SW_INT_CTRL_mp1_14_0_0);
872871 val = REG_SET_FIELD(val, MP1_SMN_IH_SW_INT_CTRL, INT_MASK, 1);
873872 WREG32_SOC15(MP1, 0, regMP1_SMN_IH_SW_INT_CTRL_mp1_14_0_0, val);
@@ -900,8 +899,7 @@ static int smu_v14_0_set_irq_state(struct amdgpu_device *adev, · 26 unmodified lines
900899 WREG32_SOC15(THM, 0, regTHM_THERMAL_INT_ENA, val);
901900
902901 /* For MP1 SW irqs */
903− if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||
904− amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) {
902+ if (smu->is_apu) {
905903 val = RREG32_SOC15(MP1, 0, regMP1_SMN_IH_SW_INT_mp1_14_0_0);
906904 val = REG_SET_FIELD(val, MP1_SMN_IH_SW_INT, ID, 0xFE);
907905 val = REG_SET_FIELD(val, MP1_SMN_IH_SW_INT, VALID, 0);
@@ -1494,8 +1492,7 @@ int smu_v14_0_set_vcn_enable(struct smu_context *smu, · 586 unmodified lines
14941492 if (adev->vcn.harvest_config & (1 << i))
14951493 continue;
14961494
1497− if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||
1498− amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) {
1495+ if (smu->is_apu) {
14991496 if (i == 0)
15001497 ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
15011498 SMU_MSG_PowerUpVcn0 : SMU_MSG_PowerDownVcn0,
@@ -1527,8 +1524,7 @@ int smu_v14_0_set_jpeg_enable(struct smu_context *smu, · 25 unmodified lines
15271524 if (adev->jpeg.harvest_config & (1 << i))
15281525 continue;
15291526
1530− if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||
1531− amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) {
1527+ if (smu->is_apu) {
15321528 if (i == 0)
15331529 ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
15341530 SMU_MSG_PowerUpJpeg0 : SMU_MSG_PowerDownJpeg0,
drivers/gpu/drm/amd/pm/swsmu/smu14/smu_v14_0_0_ppt.c+15−15
@@ -723,10 +723,10 @@ static int smu_v14_0_common_get_dpm_freq_by_index(struct smu_context *smu, · 722 unmodified lines
723723 uint32_t dpm_level,
724724 uint32_t *freq)
725725 {
726− if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0))
727− smu_v14_0_0_get_dpm_freq_by_index(smu, clk_type, dpm_level, freq);
728− else if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
726+ if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
729727 smu_v14_0_1_get_dpm_freq_by_index(smu, clk_type, dpm_level, freq);
728+ else
729+ smu_v14_0_0_get_dpm_freq_by_index(smu, clk_type, dpm_level, freq);
730730
731731 return 0;
732732 }
@@ -999,10 +999,10 @@ static int smu_v14_0_common_get_dpm_ultimate_freq(struct smu_context *smu, · 266 unmodified lines
999999 uint32_t *min,
10001000 uint32_t *max)
10011001 {
1002− if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0))
1003− smu_v14_0_0_get_dpm_ultimate_freq(smu, clk_type, min, max);
1004− else if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
1002+ if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
10051003 smu_v14_0_1_get_dpm_ultimate_freq(smu, clk_type, min, max);
1004+ else
1005+ smu_v14_0_0_get_dpm_ultimate_freq(smu, clk_type, min, max);
10061006
10071007 return 0;
10081008 }
@@ -1104,10 +1104,10 @@ static int smu_v14_0_common_get_dpm_level_count(struct smu_context *smu, · 95 unmodified lines
11041104 enum smu_clk_type clk_type,
11051105 uint32_t *count)
11061106 {
1107− if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0))
1108− smu_v14_0_0_get_dpm_level_count(smu, clk_type, count);
1109− else if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
1107+ if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
11101108 smu_v14_0_1_get_dpm_level_count(smu, clk_type, count);
1109+ else
1110+ smu_v14_0_0_get_dpm_level_count(smu, clk_type, count);
11111111
11121112 return 0;
11131113 }
@@ -1372,10 +1372,10 @@ static int smu_v14_0_0_set_fine_grain_gfx_freq_parameters(struct smu_context *sm · 258 unmodified lines
13721372
13731373 static int smu_v14_0_common_set_fine_grain_gfx_freq_parameters(struct smu_context *smu)
13741374 {
1375− if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0))
1376− smu_v14_0_0_set_fine_grain_gfx_freq_parameters(smu);
1377− else if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
1375+ if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
13781376 smu_v14_0_1_set_fine_grain_gfx_freq_parameters(smu);
1377+ else
1378+ smu_v14_0_0_set_fine_grain_gfx_freq_parameters(smu);
13791379
13801380 return 0;
13811381 }
@@ -1436,10 +1436,10 @@ static int smu_14_0_0_get_dpm_table(struct smu_context *smu, struct dpm_clocks * · 54 unmodified lines
14361436
14371437 static int smu_v14_0_common_get_dpm_table(struct smu_context *smu, struct dpm_clocks *clock_table)
14381438 {
1439− if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0))
1440− smu_14_0_0_get_dpm_table(smu, clock_table);
1441− else if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
1439+ if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
14421440 smu_14_0_1_get_dpm_table(smu, clock_table);
1441+ else
1442+ smu_14_0_0_get_dpm_table(smu, clock_table);
14431443
14441444 return 0;
14451445 }
drivers/gpu/drm/radeon/radeon_gem.c+1−1
@@ -642,7 +642,7 @@ static void radeon_gem_va_update_vm(struct radeon_device *rdev, · 641 unmodified lines
642642 if (r)
643643 goto error_unlock;
644644
645− if (bo_va->it.start)
645+ if (bo_va->it.start && bo_va->bo)
646646 r = radeon_vm_bo_update(rdev, bo_va, bo_va->bo->tbo.resource);
647647
648648 error_unlock:
include/uapi/drm/drm_fourcc.h+2−3
@@ -1506,6 +1506,8 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier) · 1505 unmodified lines
15061506 * 6 - 64KB_3D
15071507 * 7 - 256KB_3D
15081508 */
1509+#define AMD_FMT_MOD_TILE_GFX12_256B_2D 1
1510+#define AMD_FMT_MOD_TILE_GFX12_4K_2D 2
15091511 #define AMD_FMT_MOD_TILE_GFX12_64K_2D 3
15101512 #define AMD_FMT_MOD_TILE_GFX12_256K_2D 4
15111513
@@ -1540,9 +1542,6 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier) · 28 unmodified lines
15401542 #define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_SHIFT 18
15411543 #define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_MASK 0x3
15421544
1543−#define AMD_FMT_MOD_GFX12_DCC_MAX_COMPRESSED_BLOCK_SHIFT 3
1544−#define AMD_FMT_MOD_GFX12_DCC_MAX_COMPRESSED_BLOCK_MASK 0x3 /* 0:64B, 1:128B, 2:256B */
1545−
15461545 /*
15471546 * DCC supports embedding some clear colors directly in the DCC surface.
15481547 * However, on older GPUs the rendering HW ignores the embedded clear color

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