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
1808 case IP_VERSION(11, 0, 4):1808 case IP_VERSION(11, 0, 4):
1809 case IP_VERSION(11, 5, 0):1809 case IP_VERSION(11, 5, 0):
1810 case IP_VERSION(11, 5, 1):1810 case IP_VERSION(11, 5, 1):
1811 case IP_VERSION(11, 5, 2):
1811 amdgpu_device_ip_block_add(adev, &soc21_common_ip_block);1812 amdgpu_device_ip_block_add(adev, &soc21_common_ip_block);
1812 break;1813 break;
1813 case IP_VERSION(12, 0, 0):1814 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
1861 case IP_VERSION(11, 0, 4):1862 case IP_VERSION(11, 0, 4):
1862 case IP_VERSION(11, 5, 0):1863 case IP_VERSION(11, 5, 0):
1863 case IP_VERSION(11, 5, 1):1864 case IP_VERSION(11, 5, 1):
1865 case IP_VERSION(11, 5, 2):
1864 amdgpu_device_ip_block_add(adev, &gmc_v11_0_ip_block);1866 amdgpu_device_ip_block_add(adev, &gmc_v11_0_ip_block);
1865 break;1867 break;
1866 case IP_VERSION(12, 0, 0):1868 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
1962 case IP_VERSION(13, 0, 14):1964 case IP_VERSION(13, 0, 14):
1963 case IP_VERSION(14, 0, 0):1965 case IP_VERSION(14, 0, 0):
1964 case IP_VERSION(14, 0, 1):1966 case IP_VERSION(14, 0, 1):
1967 case IP_VERSION(14, 0, 4):
1965 amdgpu_device_ip_block_add(adev, &psp_v13_0_ip_block);1968 amdgpu_device_ip_block_add(adev, &psp_v13_0_ip_block);
1966 break;1969 break;
1967 case IP_VERSION(13, 0, 4):1970 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
2025 case IP_VERSION(14, 0, 1):2028 case IP_VERSION(14, 0, 1):
2026 case IP_VERSION(14, 0, 2):2029 case IP_VERSION(14, 0, 2):
2027 case IP_VERSION(14, 0, 3):2030 case IP_VERSION(14, 0, 3):
2031 case IP_VERSION(14, 0, 4):
2028 amdgpu_device_ip_block_add(adev, &smu_v14_0_ip_block);2032 amdgpu_device_ip_block_add(adev, &smu_v14_0_ip_block);
2029 break;2033 break;
2030 default:2034 default:
@@ -2152,6 +2156,7 @@ static int amdgpu_discovery_set_gc_ip_blocks(struct amdgpu_device *adev) · 121 unmodified lines
2152 case IP_VERSION(11, 0, 4):2156 case IP_VERSION(11, 0, 4):
2153 case IP_VERSION(11, 5, 0):2157 case IP_VERSION(11, 5, 0):
2154 case IP_VERSION(11, 5, 1):2158 case IP_VERSION(11, 5, 1):
2159 case IP_VERSION(11, 5, 2):
2155 amdgpu_device_ip_block_add(adev, &gfx_v11_0_ip_block);2160 amdgpu_device_ip_block_add(adev, &gfx_v11_0_ip_block);
2156 break;2161 break;
2157 case IP_VERSION(12, 0, 0):2162 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
2207 case IP_VERSION(6, 0, 3):2212 case IP_VERSION(6, 0, 3):
2208 case IP_VERSION(6, 1, 0):2213 case IP_VERSION(6, 1, 0):
2209 case IP_VERSION(6, 1, 1):2214 case IP_VERSION(6, 1, 1):
2215 case IP_VERSION(6, 1, 2):
2210 amdgpu_device_ip_block_add(adev, &sdma_v6_0_ip_block);2216 amdgpu_device_ip_block_add(adev, &sdma_v6_0_ip_block);
2211 break;2217 break;
2212 case IP_VERSION(7, 0, 0):2218 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
2325 case IP_VERSION(11, 0, 4):2331 case IP_VERSION(11, 0, 4):
2326 case IP_VERSION(11, 5, 0):2332 case IP_VERSION(11, 5, 0):
2327 case IP_VERSION(11, 5, 1):2333 case IP_VERSION(11, 5, 1):
2334 case IP_VERSION(11, 5, 2):
2328 amdgpu_device_ip_block_add(adev, &mes_v11_0_ip_block);2335 amdgpu_device_ip_block_add(adev, &mes_v11_0_ip_block);
2329 adev->enable_mes = true;2336 adev->enable_mes = true;
2330 adev->enable_mes_kiq = true;2337 adev->enable_mes_kiq = true;
@@ -2360,6 +2367,7 @@ static int amdgpu_discovery_set_vpe_ip_blocks(struct amdgpu_device *adev) · 29 unmodified lines
2360 switch (amdgpu_ip_version(adev, VPE_HWIP, 0)) {2367 switch (amdgpu_ip_version(adev, VPE_HWIP, 0)) {
2361 case IP_VERSION(6, 1, 0):2368 case IP_VERSION(6, 1, 0):
2362 case IP_VERSION(6, 1, 1):2369 case IP_VERSION(6, 1, 1):
2370 case IP_VERSION(6, 1, 3):
2363 amdgpu_device_ip_block_add(adev, &vpe_v6_1_ip_block);2371 amdgpu_device_ip_block_add(adev, &vpe_v6_1_ip_block);
2364 break;2372 break;
2365 default:2373 default:
@@ -2634,6 +2642,7 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev) · 268 unmodified lines
2634 break;2642 break;
2635 case IP_VERSION(11, 5, 0):2643 case IP_VERSION(11, 5, 0):
2636 case IP_VERSION(11, 5, 1):2644 case IP_VERSION(11, 5, 1):
2645 case IP_VERSION(11, 5, 2):
2637 adev->family = AMDGPU_FAMILY_GC_11_5_0;2646 adev->family = AMDGPU_FAMILY_GC_11_5_0;
2638 break;2647 break;
2639 case IP_VERSION(12, 0, 0):2648 case IP_VERSION(12, 0, 0):
@@ -2658,6 +2667,7 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev) · 18 unmodified lines
2658 case IP_VERSION(11, 0, 4):2667 case IP_VERSION(11, 0, 4):
2659 case IP_VERSION(11, 5, 0):2668 case IP_VERSION(11, 5, 0):
2660 case IP_VERSION(11, 5, 1):2669 case IP_VERSION(11, 5, 1):
2670 case IP_VERSION(11, 5, 2):
2661 adev->flags |= AMD_IS_APU;2671 adev->flags |= AMD_IS_APU;
2662 break;2672 break;
2663 default:2673 default:
@@ -2696,6 +2706,7 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev) · 32 unmodified lines
2696 break;2706 break;
2697 case IP_VERSION(7, 11, 0):2707 case IP_VERSION(7, 11, 0):
2698 case IP_VERSION(7, 11, 1):2708 case IP_VERSION(7, 11, 1):
2709 case IP_VERSION(7, 11, 3):
2699 adev->nbio.funcs = &nbio_v7_11_funcs;2710 adev->nbio.funcs = &nbio_v7_11_funcs;
2700 adev->nbio.hdp_flush_reg = &nbio_v7_11_hdp_flush_reg;2711 adev->nbio.hdp_flush_reg = &nbio_v7_11_hdp_flush_reg;
2701 break;2712 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
654 if (!IS_AMD_FMT_MOD(modifier))654 if (!IS_AMD_FMT_MOD(modifier))
655 return NULL;655 return NULL;
656 656
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
657 if (AMD_FMT_MOD_GET(DCC_RETILE, modifier))661 if (AMD_FMT_MOD_GET(DCC_RETILE, modifier))
658 return lookup_format_info(dcc_retile_formats,662 return lookup_format_info(dcc_retile_formats,
659 ARRAY_SIZE(dcc_retile_formats),663 ARRAY_SIZE(dcc_retile_formats),
@@ -720,32 +724,25 @@ extract_render_dcc_offset(struct amdgpu_device *adev, · 60 unmodified lines
720 724
721static int convert_tiling_flags_to_modifier_gfx12(struct amdgpu_framebuffer *afb)725static int convert_tiling_flags_to_modifier_gfx12(struct amdgpu_framebuffer *afb)
722{726{
723 struct amdgpu_device *adev = drm_to_adev(afb->base.dev);
724 const struct drm_format_info *format_info;
725 u64 modifier = 0;727 u64 modifier = 0;
726 int tile = 0;728 int swizzle_mode = AMDGPU_TILING_GET(afb->tiling_flags, GFX12_SWIZZLE_MODE);
727 int swizzle = 0;
728 729
729 if (amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(12, 0, 0)) {730 if (!swizzle_mode) {
730 tile = AMD_FMT_MOD_TILE_VER_GFX12;731 modifier = DRM_FORMAT_MOD_LINEAR;
731 swizzle = AMDGPU_TILING_GET(afb->tiling_flags, GFX12_SWIZZLE_MODE);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);
732 }742 }
733 743
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
746 afb->base.modifier = modifier;744 afb->base.modifier = modifier;
747 afb->base.flags |= DRM_MODE_FB_MODIFIERS;745 afb->base.flags |= DRM_MODE_FB_MODIFIERS;
748
749 return 0;746 return 0;
750}747}
751 748
@@ -773,12 +770,6 @@ static int convert_tiling_flags_to_modifier(struct amdgpu_framebuffer *afb) · 21 unmodified lines
773 int pipes = ilog2(num_pipes);770 int pipes = ilog2(num_pipes);
774 uint32_t dcc_offset = AMDGPU_TILING_GET(afb->tiling_flags, DCC_OFFSET_256B);771 uint32_t dcc_offset = AMDGPU_TILING_GET(afb->tiling_flags, DCC_OFFSET_256B);
775 772
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
782 switch (swizzle >> 2) {773 switch (swizzle >> 2) {
783 case 0: /* 256B */774 case 0: /* 256B */
784 block_size_bits = 8;775 block_size_bits = 8;
@@ -954,8 +945,7 @@ static int check_tiling_flags_gfx6(struct amdgpu_framebuffer *afb) · 169 unmodified lines
954{945{
955 u64 micro_tile_mode;946 u64 micro_tile_mode;
956 947
957 /* Zero swizzle mode means linear */948 if (AMDGPU_TILING_GET(afb->tiling_flags, ARRAY_MODE) == 1) /* LINEAR_ALIGNED */
958 if (AMDGPU_TILING_GET(afb->tiling_flags, SWIZZLE_MODE) == 0)
959 return 0;949 return 0;
960 950
961 micro_tile_mode = AMDGPU_TILING_GET(afb->tiling_flags, MICRO_TILE_MODE);951 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
1079 block_width = 256 / format_info->cpp[i];1069 block_width = 256 / format_info->cpp[i];
1080 block_height = 1;1070 block_height = 1;
1081 block_size_log2 = 8;1071 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);
1082 } else {1096 } else {
1083 int swizzle = AMD_FMT_MOD_GET(TILE, modifier);1097 int swizzle = AMD_FMT_MOD_GET(TILE, modifier);
1084 1098
@@ -1114,7 +1128,8 @@ static int amdgpu_display_verify_sizes(struct amdgpu_framebuffer *rfb) · 29 unmodified lines
1114 return ret;1128 return ret;
1115 }1129 }
1116 1130
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)) {
1118 if (AMD_FMT_MOD_GET(DCC_RETILE, modifier)) {1133 if (AMD_FMT_MOD_GET(DCC_RETILE, modifier)) {
1119 block_size_log2 = get_dcc_block_size(modifier, false, false);1134 block_size_log2 = get_dcc_block_size(modifier, false, false);
1120 get_block_dimensions(block_size_log2 + 8, format_info->cpp[0],1135 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
1144}1159}
1145 1160
1146static int amdgpu_display_get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb,1161static 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)
1148{1164{
1149 struct amdgpu_bo *rbo;1165 struct amdgpu_bo *rbo;
1150 int r;1166 int r;
@@ -1152,6 +1168,7 @@ static int amdgpu_display_get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb · 1 unmodified line
1152 if (!amdgpu_fb) {1168 if (!amdgpu_fb) {
1153 *tiling_flags = 0;1169 *tiling_flags = 0;
1154 *tmz_surface = false;1170 *tmz_surface = false;
1171 *gfx12_dcc = false;
1155 return 0;1172 return 0;
1156 }1173 }
1157 1174
@@ -1165,11 +1182,9 @@ static int amdgpu_display_get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb · 7 unmodified lines
1165 return r;1182 return r;
1166 }1183 }
1167 1184
1168 if (tiling_flags)1185 amdgpu_bo_get_tiling_flags(rbo, tiling_flags);
1169 amdgpu_bo_get_tiling_flags(rbo, tiling_flags);1186 *tmz_surface = amdgpu_bo_encrypted(rbo);
1170 1187 *gfx12_dcc = rbo->flags & AMDGPU_GEM_CREATE_GFX12_DCC;
1171 if (tmz_surface)
1172 *tmz_surface = amdgpu_bo_encrypted(rbo);
1173 1188
1174 amdgpu_bo_unreserve(rbo);1189 amdgpu_bo_unreserve(rbo);
1175 1190
@@ -1238,7 +1253,8 @@ static int amdgpu_display_framebuffer_init(struct drm_device *dev, · 62 unmodified lines
1238 }1253 }
1239 }1254 }
1240 1255
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);
1242 if (ret)1258 if (ret)
1243 return ret;1259 return ret;
1244 1260
@@ -1252,7 +1268,11 @@ static int amdgpu_display_framebuffer_init(struct drm_device *dev, · 7 unmodified lines
1252 1268
1253 if (!dev->mode_config.fb_modifiers_not_supported &&1269 if (!dev->mode_config.fb_modifiers_not_supported &&
1254 !(rfb->base.flags & DRM_MODE_FB_MODIFIERS)) {1270 !(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
1256 if (ret) {1276 if (ret) {
1257 drm_dbg_kms(dev, "Failed to convert tiling flags 0x%llX to a modifier",1277 drm_dbg_kms(dev, "Failed to convert tiling flags 0x%llX to a modifier",
1258 rfb->tiling_flags);1278 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
848 case IP_VERSION(11, 0, 4):848 case IP_VERSION(11, 0, 4):
849 case IP_VERSION(11, 5, 0):849 case IP_VERSION(11, 5, 0):
850 case IP_VERSION(11, 5, 1):850 case IP_VERSION(11, 5, 1):
851 case IP_VERSION(11, 5, 2):
851 /* Don't enable it by default yet.852 /* Don't enable it by default yet.
852 */853 */
853 if (amdgpu_tmz < 1) {854 if (amdgpu_tmz < 1) {
drivers/gpu/drm/amd/amdgpu/amdgpu_mode.h+1−0
@@ -300,6 +300,7 @@ struct amdgpu_framebuffer { · 299 unmodified lines
300 300
301 uint64_t tiling_flags;301 uint64_t tiling_flags;
302 bool tmz_surface;302 bool tmz_surface;
303 bool gfx12_dcc;
303 304
304 /* caching for later use */305 /* caching for later use */
305 uint64_t address;306 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
219 case IP_VERSION(13, 0, 11):219 case IP_VERSION(13, 0, 11):
220 case IP_VERSION(14, 0, 0):220 case IP_VERSION(14, 0, 0):
221 case IP_VERSION(14, 0, 1):221 case IP_VERSION(14, 0, 1):
222 case IP_VERSION(14, 0, 4):
222 psp_v13_0_set_psp_funcs(psp);223 psp_v13_0_set_psp_funcs(psp);
223 psp->boot_time_tmr = false;224 psp->boot_time_tmr = false;
224 break;225 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
4565 4565
4566 socket_id = AMDGPU_RAS_GPU_ERR_SOCKET_ID(boot_error);4566 socket_id = AMDGPU_RAS_GPU_ERR_SOCKET_ID(boot_error);
4567 aid_id = AMDGPU_RAS_GPU_ERR_AID_ID(boot_error);4567 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);
4569 4569
4570 if (AMDGPU_RAS_GPU_ERR_MEM_TRAINING(boot_error))4570 if (AMDGPU_RAS_GPU_ERR_MEM_TRAINING(boot_error))
4571 dev_info(adev->dev,4571 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
302 302
303 switch (amdgpu_ip_version(adev, VPE_HWIP, 0)) {303 switch (amdgpu_ip_version(adev, VPE_HWIP, 0)) {
304 case IP_VERSION(6, 1, 0):304 case IP_VERSION(6, 1, 0):
305 case IP_VERSION(6, 1, 3):
305 vpe_v6_1_set_funcs(vpe);306 vpe_v6_1_set_funcs(vpe);
306 break;307 break;
307 case IP_VERSION(6, 1, 1):308 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
9287 if (!adev->gfx.ip_dump_gfx_queues)9287 if (!adev->gfx.ip_dump_gfx_queues)
9288 return;9288 return;
9289 9289
9290 index = 0;
9290 reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_10);9291 reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_10);
9291 drm_printf(p, "\nnum_me: %d num_pipe: %d num_queue: %d\n",9292 drm_printf(p, "\nnum_me: %d num_pipe: %d num_queue: %d\n",
9292 adev->gfx.me.num_me,9293 adev->gfx.me.num_me,
@@ -9352,6 +9353,7 @@ static void gfx_v10_ip_dump(void *handle) · 59 unmodified lines
9352 if (!adev->gfx.ip_dump_gfx_queues)9353 if (!adev->gfx.ip_dump_gfx_queues)
9353 return;9354 return;
9354 9355
9356 index = 0;
9355 reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_10);9357 reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_10);
9356 amdgpu_gfx_off_ctrl(adev, false);9358 amdgpu_gfx_off_ctrl(adev, false);
9357 mutex_lock(&adev->srbm_mutex);9359 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
93MODULE_FIRMWARE("amdgpu/gc_11_5_1_me.bin");93MODULE_FIRMWARE("amdgpu/gc_11_5_1_me.bin");
94MODULE_FIRMWARE("amdgpu/gc_11_5_1_mec.bin");94MODULE_FIRMWARE("amdgpu/gc_11_5_1_mec.bin");
95MODULE_FIRMWARE("amdgpu/gc_11_5_1_rlc.bin");95MODULE_FIRMWARE("amdgpu/gc_11_5_1_rlc.bin");
96MODULE_FIRMWARE("amdgpu/gc_11_5_2_pfp.bin");
97MODULE_FIRMWARE("amdgpu/gc_11_5_2_me.bin");
98MODULE_FIRMWARE("amdgpu/gc_11_5_2_mec.bin");
99MODULE_FIRMWARE("amdgpu/gc_11_5_2_rlc.bin");
96 100
97static const struct amdgpu_hwip_reg_entry gc_reg_list_11_0[] = {101static const struct amdgpu_hwip_reg_entry gc_reg_list_11_0[] = {
98 SOC15_REG_ENTRY_STR(GC, 0, regGRBM_STATUS),102 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
1054 case IP_VERSION(11, 0, 4):1058 case IP_VERSION(11, 0, 4):
1055 case IP_VERSION(11, 5, 0):1059 case IP_VERSION(11, 5, 0):
1056 case IP_VERSION(11, 5, 1):1060 case IP_VERSION(11, 5, 1):
1061 case IP_VERSION(11, 5, 2):
1057 adev->gfx.config.max_hw_contexts = 8;1062 adev->gfx.config.max_hw_contexts = 8;
1058 adev->gfx.config.sc_prim_fifo_size_frontend = 0x20;1063 adev->gfx.config.sc_prim_fifo_size_frontend = 0x20;
1059 adev->gfx.config.sc_prim_fifo_size_backend = 0x100;1064 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
1534 case IP_VERSION(11, 0, 4):1539 case IP_VERSION(11, 0, 4):
1535 case IP_VERSION(11, 5, 0):1540 case IP_VERSION(11, 5, 0):
1536 case IP_VERSION(11, 5, 1):1541 case IP_VERSION(11, 5, 1):
1542 case IP_VERSION(11, 5, 2):
1537 adev->gfx.me.num_me = 1;1543 adev->gfx.me.num_me = 1;
1538 adev->gfx.me.num_pipe_per_me = 1;1544 adev->gfx.me.num_pipe_per_me = 1;
1539 adev->gfx.me.num_queue_per_pipe = 1;1545 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
2782 amdgpu_ip_version(adev, GC_HWIP, 0) ==2788 amdgpu_ip_version(adev, GC_HWIP, 0) ==
2783 IP_VERSION(11, 0, 4) ||2789 IP_VERSION(11, 0, 4) ||
2784 amdgpu_ip_version(adev, GC_HWIP, 0) == IP_VERSION(11, 5, 0) ||2790 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))
2786 bootload_status = RREG32_SOC15(GC, 0,2793 bootload_status = RREG32_SOC15(GC, 0,
2787 regRLC_RLCS_BOOTLOAD_STATUS_gc_11_0_1);2794 regRLC_RLCS_BOOTLOAD_STATUS_gc_11_0_1);
2788 else2795 else
@@ -5296,6 +5303,7 @@ static void gfx_v11_cntl_power_gating(struct amdgpu_device *adev, bool enable) · 2507 unmodified lines
5296 case IP_VERSION(11, 0, 4):5303 case IP_VERSION(11, 0, 4):
5297 case IP_VERSION(11, 5, 0):5304 case IP_VERSION(11, 5, 0):
5298 case IP_VERSION(11, 5, 1):5305 case IP_VERSION(11, 5, 1):
5306 case IP_VERSION(11, 5, 2):
5299 WREG32_SOC15(GC, 0, regRLC_PG_DELAY_3, RLC_PG_DELAY_3_DEFAULT_GC_11_0_1);5307 WREG32_SOC15(GC, 0, regRLC_PG_DELAY_3, RLC_PG_DELAY_3_DEFAULT_GC_11_0_1);
5300 break;5308 break;
5301 default:5309 default:
@@ -5332,6 +5340,7 @@ static int gfx_v11_0_set_powergating_state(void *handle, · 30 unmodified lines
5332 case IP_VERSION(11, 0, 4):5340 case IP_VERSION(11, 0, 4):
5333 case IP_VERSION(11, 5, 0):5341 case IP_VERSION(11, 5, 0):
5334 case IP_VERSION(11, 5, 1):5342 case IP_VERSION(11, 5, 1):
5343 case IP_VERSION(11, 5, 2):
5335 if (!enable)5344 if (!enable)
5336 amdgpu_gfx_off_ctrl(adev, false);5345 amdgpu_gfx_off_ctrl(adev, false);
5337 5346
@@ -5364,6 +5373,7 @@ static int gfx_v11_0_set_clockgating_state(void *handle, · 26 unmodified lines
5364 case IP_VERSION(11, 0, 4):5373 case IP_VERSION(11, 0, 4):
5365 case IP_VERSION(11, 5, 0):5374 case IP_VERSION(11, 5, 0):
5366 case IP_VERSION(11, 5, 1):5375 case IP_VERSION(11, 5, 1):
5376 case IP_VERSION(11, 5, 2):
5367 gfx_v11_0_update_gfx_clock_gating(adev,5377 gfx_v11_0_update_gfx_clock_gating(adev,
5368 state == AMD_CG_STATE_GATE);5378 state == AMD_CG_STATE_GATE);
5369 break;5379 break;
@@ -5604,11 +5614,7 @@ static void gfx_v11_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, · 234 unmodified lines
5604 amdgpu_ring_write(ring, PACKET3(PACKET3_RELEASE_MEM, 6));5614 amdgpu_ring_write(ring, PACKET3(PACKET3_RELEASE_MEM, 6));
5605 amdgpu_ring_write(ring, (PACKET3_RELEASE_MEM_GCR_SEQ |5615 amdgpu_ring_write(ring, (PACKET3_RELEASE_MEM_GCR_SEQ |
5606 PACKET3_RELEASE_MEM_GCR_GL2_WB |5616 PACKET3_RELEASE_MEM_GCR_GL2_WB |
5607 PACKET3_RELEASE_MEM_GCR_GL2_INV |5617 PACKET3_RELEASE_MEM_GCR_GLM_INV | /* must be set with GLM_WB */
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 |
5612 PACKET3_RELEASE_MEM_GCR_GLM_WB |5618 PACKET3_RELEASE_MEM_GCR_GLM_WB |
5613 PACKET3_RELEASE_MEM_CACHE_POLICY(3) |5619 PACKET3_RELEASE_MEM_CACHE_POLICY(3) |
5614 PACKET3_RELEASE_MEM_EVENT_TYPE(CACHE_FLUSH_AND_INV_TS_EVENT) |5620 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
6405 if (!adev->gfx.ip_dump_gfx_queues)6411 if (!adev->gfx.ip_dump_gfx_queues)
6406 return;6412 return;
6407 6413
6414 index = 0;
6408 reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_11);6415 reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_11);
6409 drm_printf(p, "\nnum_me: %d num_pipe: %d num_queue: %d\n",6416 drm_printf(p, "\nnum_me: %d num_pipe: %d num_queue: %d\n",
6410 adev->gfx.me.num_me,6417 adev->gfx.me.num_me,
@@ -6469,6 +6476,7 @@ static void gfx_v11_ip_dump(void *handle) · 58 unmodified lines
6469 if (!adev->gfx.ip_dump_gfx_queues)6476 if (!adev->gfx.ip_dump_gfx_queues)
6470 return;6477 return;
6471 6478
6479 index = 0;
6472 reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_11);6480 reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_11);
6473 amdgpu_gfx_off_ctrl(adev, false);6481 amdgpu_gfx_off_ctrl(adev, false);
6474 mutex_lock(&adev->srbm_mutex);6482 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
4108 /* inherit vmid from mqd */4108 /* inherit vmid from mqd */
4109 control |= 0x40000000;4109 control |= 0x40000000;
4110 4110
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
4126 amdgpu_ring_write(ring, PACKET3(PACKET3_INDIRECT_BUFFER, 2));4111 amdgpu_ring_write(ring, PACKET3(PACKET3_INDIRECT_BUFFER, 2));
4127 BUG_ON(ib->gpu_addr & 0x3); /* Dword align */4112 BUG_ON(ib->gpu_addr & 0x3); /* Dword align */
4128 amdgpu_ring_write(ring,4113 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
4144 amdgpu_ring_write(ring, PACKET3(PACKET3_RELEASE_MEM, 6));4129 amdgpu_ring_write(ring, PACKET3(PACKET3_RELEASE_MEM, 6));
4145 amdgpu_ring_write(ring, (PACKET3_RELEASE_MEM_GCR_SEQ |4130 amdgpu_ring_write(ring, (PACKET3_RELEASE_MEM_GCR_SEQ |
4146 PACKET3_RELEASE_MEM_GCR_GL2_WB |4131 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 |
4153 PACKET3_RELEASE_MEM_CACHE_POLICY(3) |4132 PACKET3_RELEASE_MEM_CACHE_POLICY(3) |
4154 PACKET3_RELEASE_MEM_EVENT_TYPE(CACHE_FLUSH_AND_INV_TS_EVENT) |4133 PACKET3_RELEASE_MEM_EVENT_TYPE(CACHE_FLUSH_AND_INV_TS_EVENT) |
4155 PACKET3_RELEASE_MEM_EVENT_INDEX(5)));4134 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
4727 SOC15_FLUSH_GPU_TLB_NUM_REG_WAIT * 7 +4706 SOC15_FLUSH_GPU_TLB_NUM_REG_WAIT * 7 +
4728 2 + /* VM_FLUSH */4707 2 + /* VM_FLUSH */
4729 8 + /* FENCE for VM_FLUSH */4708 8 + /* FENCE for VM_FLUSH */
4730 20 + /* GDS switch */
4731 5 + /* COND_EXEC */4709 5 + /* COND_EXEC */
4732 7 + /* HDP_flush */4710 7 + /* HDP_flush */
4733 4 + /* VGT_flush */4711 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
592 break;592 break;
593 case IP_VERSION(11, 5, 0):593 case IP_VERSION(11, 5, 0):
594 case IP_VERSION(11, 5, 1):594 case IP_VERSION(11, 5, 1):
595 case IP_VERSION(11, 5, 2):
595 adev->gfxhub.funcs = &gfxhub_v11_5_0_funcs;596 adev->gfxhub.funcs = &gfxhub_v11_5_0_funcs;
596 break;597 break;
597 default:598 default:
@@ -754,6 +755,7 @@ static int gmc_v11_0_sw_init(void *handle) · 156 unmodified lines
754 case IP_VERSION(11, 0, 4):755 case IP_VERSION(11, 0, 4):
755 case IP_VERSION(11, 5, 0):756 case IP_VERSION(11, 5, 0):
756 case IP_VERSION(11, 5, 1):757 case IP_VERSION(11, 5, 1):
758 case IP_VERSION(11, 5, 2):
757 set_bit(AMDGPU_GFXHUB(0), adev->vmhubs_mask);759 set_bit(AMDGPU_GFXHUB(0), adev->vmhubs_mask);
758 set_bit(AMDGPU_MMHUB0(0), adev->vmhubs_mask);760 set_bit(AMDGPU_MMHUB0(0), adev->vmhubs_mask);
759 /*761 /*
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
38MODULE_FIRMWARE("amdgpu/gc_11_0_4_imu.bin");38MODULE_FIRMWARE("amdgpu/gc_11_0_4_imu.bin");
39MODULE_FIRMWARE("amdgpu/gc_11_5_0_imu.bin");39MODULE_FIRMWARE("amdgpu/gc_11_5_0_imu.bin");
40MODULE_FIRMWARE("amdgpu/gc_11_5_1_imu.bin");40MODULE_FIRMWARE("amdgpu/gc_11_5_1_imu.bin");
41MODULE_FIRMWARE("amdgpu/gc_11_5_2_imu.bin");
41 42
42static int imu_v11_0_init_microcode(struct amdgpu_device *adev)43static int imu_v11_0_init_microcode(struct amdgpu_device *adev)
43{44{
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
51MODULE_FIRMWARE("amdgpu/gc_11_5_0_mes1.bin");51MODULE_FIRMWARE("amdgpu/gc_11_5_0_mes1.bin");
52MODULE_FIRMWARE("amdgpu/gc_11_5_1_mes_2.bin");52MODULE_FIRMWARE("amdgpu/gc_11_5_1_mes_2.bin");
53MODULE_FIRMWARE("amdgpu/gc_11_5_1_mes1.bin");53MODULE_FIRMWARE("amdgpu/gc_11_5_1_mes1.bin");
54MODULE_FIRMWARE("amdgpu/gc_11_5_2_mes_2.bin");
55MODULE_FIRMWARE("amdgpu/gc_11_5_2_mes1.bin");
54 56
55static int mes_v11_0_hw_init(void *handle);57static int mes_v11_0_hw_init(void *handle);
56static int mes_v11_0_hw_fini(void *handle);58static 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
569 if (!amdgpu_sriov_vf(adev)) {569 if (!amdgpu_sriov_vf(adev)) {
570 /* clear page fault status and address */570 /* clear page fault status and address */
571 WREG32_P(SOC15_REG_OFFSET(MMHUB, hub_inst,571 WREG32_P(SOC15_REG_OFFSET(MMHUB, hub_inst,
572 regVM_L2_PROTECTION_FAULT_STATUS), 1, ~1);572 regVM_L2_PROTECTION_FAULT_CNTL), 1, ~1);
573 }573 }
574 574
575 return fed;575 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
57MODULE_FIRMWARE("amdgpu/psp_14_0_0_ta.bin");57MODULE_FIRMWARE("amdgpu/psp_14_0_0_ta.bin");
58MODULE_FIRMWARE("amdgpu/psp_14_0_1_toc.bin");58MODULE_FIRMWARE("amdgpu/psp_14_0_1_toc.bin");
59MODULE_FIRMWARE("amdgpu/psp_14_0_1_ta.bin");59MODULE_FIRMWARE("amdgpu/psp_14_0_1_ta.bin");
60MODULE_FIRMWARE("amdgpu/psp_14_0_4_toc.bin");
61MODULE_FIRMWARE("amdgpu/psp_14_0_4_ta.bin");
60 62
61/* For large FW files the time to complete can be very long */63/* For large FW files the time to complete can be very long */
62#define USBC_PD_POLLING_LIMIT_S 24064#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
106 case IP_VERSION(13, 0, 11):108 case IP_VERSION(13, 0, 11):
107 case IP_VERSION(14, 0, 0):109 case IP_VERSION(14, 0, 0):
108 case IP_VERSION(14, 0, 1):110 case IP_VERSION(14, 0, 1):
111 case IP_VERSION(14, 0, 4):
109 err = psp_init_toc_microcode(psp, ucode_prefix);112 err = psp_init_toc_microcode(psp, ucode_prefix);
110 if (err)113 if (err)
111 return err;114 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
50MODULE_FIRMWARE("amdgpu/sdma_6_0_3.bin");50MODULE_FIRMWARE("amdgpu/sdma_6_0_3.bin");
51MODULE_FIRMWARE("amdgpu/sdma_6_1_0.bin");51MODULE_FIRMWARE("amdgpu/sdma_6_1_0.bin");
52MODULE_FIRMWARE("amdgpu/sdma_6_1_1.bin");52MODULE_FIRMWARE("amdgpu/sdma_6_1_1.bin");
53MODULE_FIRMWARE("amdgpu/sdma_6_1_2.bin");
53 54
54#define SDMA1_REG_OFFSET 0x60055#define SDMA1_REG_OFFSET 0x600
55#define SDMA0_HYP_DEC_REG_START 0x588056#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
389 case IP_VERSION(13, 0, 11):389 case IP_VERSION(13, 0, 11):
390 case IP_VERSION(14, 0, 0):390 case IP_VERSION(14, 0, 0):
391 case IP_VERSION(14, 0, 1):391 case IP_VERSION(14, 0, 1):
392 case IP_VERSION(14, 0, 4):
392 return AMD_RESET_METHOD_MODE2;393 return AMD_RESET_METHOD_MODE2;
393 default:394 default:
394 if (amdgpu_dpm_is_baco_supported(adev))395 if (amdgpu_dpm_is_baco_supported(adev))
@@ -752,6 +753,32 @@ static int soc21_common_early_init(void *handle) · 357 unmodified lines
752 AMD_PG_SUPPORT_JPEG;753 AMD_PG_SUPPORT_JPEG;
753 adev->external_rev_id = adev->rev_id + 0xc1;754 adev->external_rev_id = adev->rev_id + 0xc1;
754 break;755 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;
755 default:782 default:
756 /* FIXME: not supported yet */783 /* FIXME: not supported yet */
757 return -EINVAL;784 return -EINVAL;
@@ -927,6 +954,7 @@ static int soc21_common_set_clockgating_state(void *handle, · 169 unmodified lines
927 case IP_VERSION(7, 7, 1):954 case IP_VERSION(7, 7, 1):
928 case IP_VERSION(7, 11, 0):955 case IP_VERSION(7, 11, 0):
929 case IP_VERSION(7, 11, 1):956 case IP_VERSION(7, 11, 1):
957 case IP_VERSION(7, 11, 3):
930 adev->nbio.funcs->update_medium_grain_clock_gating(adev,958 adev->nbio.funcs->update_medium_grain_clock_gating(adev,
931 state == AMD_CG_STATE_GATE);959 state == AMD_CG_STATE_GATE);
932 adev->nbio.funcs->update_medium_grain_light_sleep(adev,960 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
34 34
35MODULE_FIRMWARE("amdgpu/vpe_6_1_0.bin");35MODULE_FIRMWARE("amdgpu/vpe_6_1_0.bin");
36MODULE_FIRMWARE("amdgpu/vpe_6_1_1.bin");36MODULE_FIRMWARE("amdgpu/vpe_6_1_1.bin");
37MODULE_FIRMWARE("amdgpu/vpe_6_1_3.bin");
37 38
38#define VPE_THREAD1_UCODE_OFFSET 0x800039#define VPE_THREAD1_UCODE_OFFSET 0x8000
39 40
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
1678 case IP_VERSION(11, 0, 4):1678 case IP_VERSION(11, 0, 4):
1679 case IP_VERSION(11, 5, 0):1679 case IP_VERSION(11, 5, 0):
1680 case IP_VERSION(11, 5, 1):1680 case IP_VERSION(11, 5, 1):
1681 case IP_VERSION(11, 5, 2):
1681 case IP_VERSION(12, 0, 0):1682 case IP_VERSION(12, 0, 0):
1682 case IP_VERSION(12, 0, 1):1683 case IP_VERSION(12, 0, 1):
1683 num_of_cache_types =1684 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
99 case IP_VERSION(6, 0, 3):99 case IP_VERSION(6, 0, 3):
100 case IP_VERSION(6, 1, 0):100 case IP_VERSION(6, 1, 0):
101 case IP_VERSION(6, 1, 1):101 case IP_VERSION(6, 1, 1):
102 case IP_VERSION(6, 1, 2):
102 case IP_VERSION(7, 0, 0):103 case IP_VERSION(7, 0, 0):
103 case IP_VERSION(7, 0, 1):104 case IP_VERSION(7, 0, 1):
104 kfd->device_info.num_sdma_queues_per_engine = 8;105 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
119 case IP_VERSION(6, 0, 3):120 case IP_VERSION(6, 0, 3):
120 case IP_VERSION(6, 1, 0):121 case IP_VERSION(6, 1, 0):
121 case IP_VERSION(6, 1, 1):122 case IP_VERSION(6, 1, 1):
123 case IP_VERSION(6, 1, 2):
122 case IP_VERSION(7, 0, 0):124 case IP_VERSION(7, 0, 0):
123 case IP_VERSION(7, 0, 1):125 case IP_VERSION(7, 0, 1):
124 /* Reserve 1 for paging and 1 for gfx */126 /* 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
175 case IP_VERSION(11, 0, 4):177 case IP_VERSION(11, 0, 4):
176 case IP_VERSION(11, 5, 0):178 case IP_VERSION(11, 5, 0):
177 case IP_VERSION(11, 5, 1):179 case IP_VERSION(11, 5, 1):
180 case IP_VERSION(11, 5, 2):
178 kfd->device_info.event_interrupt_class = &event_interrupt_class_v11;181 kfd->device_info.event_interrupt_class = &event_interrupt_class_v11;
179 break;182 break;
180 case IP_VERSION(12, 0, 0):183 case IP_VERSION(12, 0, 0):
@@ -438,6 +441,10 @@ struct kfd_dev *kgd2kfd_probe(struct amdgpu_device *adev, bool vf) · 257 unmodified lines
438 gfx_target_version = 110501;441 gfx_target_version = 110501;
439 f2g = &gfx_v11_kfd2kgd;442 f2g = &gfx_v11_kfd2kgd;
440 break;443 break;
444 case IP_VERSION(11, 5, 2):
445 gfx_target_version = 110502;
446 f2g = &gfx_v11_kfd2kgd;
447 break;
441 case IP_VERSION(12, 0, 0):448 case IP_VERSION(12, 0, 0):
442 gfx_target_version = 120000;449 gfx_target_version = 120000;
443 f2g = &gfx_v12_kfd2kgd;450 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
380 380
381 pdd = kfd_create_process_device_data(dev, process);381 pdd = kfd_create_process_device_data(dev, process);
382 if (!pdd) {382 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");
384 return -ENOMEM;385 return -ENOMEM;
385 }386 }
386 /*387 /*
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
69 kq->mqd_mgr = dev->dqm->mqd_mgrs[KFD_MQD_TYPE_HIQ];69 kq->mqd_mgr = dev->dqm->mqd_mgrs[KFD_MQD_TYPE_HIQ];
70 break;70 break;
71 default:71 default:
72 pr_err("Invalid queue type %d\n", type);72 dev_err(dev->adev->dev, "Invalid queue type %d\n", type);
73 return false;73 return false;
74 }74 }
75 75
@@ -79,13 +79,14 @@ static bool kq_initialize(struct kernel_queue *kq, struct kfd_node *dev, · 3 unmodified lines
79 prop.doorbell_ptr = kfd_get_kernel_doorbell(dev->kfd, &prop.doorbell_off);79 prop.doorbell_ptr = kfd_get_kernel_doorbell(dev->kfd, &prop.doorbell_off);
80 80
81 if (!prop.doorbell_ptr) {81 if (!prop.doorbell_ptr) {
82 pr_err("Failed to initialize doorbell");82 dev_err(dev->adev->dev, "Failed to initialize doorbell");
83 goto err_get_kernel_doorbell;83 goto err_get_kernel_doorbell;
84 }84 }
85 85
86 retval = kfd_gtt_sa_allocate(dev, queue_size, &kq->pq);86 retval = kfd_gtt_sa_allocate(dev, queue_size, &kq->pq);
87 if (retval != 0) {87 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);
89 goto err_pq_allocate_vidmem;90 goto err_pq_allocate_vidmem;
90 }91 }
91 92
@@ -341,7 +342,7 @@ struct kernel_queue *kernel_queue_init(struct kfd_node *dev, · 249 unmodified lines
341 if (kq_initialize(kq, dev, type, KFD_KERNEL_QUEUE_SIZE))342 if (kq_initialize(kq, dev, type, KFD_KERNEL_QUEUE_SIZE))
342 return kq;343 return kq;
343 344
344 pr_err("Failed to init kernel queue\n");345 dev_err(dev->adev->dev, "Failed to init kernel queue\n");
345 346
346 kfree(kq);347 kfree(kq);
347 return NULL;348 return NULL;
@@ -360,26 +361,26 @@ static __attribute__((unused)) void test_kq(struct kfd_node *dev) · 12 unmodified lines
360 uint32_t *buffer, i;361 uint32_t *buffer, i;
361 int retval;362 int retval;
362 363
363 pr_err("Starting kernel queue test\n");364 dev_err(dev->adev->dev, "Starting kernel queue test\n");
364 365
365 kq = kernel_queue_init(dev, KFD_QUEUE_TYPE_HIQ);366 kq = kernel_queue_init(dev, KFD_QUEUE_TYPE_HIQ);
366 if (unlikely(!kq)) {367 if (unlikely(!kq)) {
367 pr_err(" Failed to initialize HIQ\n");368 dev_err(dev->adev->dev, " Failed to initialize HIQ\n");
368 pr_err("Kernel queue test failed\n");369 dev_err(dev->adev->dev, "Kernel queue test failed\n");
369 return;370 return;
370 }371 }
371 372
372 retval = kq_acquire_packet_buffer(kq, 5, &buffer);373 retval = kq_acquire_packet_buffer(kq, 5, &buffer);
373 if (unlikely(retval != 0)) {374 if (unlikely(retval != 0)) {
374 pr_err(" Failed to acquire packet buffer\n");375 dev_err(dev->adev->dev, " Failed to acquire packet buffer\n");
375 pr_err("Kernel queue test failed\n");376 dev_err(dev->adev->dev, "Kernel queue test failed\n");
376 return;377 return;
377 }378 }
378 for (i = 0; i < 5; i++)379 for (i = 0; i < 5; i++)
379 buffer[i] = kq->nop_packet;380 buffer[i] = kq->nop_packet;
380 kq_submit_packet(kq);381 kq_submit_packet(kq);
381 382
382 pr_err("Ending kernel queue test\n");383 dev_err(dev->adev->dev, "Ending kernel queue test\n");
383}384}
384 385
385 386
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
118 * attention grabbing.118 * attention grabbing.
119 */119 */
120 if (gfx_info->max_shader_engines > KFD_MAX_NUM_SE) {120 if (gfx_info->max_shader_engines > KFD_MAX_NUM_SE) {
121 pr_err("Exceeded KFD_MAX_NUM_SE, chip reports %d\n",121 dev_err(mm->dev->adev->dev,
122 gfx_info->max_shader_engines);122 "Exceeded KFD_MAX_NUM_SE, chip reports %d\n",
123 gfx_info->max_shader_engines);
123 return;124 return;
124 }125 }
125 if (gfx_info->max_sh_per_se > KFD_MAX_NUM_SH_PER_SE) {126 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",
127 gfx_info->max_sh_per_se * gfx_info->max_shader_engines);129 gfx_info->max_sh_per_se * gfx_info->max_shader_engines);
128 return;130 return;
129 }131 }
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
45 unsigned int process_count, queue_count, compute_queue_count, gws_queue_count;45 unsigned int process_count, queue_count, compute_queue_count, gws_queue_count;
46 unsigned int map_queue_size;46 unsigned int map_queue_size;
47 unsigned int max_proc_per_quantum = 1;47 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;
49 50
50 process_count = pm->dqm->processes_count;51 process_count = pm->dqm->processes_count;
51 queue_count = pm->dqm->active_queue_count;52 queue_count = pm->dqm->active_queue_count;
@@ -59,14 +60,14 @@ static void pm_calc_rlib_size(struct packet_manager *pm, · 7 unmodified lines
59 */60 */
60 *over_subscription = false;61 *over_subscription = false;
61 62
62 if (dev->max_proc_per_quantum > 1)63 if (node->max_proc_per_quantum > 1)
63 max_proc_per_quantum = dev->max_proc_per_quantum;64 max_proc_per_quantum = node->max_proc_per_quantum;
64 65
65 if ((process_count > max_proc_per_quantum) ||66 if ((process_count > max_proc_per_quantum) ||
66 compute_queue_count > get_cp_queues_num(pm->dqm) ||67 compute_queue_count > get_cp_queues_num(pm->dqm) ||
67 gws_queue_count > 1) {68 gws_queue_count > 1) {
68 *over_subscription = true;69 *over_subscription = true;
69 pr_debug("Over subscribed runlist\n");70 dev_dbg(dev, "Over subscribed runlist\n");
70 }71 }
71 72
72 map_queue_size = pm->pmf->map_queues_size;73 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
81 if (*over_subscription)82 if (*over_subscription)
82 *rlib_size += pm->pmf->runlist_size;83 *rlib_size += pm->pmf->runlist_size;
83 84
84 pr_debug("runlist ib size %d\n", *rlib_size);85 dev_dbg(dev, "runlist ib size %d\n", *rlib_size);
85}86}
86 87
87static int pm_allocate_runlist_ib(struct packet_manager *pm,88static 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
90 unsigned int *rl_buffer_size,91 unsigned int *rl_buffer_size,
91 bool *is_over_subscription)92 bool *is_over_subscription)
92{93{
94 struct kfd_node *node = pm->dqm->dev;
95 struct device *dev = node->adev->dev;
93 int retval;96 int retval;
94 97
95 if (WARN_ON(pm->allocated))98 if (WARN_ON(pm->allocated))
@@ -99,11 +102,10 @@ static int pm_allocate_runlist_ib(struct packet_manager *pm, · 3 unmodified lines
99 102
100 mutex_lock(&pm->lock);103 mutex_lock(&pm->lock);
101 104
102 retval = kfd_gtt_sa_allocate(pm->dqm->dev, *rl_buffer_size,105 retval = kfd_gtt_sa_allocate(node, *rl_buffer_size, &pm->ib_buffer_obj);
103 &pm->ib_buffer_obj);
104 106
105 if (retval) {107 if (retval) {
106 pr_err("Failed to allocate runlist IB\n");108 dev_err(dev, "Failed to allocate runlist IB\n");
107 goto out;109 goto out;
108 }110 }
109 111
@@ -125,6 +127,8 @@ static int pm_create_runlist_ib(struct packet_manager *pm, · 15 unmodified lines
125{127{
126 unsigned int alloc_size_bytes;128 unsigned int alloc_size_bytes;
127 unsigned int *rl_buffer, rl_wptr, i;129 unsigned int *rl_buffer, rl_wptr, i;
130 struct kfd_node *node = pm->dqm->dev;
131 struct device *dev = node->adev->dev;
128 int retval, processes_mapped;132 int retval, processes_mapped;
129 struct device_process_node *cur;133 struct device_process_node *cur;
130 struct qcm_process_device *qpd;134 struct qcm_process_device *qpd;
@@ -142,7 +146,7 @@ static int pm_create_runlist_ib(struct packet_manager *pm, · 11 unmodified lines
142 *rl_size_bytes = alloc_size_bytes;146 *rl_size_bytes = alloc_size_bytes;
143 pm->ib_size_bytes = alloc_size_bytes;147 pm->ib_size_bytes = alloc_size_bytes;
144 148
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",
146 pm->dqm->processes_count, pm->dqm->active_queue_count);150 pm->dqm->processes_count, pm->dqm->active_queue_count);
147 151
148 /* build the run list ib packet */152 /* build the run list ib packet */
@@ -150,7 +154,7 @@ static int pm_create_runlist_ib(struct packet_manager *pm, · 1 unmodified line
150 qpd = cur->qpd;154 qpd = cur->qpd;
151 /* build map process packet */155 /* build map process packet */
152 if (processes_mapped >= pm->dqm->processes_count) {156 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");
154 pm_release_ib(pm);158 pm_release_ib(pm);
155 return -ENOMEM;159 return -ENOMEM;
156 }160 }
@@ -167,7 +171,8 @@ static int pm_create_runlist_ib(struct packet_manager *pm, · 10 unmodified lines
167 if (!kq->queue->properties.is_active)171 if (!kq->queue->properties.is_active)
168 continue;172 continue;
169 173
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",
171 kq->queue->queue, qpd->is_debug);176 kq->queue->queue, qpd->is_debug);
172 177
173 retval = pm->pmf->map_queues(pm,178 retval = pm->pmf->map_queues(pm,
@@ -186,7 +191,8 @@ static int pm_create_runlist_ib(struct packet_manager *pm, · 12 unmodified lines
186 if (!q->properties.is_active)191 if (!q->properties.is_active)
187 continue;192 continue;
188 193
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",
190 q->queue, qpd->is_debug);196 q->queue, qpd->is_debug);
191 197
192 retval = pm->pmf->map_queues(pm,198 retval = pm->pmf->map_queues(pm,
@@ -203,11 +209,13 @@ static int pm_create_runlist_ib(struct packet_manager *pm, · 10 unmodified lines
203 }209 }
204 }210 }
205 211
206 pr_debug("Finished map process and queues to runlist\n");212 dev_dbg(dev, "Finished map process and queues to runlist\n");
207 213
208 if (is_over_subscription) {214 if (is_over_subscription) {
209 if (!pm->is_over_subscription)215 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");
211 retval = pm->pmf->runlist(pm, &rl_buffer[rl_wptr],219 retval = pm->pmf->runlist(pm, &rl_buffer[rl_wptr],
212 *rl_gpu_addr,220 *rl_gpu_addr,
213 alloc_size_bytes / sizeof(uint32_t),221 alloc_size_bytes / sizeof(uint32_t),
@@ -273,6 +281,8 @@ void pm_uninit(struct packet_manager *pm) · 59 unmodified lines
273int pm_send_set_resources(struct packet_manager *pm,281int pm_send_set_resources(struct packet_manager *pm,
274 struct scheduling_resources *res)282 struct scheduling_resources *res)
275{283{
284 struct kfd_node *node = pm->dqm->dev;
285 struct device *dev = node->adev->dev;
276 uint32_t *buffer, size;286 uint32_t *buffer, size;
277 int retval = 0;287 int retval = 0;
278 288
@@ -282,7 +292,7 @@ int pm_send_set_resources(struct packet_manager *pm, · 3 unmodified lines
282 size / sizeof(uint32_t),292 size / sizeof(uint32_t),
283 (unsigned int **)&buffer);293 (unsigned int **)&buffer);
284 if (!buffer) {294 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");
286 retval = -ENOMEM;296 retval = -ENOMEM;
287 goto out;297 goto out;
288 }298 }
@@ -344,6 +354,8 @@ fail_create_runlist_ib: · 55 unmodified lines
344int pm_send_query_status(struct packet_manager *pm, uint64_t fence_address,354int pm_send_query_status(struct packet_manager *pm, uint64_t fence_address,
345 uint64_t fence_value)355 uint64_t fence_value)
346{356{
357 struct kfd_node *node = pm->dqm->dev;
358 struct device *dev = node->adev->dev;
347 uint32_t *buffer, size;359 uint32_t *buffer, size;
348 int retval = 0;360 int retval = 0;
349 361
@@ -355,7 +367,7 @@ int pm_send_query_status(struct packet_manager *pm, uint64_t fence_address, · 5 unmodified lines
355 kq_acquire_packet_buffer(pm->priv_queue,367 kq_acquire_packet_buffer(pm->priv_queue,
356 size / sizeof(uint32_t), (unsigned int **)&buffer);368 size / sizeof(uint32_t), (unsigned int **)&buffer);
357 if (!buffer) {369 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");
359 retval = -ENOMEM;371 retval = -ENOMEM;
360 goto out;372 goto out;
361 }373 }
@@ -373,6 +385,8 @@ out: · 11 unmodified lines
373 385
374int pm_update_grace_period(struct packet_manager *pm, uint32_t grace_period)386int pm_update_grace_period(struct packet_manager *pm, uint32_t grace_period)
375{387{
388 struct kfd_node *node = pm->dqm->dev;
389 struct device *dev = node->adev->dev;
376 int retval = 0;390 int retval = 0;
377 uint32_t *buffer, size;391 uint32_t *buffer, size;
378 392
@@ -386,7 +400,8 @@ int pm_update_grace_period(struct packet_manager *pm, uint32_t grace_period) · 7 unmodified lines
386 (unsigned int **)&buffer);400 (unsigned int **)&buffer);
387 401
388 if (!buffer) {402 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");
390 retval = -ENOMEM;405 retval = -ENOMEM;
391 goto out;406 goto out;
392 }407 }
@@ -407,6 +422,8 @@ int pm_send_unmap_queue(struct packet_manager *pm, · 14 unmodified lines
407 enum kfd_unmap_queues_filter filter,422 enum kfd_unmap_queues_filter filter,
408 uint32_t filter_param, bool reset)423 uint32_t filter_param, bool reset)
409{424{
425 struct kfd_node *node = pm->dqm->dev;
426 struct device *dev = node->adev->dev;
410 uint32_t *buffer, size;427 uint32_t *buffer, size;
411 int retval = 0;428 int retval = 0;
412 429
@@ -415,7 +432,7 @@ int pm_send_unmap_queue(struct packet_manager *pm, · 2 unmodified lines
415 kq_acquire_packet_buffer(pm->priv_queue,432 kq_acquire_packet_buffer(pm->priv_queue,
416 size / sizeof(uint32_t), (unsigned int **)&buffer);433 size / sizeof(uint32_t), (unsigned int **)&buffer);
417 if (!buffer) {434 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");
419 retval = -ENOMEM;436 retval = -ENOMEM;
420 goto out;437 goto out;
421 }438 }
@@ -464,6 +481,8 @@ out: · 42 unmodified lines
464 481
465int pm_debugfs_hang_hws(struct packet_manager *pm)482int pm_debugfs_hang_hws(struct packet_manager *pm)
466{483{
484 struct kfd_node *node = pm->dqm->dev;
485 struct device *dev = node->adev->dev;
467 uint32_t *buffer, size;486 uint32_t *buffer, size;
468 int r = 0;487 int r = 0;
469 488
@@ -475,16 +494,16 @@ int pm_debugfs_hang_hws(struct packet_manager *pm) · 5 unmodified lines
475 kq_acquire_packet_buffer(pm->priv_queue,494 kq_acquire_packet_buffer(pm->priv_queue,
476 size / sizeof(uint32_t), (unsigned int **)&buffer);495 size / sizeof(uint32_t), (unsigned int **)&buffer);
477 if (!buffer) {496 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");
479 r = -ENOMEM;498 r = -ENOMEM;
480 goto out;499 goto out;
481 }500 }
482 memset(buffer, 0x55, size);501 memset(buffer, 0x55, size);
483 kq_submit_packet(pm->priv_queue);502 kq_submit_packet(pm->priv_queue);
484 503
485 pr_info("Submitting %x %x %x %x %x %x %x to HIQ to hang the HWS.",504 dev_info(dev, "Submitting %x %x %x %x %x %x %x to HIQ to hang the HWS.",
486 buffer[0], buffer[1], buffer[2], buffer[3],505 buffer[0], buffer[1], buffer[2], buffer[3], buffer[4],
487 buffer[4], buffer[5], buffer[6]);506 buffer[5], buffer[6]);
488out:507out:
489 mutex_unlock(&pm->lock);508 mutex_unlock(&pm->lock);
490 return r;509 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
1311 if (IS_ERR_VALUE(qpd->tba_addr)) {1311 if (IS_ERR_VALUE(qpd->tba_addr)) {
1312 int err = qpd->tba_addr;1312 int err = qpd->tba_addr;
1313 1313
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);
1315 qpd->tba_addr = 0;1316 qpd->tba_addr = 0;
1316 qpd->cwsr_kaddr = NULL;1317 qpd->cwsr_kaddr = NULL;
1317 return err;1318 return err;
@@ -1611,7 +1612,8 @@ struct kfd_process_device *kfd_create_process_device_data(struct kfd_node *dev, · 293 unmodified lines
1611 &pdd->proc_ctx_cpu_ptr,1612 &pdd->proc_ctx_cpu_ptr,
1612 false);1613 false);
1613 if (retval) {1614 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");
1615 goto err_free_pdd;1617 goto err_free_pdd;
1616 }1618 }
1617 memset(pdd->proc_ctx_cpu_ptr, 0, AMDGPU_MES_PROC_CTX_SIZE);1619 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
1676 &p->kgd_process_info,1678 &p->kgd_process_info,
1677 &ef);1679 &ef);
1678 if (ret) {1680 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");
1680 return ret;1682 return ret;
1681 }1683 }
1682 RCU_INIT_POINTER(p->ef, ef);1684 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
1723 1725
1724 pdd = kfd_get_process_device_data(dev, p);1726 pdd = kfd_get_process_device_data(dev, p);
1725 if (!pdd) {1727 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");
1727 return ERR_PTR(-ENOMEM);1729 return ERR_PTR(-ENOMEM);
1728 }1730 }
1729 1731
@@ -1833,6 +1835,7 @@ int kfd_process_evict_queues(struct kfd_process *p, uint32_t trigger) · 103 unmodified lines
1833 1835
1834 for (i = 0; i < p->n_pdds; i++) {1836 for (i = 0; i < p->n_pdds; i++) {
1835 struct kfd_process_device *pdd = p->pdds[i];1837 struct kfd_process_device *pdd = p->pdds[i];
1838 struct device *dev = pdd->dev->adev->dev;
1836 1839
1837 kfd_smi_event_queue_eviction(pdd->dev, p->lead_thread->pid,1840 kfd_smi_event_queue_eviction(pdd->dev, p->lead_thread->pid,
1838 trigger);1841 trigger);
@@ -1844,7 +1847,7 @@ int kfd_process_evict_queues(struct kfd_process *p, uint32_t trigger) · 5 unmodified lines
1844 * them been add back since they actually not be saved right now.1847 * them been add back since they actually not be saved right now.
1845 */1848 */
1846 if (r && r != -EIO) {1849 if (r && r != -EIO) {
1847 pr_err("Failed to evict process queues\n");1850 dev_err(dev, "Failed to evict process queues\n");
1848 goto fail;1851 goto fail;
1849 }1852 }
1850 n_evicted++;1853 n_evicted++;
@@ -1866,7 +1869,8 @@ fail: · 15 unmodified lines
1866 1869
1867 if (pdd->dev->dqm->ops.restore_process_queues(pdd->dev->dqm,1870 if (pdd->dev->dqm->ops.restore_process_queues(pdd->dev->dqm,
1868 &pdd->qpd))1871 &pdd->qpd))
1869 pr_err("Failed to restore queues\n");1872 dev_err(pdd->dev->adev->dev,
1873 "Failed to restore queues\n");
1870 1874
1871 n_evicted--;1875 n_evicted--;
1872 }1876 }
@@ -1882,13 +1886,14 @@ int kfd_process_restore_queues(struct kfd_process *p) · 9 unmodified lines
1882 1886
1883 for (i = 0; i < p->n_pdds; i++) {1887 for (i = 0; i < p->n_pdds; i++) {
1884 struct kfd_process_device *pdd = p->pdds[i];1888 struct kfd_process_device *pdd = p->pdds[i];
1889 struct device *dev = pdd->dev->adev->dev;
1885 1890
1886 kfd_smi_event_queue_restore(pdd->dev, p->lead_thread->pid);1891 kfd_smi_event_queue_restore(pdd->dev, p->lead_thread->pid);
1887 1892
1888 r = pdd->dev->dqm->ops.restore_process_queues(pdd->dev->dqm,1893 r = pdd->dev->dqm->ops.restore_process_queues(pdd->dev->dqm,
1889 &pdd->qpd);1894 &pdd->qpd);
1890 if (r) {1895 if (r) {
1891 pr_err("Failed to restore process queues\n");1896 dev_err(dev, "Failed to restore process queues\n");
1892 if (!ret)1897 if (!ret)
1893 ret = r;1898 ret = r;
1894 }1899 }
@@ -2065,7 +2070,7 @@ int kfd_reserved_mem_mmap(struct kfd_node *dev, struct kfd_process *process, · 170 unmodified lines
2065 struct qcm_process_device *qpd;2070 struct qcm_process_device *qpd;
2066 2071
2067 if ((vma->vm_end - vma->vm_start) != KFD_CWSR_TBA_TMA_SIZE) {2072 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");
2069 return -EINVAL;2074 return -EINVAL;
2070 }2075 }
2071 2076
@@ -2077,7 +2082,8 @@ int kfd_reserved_mem_mmap(struct kfd_node *dev, struct kfd_process *process, · 5 unmodified lines
2077 qpd->cwsr_kaddr = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,2082 qpd->cwsr_kaddr = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO,
2078 get_order(KFD_CWSR_TBA_TMA_SIZE));2083 get_order(KFD_CWSR_TBA_TMA_SIZE));
2079 if (!qpd->cwsr_kaddr) {2084 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");
2081 return -ENOMEM;2087 return -ENOMEM;
2082 }2088 }
2083 2089
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
7561 }7561 }
7562 }7562 }
7563 7563
7564 if (j == dc_state->stream_count)7564 if (j == dc_state->stream_count || pbn_div == 0)
7565 continue;7565 continue;
7566 7566
7567 slot_num = DIV_ROUND_UP(pbn, pbn_div);7567 slot_num = DIV_ROUND_UP(pbn, pbn_div);
@@ -10462,6 +10462,7 @@ skip_modeset: · 2894 unmodified lines
10462 }10462 }
10463 10463
10464 /* Update Freesync settings. */10464 /* Update Freesync settings. */
10465 reset_freesync_config_for_crtc(dm_new_crtc_state);
10465 get_freesync_config_for_crtc(dm_new_crtc_state,10466 get_freesync_config_for_crtc(dm_new_crtc_state,
10466 dm_new_conn_state);10467 dm_new_conn_state);
10467 10468
@@ -10666,12 +10667,14 @@ static int dm_check_cursor_fb(struct amdgpu_crtc *new_acrtc, · 198 unmodified lines
10666 * check tiling flags when the FB doesn't have a modifier.10667 * check tiling flags when the FB doesn't have a modifier.
10667 */10668 */
10668 if (!(fb->flags & DRM_MODE_FB_MODIFIERS)) {10669 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 {
10670 linear = AMDGPU_TILING_GET(afb->tiling_flags, ARRAY_MODE) != DC_ARRAY_2D_TILED_THIN1 &&10675 linear = AMDGPU_TILING_GET(afb->tiling_flags, ARRAY_MODE) != DC_ARRAY_2D_TILED_THIN1 &&
10671 AMDGPU_TILING_GET(afb->tiling_flags, ARRAY_MODE) != DC_ARRAY_1D_TILED_THIN1 &&10676 AMDGPU_TILING_GET(afb->tiling_flags, ARRAY_MODE) != DC_ARRAY_1D_TILED_THIN1 &&
10672 AMDGPU_TILING_GET(afb->tiling_flags, MICRO_TILE_MODE) == 0;10677 AMDGPU_TILING_GET(afb->tiling_flags, MICRO_TILE_MODE) == 0;
10673 } else {
10674 linear = AMDGPU_TILING_GET(afb->tiling_flags, SWIZZLE_MODE) == 0;
10675 }10678 }
10676 if (!linear) {10679 if (!linear) {
10677 DRM_DEBUG_ATOMIC("Cursor FB not linear");10680 DRM_DEBUG_ATOMIC("Cursor FB not linear");
@@ -11863,6 +11866,49 @@ static bool parse_edid_cea(struct amdgpu_dm_connector *aconnector, · 1185 unmodified lines
11863 return ret;11866 return ret;
11864}11867}
11865 11868
11869static 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
11866static int parse_amd_vsdb(struct amdgpu_dm_connector *aconnector,11912static int parse_amd_vsdb(struct amdgpu_dm_connector *aconnector,
11867 struct edid *edid, struct amdgpu_hdmi_vsdb_info *vsdb_info)11913 struct edid *edid, struct amdgpu_hdmi_vsdb_info *vsdb_info)
11868{11914{
@@ -11983,6 +12029,11 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, · 114 unmodified lines
11983 if (!adev->dm.freesync_module)12029 if (!adev->dm.freesync_module)
11984 goto update;12030 goto update;
11985 12031
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
11986 if (edid && (sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT ||12037 if (edid && (sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT ||
11987 sink->sink_signal == SIGNAL_TYPE_EDP)) {12038 sink->sink_signal == SIGNAL_TYPE_EDP)) {
11988 bool edid_check_required = false;12039 bool edid_check_required = false;
@@ -11990,9 +12041,11 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, · 1 unmodified line
11990 if (is_dp_capable_without_timing_msa(adev->dm.dc,12041 if (is_dp_capable_without_timing_msa(adev->dm.dc,
11991 amdgpu_dm_connector)) {12042 amdgpu_dm_connector)) {
11992 if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) {12043 if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) {
11993 freesync_capable = true;
11994 amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq;12044 amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq;
11995 amdgpu_dm_connector->max_vfreq = connector->display_info.monitor_range.max_vfreq;12045 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;
11996 } else {12049 } else {
11997 edid_check_required = edid->version > 1 ||12050 edid_check_required = edid->version > 1 ||
11998 (edid->version == 1 &&12051 (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
575{575{
576 struct amdgpu_dm_connector *aconnector = link->priv;576 struct amdgpu_dm_connector *aconnector = link->priv;
577 577
578 if (!aconnector) {578 if (!aconnector)
579 DRM_ERROR("Failed to find connector for link!");
580 return false;579 return false;
581 }
582 580
583 return drm_dp_dpcd_write(&aconnector->dm_dp_aux.aux,581 return drm_dp_dpcd_write(&aconnector->dm_dp_aux.aux,
584 address, (uint8_t *)data, size) > 0;582 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
23 *23 *
24 */24 */
25 25
26#include <linux/vmalloc.h>
26#include <drm/display/drm_dp_helper.h>27#include <drm/display/drm_dp_helper.h>
27#include <drm/display/drm_dp_mst_helper.h>28#include <drm/display/drm_dp_mst_helper.h>
28#include <drm/drm_atomic.h>29#include <drm/drm_atomic.h>
@@ -1491,9 +1492,10 @@ int pre_validate_dsc(struct drm_atomic_state *state, · 1462 unmodified lines
1491 * from dm_state->context.1492 * from dm_state->context.
1492 */1493 */
1493 1494
1494 local_dc_state = kmemdup(dm_state->context, sizeof(struct dc_state), GFP_KERNEL);1495 local_dc_state = vmalloc(sizeof(struct dc_state));
1495 if (!local_dc_state)1496 if (!local_dc_state)
1496 return -ENOMEM;1497 return -ENOMEM;
1498 memcpy(local_dc_state, dm_state->context, sizeof(struct dc_state));
1497 1499
1498 for (i = 0; i < local_dc_state->stream_count; i++) {1500 for (i = 0; i < local_dc_state->stream_count; i++) {
1499 struct dc_stream_state *stream = dm_state->context->streams[i];1501 struct dc_stream_state *stream = dm_state->context->streams[i];
@@ -1563,7 +1565,7 @@ clean_exit: · 63 unmodified lines
1563 dc_stream_release(local_dc_state->streams[i]);1565 dc_stream_release(local_dc_state->streams[i]);
1564 }1566 }
1565 1567
1566 kfree(local_dc_state);1568 vfree(local_dc_state);
1567 1569
1568 return ret;1570 return ret;
1569}1571}
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
352 return ret;352 return ret;
353}353}
354 354
355static 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
355static void amdgpu_dm_plane_add_gfx10_1_modifiers(const struct amdgpu_device *adev,395static void amdgpu_dm_plane_add_gfx10_1_modifiers(const struct amdgpu_device *adev,
356 uint64_t **mods,396 uint64_t **mods,
357 uint64_t *size,397 uint64_t *size,
@@ -648,12 +688,13 @@ static void amdgpu_dm_plane_add_gfx11_modifiers(struct amdgpu_device *adev, · 290 unmodified lines
648static void amdgpu_dm_plane_add_gfx12_modifiers(struct amdgpu_device *adev,688static void amdgpu_dm_plane_add_gfx12_modifiers(struct amdgpu_device *adev,
649 uint64_t **mods, uint64_t *size, uint64_t *capacity)689 uint64_t **mods, uint64_t *size, uint64_t *capacity)
650{690{
651 uint64_t mod_64K_2D = AMD_FMT_MOD |691 uint64_t ver = AMD_FMT_MOD | AMD_FMT_MOD_SET(TILE_VERSION, AMD_FMT_MOD_TILE_VER_GFX12);
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);
654 692
655 /* 64K without DCC */693 /* Without DCC: */
656 amdgpu_dm_plane_add_modifier(mods, size, capacity, mod_64K_2D);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));
657 amdgpu_dm_plane_add_modifier(mods, size, capacity, DRM_FORMAT_MOD_LINEAR);698 amdgpu_dm_plane_add_modifier(mods, size, capacity, DRM_FORMAT_MOD_LINEAR);
658}699}
659 700
@@ -835,7 +876,15 @@ int amdgpu_dm_plane_fill_plane_buffer_attributes(struct amdgpu_device *adev, · 175 unmodified lines
835 upper_32_bits(chroma_addr);876 upper_32_bits(chroma_addr);
836 }877 }
837 878
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) {
839 ret = amdgpu_dm_plane_fill_gfx9_plane_attributes_from_modifiers(adev, afb, format,888 ret = amdgpu_dm_plane_fill_gfx9_plane_attributes_from_modifiers(adev, afb, format,
840 rotation, plane_size,889 rotation, plane_size,
841 tiling_info, dcc,890 tiling_info, dcc,
@@ -1419,8 +1468,6 @@ static bool amdgpu_dm_plane_format_mod_supported(struct drm_plane *plane, · 577 unmodified lines
1419 const struct drm_format_info *info = drm_format_info(format);1468 const struct drm_format_info *info = drm_format_info(format);
1420 int i;1469 int i;
1421 1470
1422 enum dm_micro_swizzle microtile = amdgpu_dm_plane_modifier_gfx9_swizzle_mode(modifier) & 3;
1423
1424 if (!info)1471 if (!info)
1425 return false;1472 return false;
1426 1473
@@ -1442,29 +1489,34 @@ static bool amdgpu_dm_plane_format_mod_supported(struct drm_plane *plane, · 15 unmodified lines
1442 if (i == plane->modifier_count)1489 if (i == plane->modifier_count)
1443 return false;1490 return false;
1444 1491
1445 /*1492 /* GFX12 doesn't have these limitations. */
1446 * For D swizzle the canonical modifier depends on the bpp, so check1493 if (AMD_FMT_MOD_GET(TILE_VERSION, modifier) <= AMD_FMT_MOD_TILE_VER_GFX11) {
1447 * it here.1494 enum dm_micro_swizzle microtile = amdgpu_dm_plane_modifier_gfx9_swizzle_mode(modifier) & 3;
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;
1458 1495
1459 if (amdgpu_dm_plane_modifier_has_dcc(modifier)) {1496 /*
1460 /* Per radeonsi comments 16/64 bpp are more complicated. */1497 * For D swizzle the canonical modifier depends on the bpp, so check
1461 if (info->cpp[0] != 4)1498 * it here.
1462 return false;
1463 /* We support multi-planar formats, but not when combined with
1464 * additional DCC metadata planes.
1465 */1499 */
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)
1467 return false;1508 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 }
1468 }1520 }
1469 1521
1470 return true;1522 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
158 DRM_DEBUG_DRIVER("Enabling psr...\n");158 DRM_DEBUG_DRIVER("Enabling psr...\n");
159 159
160 vsync_rate_hz = div64_u64(div64_u64((160 vsync_rate_hz = div64_u64(div64_u64((
161 stream->timing.pix_clk_100hz * 100),161 stream->timing.pix_clk_100hz * (uint64_t)100),
162 stream->timing.v_total),162 stream->timing.v_total),
163 stream->timing.h_total);163 stream->timing.h_total);
164 164
drivers/gpu/drm/amd/display/dc/basics/dce_calcs.c+1−1
@@ -1853,7 +1853,7 @@ static void calculate_bandwidth( · 1852 unmodified lines
1853 /*compute total time to request one chunk from each active display pipe*/1853 /*compute total time to request one chunk from each active display pipe*/
1854 for (i = 0; i <= maximum_number_of_surfaces - 1; i++) {1854 for (i = 0; i <= maximum_number_of_surfaces - 1; i++) {
1855 if (data->enable[i]) {1855 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))))));
1857 }1857 }
1858 }1858 }
1859 /*compute total time to request cursor data*/1859 /*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
131 struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base);131 struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base);
132 int dprefclk_wdivider;132 int dprefclk_wdivider;
133 int dprefclk_src_sel;133 int dprefclk_src_sel;
134 int dp_ref_clk_khz = 600000;134 int dp_ref_clk_khz;
135 int target_div;135 int target_div;
136 136
137 /* ASSERT DP Reference Clock source is from DFS*/137 /* 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
576 p_state_list[i] = curr_pipe_ctx->p_state_type;576 p_state_list[i] = curr_pipe_ctx->p_state_type;
577 577
578 refresh_rate = (curr_pipe_ctx->stream->timing.pix_clk_100hz * (uint64_t)100 +578 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);
580 refresh_rate = div_u64(refresh_rate, curr_pipe_ctx->stream->timing.v_total);580 refresh_rate = div_u64(refresh_rate, curr_pipe_ctx->stream->timing.v_total);
581 refresh_rate = div_u64(refresh_rate, curr_pipe_ctx->stream->timing.h_total);581 refresh_rate = div_u64(refresh_rate, curr_pipe_ctx->stream->timing.h_total);
582 disp_src_refresh_list[i] = refresh_rate;582 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
137 if (pipe->stream && (pipe->stream->dpms_off || dc_is_virtual_signal(pipe->stream->signal) ||137 if (pipe->stream && (pipe->stream->dpms_off || dc_is_virtual_signal(pipe->stream->signal) ||
138 !pipe->stream->link_enc)) {138 !pipe->stream->link_enc)) {
139 if (disable) {139 if (disable) {
140 if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->immediate_disable_crtc)140 if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->disable_crtc)
141 pipe->stream_res.tg->funcs->immediate_disable_crtc(pipe->stream_res.tg);141 pipe->stream_res.tg->funcs->disable_crtc(pipe->stream_res.tg);
142 142
143 reset_sync_context_for_pipe(dc, context, i);143 reset_sync_context_for_pipe(dc, context, i);
144 } else {144 } 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
306 struct dc_state *context,306 struct dc_state *context,
307 int ref_dtbclk_khz)307 int ref_dtbclk_khz)
308{308{
309 struct dccg *dccg = clk_mgr->dccg;
310 uint32_t tg_mask = 0;
311 int i;309 int i;
310 struct dccg *dccg = clk_mgr->dccg;
311 struct pipe_ctx *otg_master;
312 bool use_hpo_encoder;
312 313
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 }
328 314
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);
330 }332 }
331}333}
332 334
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
888 struct rect rec_out = {0};888 struct rect rec_out = {0};
889 struct fixed31_32 temp;889 struct fixed31_32 temp;
890 890
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,
892 stream->src.width);892 stream->src.width);
893 rec_out.x = stream->dst.x + dc_fixpt_round(temp);893 rec_out.x = stream->dst.x + dc_fixpt_round(temp);
894 894
895 temp = dc_fixpt_from_fraction(895 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,
897 stream->src.width);897 stream->src.width);
898 rec_out.width = stream->dst.x + dc_fixpt_round(temp) - rec_out.x;898 rec_out.width = stream->dst.x + dc_fixpt_round(temp) - rec_out.x;
899 899
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,
901 stream->src.height);901 stream->src.height);
902 rec_out.y = stream->dst.y + dc_fixpt_round(temp);902 rec_out.y = stream->dst.y + dc_fixpt_round(temp);
903 903
904 temp = dc_fixpt_from_fraction(904 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,
906 stream->src.height);906 stream->src.height);
907 rec_out.height = stream->dst.y + dc_fixpt_round(temp) - rec_out.y;907 rec_out.height = stream->dst.y + dc_fixpt_round(temp) - rec_out.y;
908 908
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
975 }975 }
976 976
977 if (search_for_max_increase)977 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);
979 else979 else
980 return stream->lumin_data.refresh_rate_hz[0];980 return stream->lumin_data.refresh_rate_hz[0];
981}981}
@@ -1024,7 +1024,7 @@ static unsigned int dc_stream_get_max_flickerless_instant_vtotal_delta(struct dc · 42 unmodified lines
1024 if (stream->timing.v_total * stream->timing.h_total == 0)1024 if (stream->timing.v_total * stream->timing.h_total == 0)
1025 return 0;1025 return 0;
1026 1026
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);
1028 1028
1029 int safe_refresh_hz = dc_stream_calculate_flickerless_refresh_rate(stream,1029 int safe_refresh_hz = dc_stream_calculate_flickerless_refresh_rate(stream,
1030 dc_stream_get_brightness_millinits_from_refresh(stream, current_refresh_hz),1030 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
1032 is_gaming,1032 is_gaming,
1033 increase);1033 increase);
1034 1034
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);
1036 1036
1037 if (increase)1037 if (increase)
1038 return (((int) stream->timing.v_total - safe_refresh_v_total) >= 0) ? (stream->timing.v_total - safe_refresh_v_total) : 0;1038 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
55struct set_config_cmd_payload;55struct set_config_cmd_payload;
56struct dmub_notification;56struct dmub_notification;
57 57
58#define DC_VER "3.2.290"58#define DC_VER "3.2.291"
59 59
60#define MAX_SURFACES 360#define MAX_SURFACES 3
61#define MAX_PLANES 661#define MAX_PLANES 6
@@ -293,6 +293,8 @@ struct dc_caps { · 231 unmodified lines
293 bool cursor_not_scaled;293 bool cursor_not_scaled;
294 bool dcmode_power_limits_present;294 bool dcmode_power_limits_present;
295 bool sequential_ono;295 bool sequential_ono;
296 /* Conservative limit for DCC cases which require ODM4:1 to support*/
297 uint32_t dcc_plane_width_limit;
296};298};
297 299
298struct dc_bug_wa {300struct 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
353 /* DP spec recommends between 1.05 to 1.1 safety margin to prevent sample under-run */353 /* DP spec recommends between 1.05 to 1.1 safety margin to prevent sample under-run */
354 struct fixed31_32 audio_sdp_margin = dc_fixpt_from_fraction(110, 100);354 struct fixed31_32 audio_sdp_margin = dc_fixpt_from_fraction(110, 100);
355 struct fixed31_32 horizontal_line_freq_khz = dc_fixpt_from_fraction(355 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);
357 struct fixed31_32 samples_per_line;357 struct fixed31_32 samples_per_line;
358 struct fixed31_32 layouts_per_line;358 struct fixed31_32 layouts_per_line;
359 struct fixed31_32 symbols_per_sdp_max_layout;359 struct fixed31_32 symbols_per_sdp_max_layout;
@@ -455,7 +455,8 @@ static uint32_t calculate_available_hblank_bw_in_symbols( · 95 unmodified lines
455 available_hblank_bw -= crtc_info->dsc_num_slices * 4; /* EOC overhead */455 available_hblank_bw -= crtc_info->dsc_num_slices * 4; /* EOC overhead */
456 456
457 if (available_hblank_bw < dp_link_info->hblank_min_symbol_width)457 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;
459 460
460 if (available_hblank_bw < 12)461 if (available_hblank_bw < 12)
461 available_hblank_bw = 0;462 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
217 actual_calc_clk_100hz = (uint64_t)feedback_divider *217 actual_calc_clk_100hz = (uint64_t)feedback_divider *
218 calc_pll_cs->fract_fb_divider_factor +218 calc_pll_cs->fract_fb_divider_factor +
219 fract_feedback_divider;219 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;
221 actual_calc_clk_100hz =221 actual_calc_clk_100hz =
222 div_u64(actual_calc_clk_100hz,222 div_u64(actual_calc_clk_100hz,
223 ref_divider * post_divider *223 ref_divider * post_divider *
@@ -680,7 +680,7 @@ static bool calculate_ss( · 456 unmodified lines
680 * so have to divided by 100 * 100*/680 * so have to divided by 100 * 100*/
681 ss_amount = dc_fixpt_mul(681 ss_amount = dc_fixpt_mul(
682 fb_div, dc_fixpt_from_fraction(ss_data->percentage,682 fb_div, dc_fixpt_from_fraction(ss_data->percentage,
683 100 * ss_data->percentage_divider));683 100 * (long long)ss_data->percentage_divider));
684 ds_data->feedback_amount = dc_fixpt_floor(ss_amount);684 ds_data->feedback_amount = dc_fixpt_floor(ss_amount);
685 685
686 ss_nslip_amount = dc_fixpt_sub(ss_amount,686 ss_nslip_amount = dc_fixpt_sub(ss_amount,
@@ -695,8 +695,8 @@ static bool calculate_ss( · 8 unmodified lines
695 695
696 /* compute SS_STEP_SIZE_DSFRAC */696 /* compute SS_STEP_SIZE_DSFRAC */
697 modulation_time = dc_fixpt_from_fraction(697 modulation_time = dc_fixpt_from_fraction(
698 pll_settings->reference_freq * 1000,698 pll_settings->reference_freq * (uint64_t)1000,
699 pll_settings->reference_divider * ss_data->modulation_freq_hz);699 pll_settings->reference_divider * (uint64_t)ss_data->modulation_freq_hz);
700 700
701 if (ss_data->flags.CENTER_SPREAD)701 if (ss_data->flags.CENTER_SPREAD)
702 modulation_time = dc_fixpt_div_int(modulation_time, 4);702 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
218 * contain integer component, lower 16 bits contain fractional component218 * contain integer component, lower 16 bits contain fractional component
219 * of active duty cycle e.g. 0x21BDC0 = 0xEFF0 * 0x24219 * of active duty cycle e.g. 0x21BDC0 = 0xEFF0 * 0x24
220 */220 */
221 active_duty_cycle = backlight_pwm_u16_16 * masked_pwm_period;221 active_duty_cycle = backlight_pwm_u16_16 * (uint64_t)masked_pwm_period;
222 222
223 /* 1.3 Calculate 16 bit active duty cycle from integer and fractional223 /* 1.3 Calculate 16 bit active duty cycle from integer and fractional
224 * components shift by bitCount then mask 16 bits and add rounding bit224 * 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
27 dcn10_opp.o \27 dcn10_opp.o \
28 dcn10_mpc.o \28 dcn10_mpc.o \
29 dcn10_cm_common.o \29 dcn10_cm_common.o \
30 dcn10_stream_encoder.o dcn10_link_encoder.o
31 30
32AMD_DAL_DCN10 = $(addprefix $(AMDDALPATH)/dc/dcn10/,$(DCN10))31AMD_DAL_DCN10 = $(addprefix $(AMDDALPATH)/dc/dcn10/,$(DCN10))
33 32
drivers/gpu/drm/amd/display/dc/dcn20/Makefile+0−1
@@ -2,7 +2,6 @@ · 1 unmodified line
2# Copyright © 2019-2024 Advanced Micro Devices, Inc. All rights reserved.2# Copyright © 2019-2024 Advanced Micro Devices, Inc. All rights reserved.
3 3
4DCN20 = dcn20_mpc.o dcn20_opp.o dcn20_mmhubbub.o \4DCN20 = dcn20_mpc.o dcn20_opp.o dcn20_mmhubbub.o \
5 dcn20_stream_encoder.o dcn20_link_encoder.o \
6 dcn20_vmid.o dcn20_dwb.o dcn20_dwb_scl.o5 dcn20_vmid.o dcn20_dwb.o dcn20_dwb_scl.o
7 6
8AMD_DAL_DCN20 = $(addprefix $(AMDDALPATH)/dc/dcn20/,$(DCN20))7AMD_DAL_DCN20 = $(addprefix $(AMDDALPATH)/dc/dcn20/,$(DCN20))
drivers/gpu/drm/amd/display/dc/dcn30/Makefile+0−2
@@ -25,12 +25,10 @@ · 24 unmodified lines
25 25
26DCN30 := dcn30_mpc.o dcn30_vpg.o \26DCN30 := dcn30_mpc.o dcn30_vpg.o \
27 dcn30_afmt.o \27 dcn30_afmt.o \
28 dcn30_dio_stream_encoder.o \
29 dcn30_dwb.o \28 dcn30_dwb.o \
30 dcn30_dwb_cm.o \29 dcn30_dwb_cm.o \
31 dcn30_cm_common.o \30 dcn30_cm_common.o \
32 dcn30_mmhubbub.o \31 dcn30_mmhubbub.o \
33 dcn30_dio_link_encoder.o
34 32
35 33
36 34
drivers/gpu/drm/amd/display/dc/dcn31/Makefile+1−1
@@ -4,7 +4,7 @@ · 3 unmodified lines
4#4#
5# Makefile for dcn31.5# Makefile for dcn31.
6 6
7DCN31 = dcn31_dio_link_encoder.o dcn31_panel_cntl.o \7DCN31 = dcn31_panel_cntl.o \
8 dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \8 dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \
9 dcn31_afmt.o dcn31_vpg.o9 dcn31_afmt.o dcn31_vpg.o
10 10
drivers/gpu/drm/amd/display/dc/dio/Makefile+36−0
@@ -24,6 +24,42 @@ · 23 unmodified lines
24#24#
25 25
26ifdef CONFIG_DRM_AMD_DC_FP26ifdef CONFIG_DRM_AMD_DC_FP
27###############################################################################
28# DCN10
29###############################################################################
30DIO_DCN10 = dcn10_link_encoder.o dcn10_stream_encoder.o
31
32AMD_DAL_DIO_DCN10 = $(addprefix $(AMDDALPATH)/dc/dio/dcn10/,$(DIO_DCN10))
33
34AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN10)
35
36###############################################################################
37# DCN20
38###############################################################################
39DIO_DCN20 = dcn20_link_encoder.o dcn20_stream_encoder.o
40
41AMD_DAL_DIO_DCN20 = $(addprefix $(AMDDALPATH)/dc/dio/dcn20/,$(DIO_DCN20))
42
43AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN20)
44
45###############################################################################
46# DCN30
47###############################################################################
48DIO_DCN30 = dcn30_dio_link_encoder.o dcn30_dio_stream_encoder.o
49
50AMD_DAL_DIO_DCN30 = $(addprefix $(AMDDALPATH)/dc/dio/dcn30/,$(DIO_DCN30))
51
52AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN30)
53
54###############################################################################
55# DCN31
56###############################################################################
57DIO_DCN31 = dcn31_dio_link_encoder.o
58
59AMD_DAL_DIO_DCN31 = $(addprefix $(AMDDALPATH)/dc/dio/dcn31/,$(DIO_DCN31))
60
61AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN31)
62
27###############################################################################63###############################################################################
28# DCN3264# DCN32
29###############################################################################65###############################################################################
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
997 if (pipe->plane_state && !pipe->top_pipe &&997 if (pipe->plane_state && !pipe->top_pipe &&
998 dc_state_get_pipe_subvp_type(context, pipe) == SUBVP_MAIN) {998 dc_state_get_pipe_subvp_type(context, pipe) == SUBVP_MAIN) {
999 refresh_rate = (pipe->stream->timing.pix_clk_100hz * (uint64_t)100 +999 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);
1001 refresh_rate = div_u64(refresh_rate, pipe->stream->timing.v_total);1001 refresh_rate = div_u64(refresh_rate, pipe->stream->timing.v_total);
1002 refresh_rate = div_u64(refresh_rate, pipe->stream->timing.h_total);1002 refresh_rate = div_u64(refresh_rate, pipe->stream->timing.h_total);
1003 1003
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
3364 &mode_lib->vba.UrgentBurstFactorLumaPre[k],3364 &mode_lib->vba.UrgentBurstFactorLumaPre[k],
3365 &mode_lib->vba.UrgentBurstFactorChromaPre[k],3365 &mode_lib->vba.UrgentBurstFactorChromaPre[k],
3366 &mode_lib->vba.NotUrgentLatencyHidingPre[k]);3366 &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];
3367 }3370 }
3368 3371
3369 {3372 {
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
197 memset(&dml_ctx->v21.dml_to_dc_pipe_mapping, 0, sizeof(struct dml2_dml_to_dc_pipe_mapping));197 memset(&dml_ctx->v21.dml_to_dc_pipe_mapping, 0, sizeof(struct dml2_dml_to_dc_pipe_mapping));
198 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));198 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));
199 199
200 if (!context || context->stream_count == 0)200 if (!context)
201 return true;201 return true;
202 202
203 if (context->stream_count == 0) {
204 dml21_build_fams2_programming(in_dc, context, dml_ctx);
205 return true;
206 }
207
203 /* scrub phantom's from current dc_state */208 /* scrub phantom's from current dc_state */
204 dml_ctx->config.svp_pstate.callbacks.remove_phantom_streams_and_planes(in_dc, context);209 dml_ctx->config.svp_pstate.callbacks.remove_phantom_streams_and_planes(in_dc, context);
205 dml_ctx->config.svp_pstate.callbacks.release_phantom_streams_and_planes(in_dc, context);210 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
280 285
281void dml21_prepare_mcache_programming(struct dc *in_dc, struct dc_state *context, struct dml2_context *dml_ctx)286void dml21_prepare_mcache_programming(struct dc *in_dc, struct dc_state *context, struct dml2_context *dml_ctx)
282{287{
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;
284 struct pipe_ctx *dc_main_pipes[__DML2_WRAPPER_MAX_STREAMS_PLANES__];290 struct pipe_ctx *dc_main_pipes[__DML2_WRAPPER_MAX_STREAMS_PLANES__];
285 struct pipe_ctx *dc_phantom_pipes[__DML2_WRAPPER_MAX_STREAMS_PLANES__] = {0};291 struct pipe_ctx *dc_phantom_pipes[__DML2_WRAPPER_MAX_STREAMS_PLANES__] = {0};
286 292
@@ -314,10 +320,8 @@ void dml21_prepare_mcache_programming(struct dc *in_dc, struct dc_state *context · 27 unmodified lines
314 }320 }
315 321
316 num_pipes = dml21_find_dc_pipes_for_plane(in_dc, context, dml_ctx, dc_main_pipes, dc_phantom_pipes, dml_prog_idx);322 num_pipes = dml21_find_dc_pipes_for_plane(in_dc, context, dml_ctx, dc_main_pipes, dc_phantom_pipes, dml_prog_idx);
317 323 if (num_pipes <= 0 || dc_main_pipes[0]->stream == NULL ||
318 if (num_pipes <= 0 ||324 dc_main_pipes[0]->plane_state == NULL)
319 dc_main_pipes[0]->stream == NULL ||
320 dc_main_pipes[0]->plane_state == NULL)
321 continue;325 continue;
322 326
323 /* get config for each pipe */327 /* 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
356 pln_prog = &dml_ctx->v21.mode_programming.programming->plane_programming[dml_prog_idx];360 pln_prog = &dml_ctx->v21.mode_programming.programming->plane_programming[dml_prog_idx];
357 361
358 num_pipes = dml21_find_dc_pipes_for_plane(in_dc, context, dml_ctx, dc_main_pipes, dc_phantom_pipes, dml_prog_idx);362 num_pipes = dml21_find_dc_pipes_for_plane(in_dc, context, dml_ctx, dc_main_pipes, dc_phantom_pipes, dml_prog_idx);
359 363 if (num_pipes <= 0 || dc_main_pipes[0]->stream == NULL ||
360 if (num_pipes <= 0 ||364 dc_main_pipes[0]->plane_state == NULL)
361 dc_main_pipes[0]->stream == NULL ||
362 dc_main_pipes[0]->plane_state == NULL)
363 continue;365 continue;
364 366
365 /* get config for each pipe */367 /* 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
11{11{
12 bool result = false;12 bool result = false;
13 13
14 if (out == 0)14 if (!out)
15 return false;15 return false;
16 16
17 memset(out, 0, sizeof(struct dml2_core_instance));17 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
21{21{
22 bool result = false;22 bool result = false;
23 23
24 if (out == 0)24 if (!out)
25 return false;25 return false;
26 26
27 memset(out, 0, sizeof(struct dml2_dpmm_instance));27 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
16{16{
17 bool result = false;17 bool result = false;
18 18
19 if (out == 0)19 if (!out)
20 return false;20 return false;
21 21
22 memset(out, 0, sizeof(struct dml2_mcg_instance));22 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
28{28{
29 bool result = false;29 bool result = false;
30 30
31 if (out == 0)31 if (!out)
32 return false;32 return false;
33 33
34 memset(out, 0, sizeof(struct dml2_pmo_instance));34 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
296 out->round_trip_ping_latency_dcfclk_cycles = 106;296 out->round_trip_ping_latency_dcfclk_cycles = 106;
297 out->smn_latency_us = 2;297 out->smn_latency_us = 2;
298 out->dispclk_dppclk_vco_speed_mhz = 3600;298 out->dispclk_dppclk_vco_speed_mhz = 3600;
299 out->pct_ideal_dram_bw_after_urgent_pixel_only = 65.0;
299 break;300 break;
300 301
301 case dml_project_dcn401:302 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
288{288{
289 unsigned int dc_pipe_ctx_index, dml_pipe_idx, plane_id;289 unsigned int dc_pipe_ctx_index, dml_pipe_idx, plane_id;
290 enum mall_stream_type pipe_mall_type;290 enum mall_stream_type pipe_mall_type;
291 bool unbounded_req_enabled = false;
292 struct dml2_calculate_rq_and_dlg_params_scratch *s = &in_ctx->v20.scratch.calculate_rq_and_dlg_params_scratch;291 struct dml2_calculate_rq_and_dlg_params_scratch *s = &in_ctx->v20.scratch.calculate_rq_and_dlg_params_scratch;
293 292
294 context->bw_ctx.bw.dcn.clk.dcfclk_deep_sleep_khz = (unsigned int)in_ctx->v20.dml_core_ctx.mp.DCFCLKDeepSleep * 1000;293 context->bw_ctx.bw.dcn.clk.dcfclk_deep_sleep_khz = (unsigned int)in_ctx->v20.dml_core_ctx.mp.DCFCLKDeepSleep * 1000;
295 context->bw_ctx.bw.dcn.clk.dppclk_khz = 0;294 context->bw_ctx.bw.dcn.clk.dppclk_khz = 0;
296 295
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)
298 context->bw_ctx.bw.dcn.clk.fclk_p_state_change_support = false;297 context->bw_ctx.bw.dcn.clk.fclk_p_state_change_support = false;
299 else298 else
300 context->bw_ctx.bw.dcn.clk.fclk_p_state_change_support = true;299 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
302 if (context->bw_ctx.bw.dcn.clk.dispclk_khz < dc->debug.min_disp_clk_khz)301 if (context->bw_ctx.bw.dcn.clk.dispclk_khz < dc->debug.min_disp_clk_khz)
303 context->bw_ctx.bw.dcn.clk.dispclk_khz = dc->debug.min_disp_clk_khz;302 context->bw_ctx.bw.dcn.clk.dispclk_khz = dc->debug.min_disp_clk_khz;
304 303
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
313 context->bw_ctx.bw.dcn.compbuf_size_kb = in_ctx->v20.dml_core_ctx.ip.config_return_buffer_size_in_kbytes;304 context->bw_ctx.bw.dcn.compbuf_size_kb = in_ctx->v20.dml_core_ctx.ip.config_return_buffer_size_in_kbytes;
314 305
315 for (dc_pipe_ctx_index = 0; dc_pipe_ctx_index < pipe_cnt; dc_pipe_ctx_index++) {306 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
344 context->res_ctx.pipe_ctx[dc_pipe_ctx_index].unbounded_req = false;335 context->res_ctx.pipe_ctx[dc_pipe_ctx_index].unbounded_req = false;
345 } else {336 } else {
346 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);337 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;
348 }340 }
349 341
350 context->bw_ctx.bw.dcn.compbuf_size_kb -= context->res_ctx.pipe_ctx[dc_pipe_ctx_index].det_buffer_size_kb;342 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
626 626
627 if (result) {627 if (result) {
628 unsigned int lowest_state_idx = s->mode_support_params.out_lowest_state_idx;628 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
644 out_clks.dispclk_khz = (unsigned int)dml2->v20.dml_core_ctx.mp.Dispclk_calculated * 1000;629 out_clks.dispclk_khz = (unsigned int)dml2->v20.dml_core_ctx.mp.Dispclk_calculated * 1000;
645 out_clks.p_state_supported = s->mode_support_info.DRAMClockChangeSupport[0] != dml_dram_clock_change_unsupported;630 out_clks.p_state_supported = s->mode_support_info.DRAMClockChangeSupport[0] != dml_dram_clock_change_unsupported;
646 if (in_dc->config.use_default_clock_table &&631 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
237 bool use_clock_dc_limits;237 bool use_clock_dc_limits;
238 bool gpuvm_enable;238 bool gpuvm_enable;
239 struct dml2_soc_bb *bb_from_dmub;239 struct dml2_soc_bb *bb_from_dmub;
240 int max_frac_urgent_for_min_fclk_x1000;
241 int min_fclk_for_urgent_workaround_khz;
242};240};
243 241
244/*242/*
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
829 struct dc_surface_dcc_cap *output)829 struct dc_surface_dcc_cap *output)
830{830{
831 struct dc *dc = hubbub->ctx->dc;831 struct dc *dc = hubbub->ctx->dc;
832 const unsigned int max_dcc_plane_width = dc->caps.dcc_plane_width_limit;
832 /* DCN4_Programming_Guide_DCHUB.docx, Section 5.11.2.2 */833 /* DCN4_Programming_Guide_DCHUB.docx, Section 5.11.2.2 */
833 enum dcc_control dcc_control;834 enum dcc_control dcc_control;
834 unsigned int plane0_bpe, plane1_bpe;835 unsigned int plane0_bpe, plane1_bpe;
@@ -843,6 +844,11 @@ bool hubbub401_get_dcc_compression_cap(struct hubbub *hubbub, · 8 unmodified lines
843 if (dc->debug.disable_dcc == DCC_DISABLE)844 if (dc->debug.disable_dcc == DCC_DISABLE)
844 return false;845 return false;
845 846
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
846 switch (input->format) {852 switch (input->format) {
847 default:853 default:
848 is_dual_plane = false;854 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
677 int rec_x_offset = x_pos - pos->x_hotspot;677 int rec_x_offset = x_pos - pos->x_hotspot;
678 int rec_y_offset = y_pos - pos->y_hotspot;678 int rec_y_offset = y_pos - pos->y_hotspot;
679 int dst_x_offset;679 int dst_x_offset;
680 int x_pos_viewport = x_pos * param->viewport.width / param->recout.width;680 int x_pos_viewport = 0;
681 int x_hot_viewport = pos->x_hotspot * param->viewport.width / param->recout.width;681 int x_hot_viewport = 0;
682 uint32_t cur_en = pos->enable ? 1 : 0;682 uint32_t cur_en = pos->enable ? 1 : 0;
683 683
684 hubp->curs_pos = *pos;684 hubp->curs_pos = *pos;
685 685
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
686 /*697 /*
687 * Guard aganst cursor_set_position() from being called with invalid698 * Guard aganst cursor_set_position() from being called with invalid
688 * attributes699 * 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
1305 1305
1306 dp_link_info->link_bandwidth_kbps = dc_fixpt_floor(link_bw_kbps);1306 dp_link_info->link_bandwidth_kbps = dc_fixpt_floor(link_bw_kbps);
1307 1307
1308 /* HW minimum for 128b/132b HBlank is 4 frame symbols.1308 /* Calculates hblank_min_symbol_width for 128b/132b
1309 * TODO: Plumb the actual programmed HBlank min symbol width to here.1309 * Corresponding HBLANK_MIN_SYMBOL_WIDTH register is calculated as:
1310 * floor(h_blank * bits_per_pixel / 128)
1310 */1311 */
1311 if (dp_link_info->encoding == DP_128b_132b_ENCODING)1312 if (dp_link_info->encoding == DP_128b_132b_ENCODING) {
1312 dp_link_info->hblank_min_symbol_width = 4;1313 struct dc_crtc_timing *crtc_timing = &pipe_ctx->stream->timing;
1313 else1314
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 {
1314 dp_link_info->hblank_min_symbol_width = 0;1365 dp_link_info->hblank_min_symbol_width = 0;
1366 }
1315}1367}
1316 1368
1317static void build_audio_output(1369static 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
2208 grouped_pipes[i]->stream->signal)) {2208 grouped_pipes[i]->stream->signal)) {
2209 embedded = i;2209 embedded = i;
2210 master = i;2210 master = i;
2211 phase[i] = embedded_pix_clk_100hz*100;2211 phase[i] = embedded_pix_clk_100hz*(uint64_t)100;
2212 modulo[i] = dp_ref_clk_100hz*100;2212 modulo[i] = dp_ref_clk_100hz*100;
2213 } else {2213 } else {
2214 2214
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
183 struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl;183 struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl;
184 struct dmcu *dmcu = pipe_ctx->stream->ctx->dc->res_pool->dmcu;184 struct dmcu *dmcu = pipe_ctx->stream->ctx->dc->res_pool->dmcu;
185 185
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
186 if (dmcu) {192 if (dmcu) {
187 dce110_set_abm_immediate_disable(pipe_ctx);193 dce110_set_abm_immediate_disable(pipe_ctx);
188 return;194 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
1088 return false;1088 return false;
1089}1089}
1090 1090
1091void 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
1091void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx)1102void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx)
1092{1103{
1093 struct dc_cursor_position pos_cpy = pipe_ctx->stream->cursor_position;1104 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
1109 int prev_odm_width = 0;1120 int prev_odm_width = 0;
1110 int prev_odm_offset = 0;1121 int prev_odm_offset = 0;
1111 struct pipe_ctx *prev_odm_pipe = NULL;1122 struct pipe_ctx *prev_odm_pipe = NULL;
1123 bool mpc_combine_on = false;
1124 int bottom_pipe_x_pos = 0;
1112 1125
1113 int x_pos = pos_cpy.x;1126 int x_pos = pos_cpy.x;
1114 int y_pos = pos_cpy.y;1127 int y_pos = pos_cpy.y;
1115 int recout_x_pos = 0;1128 int recout_x_pos = 0;
1116 int recout_y_pos = 0;1129 int recout_y_pos = 0;
1117 1130
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
1118 /* DCN4 moved cursor composition after Scaler, so in HW it is in1138 /* DCN4 moved cursor composition after Scaler, so in HW it is in
1119 * recout space and for HW Cursor position programming need to1139 * recout space and for HW Cursor position programming need to
1120 * translate to recout space.1140 * translate to recout space.
@@ -1177,15 +1197,8 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx) · 56 unmodified lines
1177 1197
1178 if (x_pos < 0) {1198 if (x_pos < 0) {
1179 pos_cpy.x_hotspot -= x_pos;1199 pos_cpy.x_hotspot -= x_pos;
1180 if ((odm_combine_on) && (hubp->curs_attr.attribute_flags.bits.ENABLE_MAGNIFICATION)) {1200 if (hubp->curs_attr.attribute_flags.bits.ENABLE_MAGNIFICATION)
1181 if (hubp->curs_attr.width <= 128) {1201 adjust_hotspot_between_slices_for_2x_magnify(hubp->curs_attr.width, &pos_cpy);
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 }
1189 x_pos = 0;1202 x_pos = 0;
1190 }1203 }
1191 1204
@@ -1194,6 +1207,22 @@ void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx) · 2 unmodified lines
1194 y_pos = 0;1207 y_pos = 0;
1195 }1208 }
1196 1209
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
1197 pos_cpy.x = (uint32_t)x_pos;1226 pos_cpy.x = (uint32_t)x_pos;
1198 pos_cpy.y = (uint32_t)y_pos;1227 pos_cpy.y = (uint32_t)y_pos;
1199 1228
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
80void dcn401_hardware_release(struct dc *dc);80void dcn401_hardware_release(struct dc *dc);
81void dcn401_update_odm(struct dc *dc, struct dc_state *context,81void dcn401_update_odm(struct dc *dc, struct dc_state *context,
82 struct pipe_ctx *otg_master);82 struct pipe_ctx *otg_master);
83void adjust_hotspot_between_slices_for_2x_magnify(uint32_t cursor_width, struct dc_cursor_position *pos_cpy);
83#endif /* __DC_HWSS_DCN401_H__ */84#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
763 763
764 psr_context->crtcTimingVerticalTotal = stream->timing.v_total;764 psr_context->crtcTimingVerticalTotal = stream->timing.v_total;
765 psr_context->vsync_rate_hz = div64_u64(div64_u64((stream->765 psr_context->vsync_rate_hz = div64_u64(div64_u64((stream->
766 timing.pix_clk_100hz * 100),766 timing.pix_clk_100hz * (u64)100),
767 stream->timing.v_total),767 stream->timing.v_total),
768 stream->timing.h_total);768 stream->timing.h_total);
769 769
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
1695 *panel_config = panel_config_defaults;1695 *panel_config = panel_config_defaults;
1696}1696}
1697 1697
1698static 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
1717bool dcn314_validate_bandwidth(struct dc *dc,1698bool dcn314_validate_bandwidth(struct dc *dc,
1718 struct dc_state *context,1699 struct dc_state *context,
1719 bool fast_validate)1700 bool fast_validate)
@@ -1732,9 +1713,6 @@ bool dcn314_validate_bandwidth(struct dc *dc, · 12 unmodified lines
1732 if (!pipes)1713 if (!pipes)
1733 goto validate_fail;1714 goto validate_fail;
1734 1715
1735 if (filter_modes_for_single_channel_workaround(dc, context))
1736 goto validate_fail;
1737
1738 DC_FP_START();1716 DC_FP_START();
1739 // do not support self refresh only1717 // do not support self refresh only
1740 out = dcn30_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, false);1718 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
1760 bool split_required = pipe->stream->timing.pix_clk_100hz >= dcn_get_max_non_odm_pix_rate_100hz(&dc->dml.soc)1760 bool split_required = pipe->stream->timing.pix_clk_100hz >= dcn_get_max_non_odm_pix_rate_100hz(&dc->dml.soc)
1761 || (pipe->plane_state && pipe->plane_state->src_rect.width > 5120);1761 || (pipe->plane_state && pipe->plane_state->src_rect.width > 5120);
1762 1762
1763 if (remaining_det_segs > MIN_RESERVED_DET_SEGS)1763 if (remaining_det_segs > MIN_RESERVED_DET_SEGS && crb_pipes != 0)
1764 pipes[pipe_cnt].pipe.src.det_size_override += (remaining_det_segs - MIN_RESERVED_DET_SEGS) / crb_pipes +1764 pipes[pipe_cnt].pipe.src.det_size_override += (remaining_det_segs - MIN_RESERVED_DET_SEGS) / crb_pipes +
1765 (crb_idx < (remaining_det_segs - MIN_RESERVED_DET_SEGS) % crb_pipes ? 1 : 0);1765 (crb_idx < (remaining_det_segs - MIN_RESERVED_DET_SEGS) % crb_pipes ? 1 : 0);
1766 if (pipes[pipe_cnt].pipe.src.det_size_override > 2 * DCN3_15_MAX_DET_SEGS) {1766 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
2153 2153
2154 dc->dml2_options.max_segments_per_hubp = 24;2154 dc->dml2_options.max_segments_per_hubp = 24;
2155 dc->dml2_options.det_segment_size = DCN3_2_DET_SEG_SIZE;/*todo*/2155 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;
2158 2156
2159 if (dc->config.sdpif_request_limit_words_per_umc == 0)2157 if (dc->config.sdpif_request_limit_words_per_umc == 0)
2160 dc->config.sdpif_request_limit_words_per_umc = 16;/*todo*/2158 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
1822 dc->caps.extended_aux_timeout_support = true;1822 dc->caps.extended_aux_timeout_support = true;
1823 dc->caps.dmcub_support = true;1823 dc->caps.dmcub_support = true;
1824 1824
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
1825 /* Color pipeline capabilities */1828 /* Color pipeline capabilities */
1826 dc->caps.color.dpp.dcn_arch = 1;1829 dc->caps.color.dpp.dcn_arch = 1;
1827 dc->caps.color.dpp.input_lut_shared = 0;1830 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
110 struct fixed31_32 temp;110 struct fixed31_32 temp;
111 111
112 112
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,
114 stream_src->width);114 stream_src->width);
115 rec_out.x = stream_dst->x + dc_fixpt_round(temp);115 rec_out.x = stream_dst->x + dc_fixpt_round(temp);
116 116
117 temp = dc_fixpt_from_fraction(117 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,
119 stream_src->width);119 stream_src->width);
120 rec_out.width = stream_dst->x + dc_fixpt_round(temp) - rec_out.x;120 rec_out.width = stream_dst->x + dc_fixpt_round(temp) - rec_out.x;
121 121
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,
123 stream_src->height);123 stream_src->height);
124 rec_out.y = stream_dst->y + dc_fixpt_round(temp);124 rec_out.y = stream_dst->y + dc_fixpt_round(temp);
125 125
126 temp = dc_fixpt_from_fraction(126 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,
128 stream_src->height);128 stream_src->height);
129 rec_out.height = stream_dst->y + dc_fixpt_round(temp) - rec_out.y;129 rec_out.height = stream_dst->y + dc_fixpt_round(temp) - rec_out.y;
130 130
drivers/gpu/drm/amd/display/dmub/dmub_srv.h+1−0
@@ -299,6 +299,7 @@ struct dmub_srv_hw_params { · 298 unmodified lines
299 enum dmub_memory_access_type mem_access_type;299 enum dmub_memory_access_type mem_access_type;
300 enum dmub_ips_disable_type disable_ips;300 enum dmub_ips_disable_type disable_ips;
301 bool disallow_phy_access;301 bool disallow_phy_access;
302 bool disable_sldo_opt;
302};303};
303 304
304/**305/**
drivers/gpu/drm/amd/display/dmub/inc/dmub_cmd.h+4−1
@@ -684,7 +684,8 @@ union dmub_fw_boot_options { · 683 unmodified lines
684 uint32_t ips_pg_disable: 1; /* 1 to disable ONO domains power gating*/684 uint32_t ips_pg_disable: 1; /* 1 to disable ONO domains power gating*/
685 uint32_t ips_disable: 3; /* options to disable ips support*/685 uint32_t ips_disable: 3; /* options to disable ips support*/
686 uint32_t ips_sequential_ono: 1; /**< 1 to enable sequential ONO IPS sequence */686 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 */
688 } bits; /**< boot bits */689 } bits; /**< boot bits */
689 uint32_t all; /**< 32-bit access to bits */690 uint32_t all; /**< 32-bit access to bits */
690};691};
@@ -3326,6 +3327,7 @@ enum replay_state { · 2635 unmodified lines
3326 REPLAY_STATE_1 = 0x10,3327 REPLAY_STATE_1 = 0x10,
3327 REPLAY_STATE_1A = 0x11,3328 REPLAY_STATE_1A = 0x11,
3328 REPLAY_STATE_2 = 0x20,3329 REPLAY_STATE_2 = 0x20,
3330 REPLAY_STATE_2A = 0x21,
3329 REPLAY_STATE_3 = 0x30,3331 REPLAY_STATE_3 = 0x30,
3330 REPLAY_STATE_3INIT = 0x31,3332 REPLAY_STATE_3INIT = 0x31,
3331 REPLAY_STATE_4 = 0x40,3333 REPLAY_STATE_4 = 0x40,
@@ -3333,6 +3335,7 @@ enum replay_state { · 1 unmodified line
3333 REPLAY_STATE_4B = 0x42,3335 REPLAY_STATE_4B = 0x42,
3334 REPLAY_STATE_4C = 0x43,3336 REPLAY_STATE_4C = 0x43,
3335 REPLAY_STATE_4D = 0x44,3337 REPLAY_STATE_4D = 0x44,
3338 REPLAY_STATE_4E = 0x45,
3336 REPLAY_STATE_4B_LOCKED = 0x4A,3339 REPLAY_STATE_4B_LOCKED = 0x4A,
3337 REPLAY_STATE_4C_UNLOCKED = 0x4B,3340 REPLAY_STATE_4C_UNLOCKED = 0x4B,
3338 REPLAY_STATE_5 = 0x50,3341 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
424 boot_options.bits.disable_clk_gate = params->disable_clock_gate;424 boot_options.bits.disable_clk_gate = params->disable_clock_gate;
425 boot_options.bits.ips_disable = params->disable_ips;425 boot_options.bits.ips_disable = params->disable_ips;
426 boot_options.bits.ips_sequential_ono = params->ips_sequential_ono;426 boot_options.bits.ips_sequential_ono = params->ips_sequential_ono;
427 boot_options.bits.disable_sldo_opt = params->disable_sldo_opt;
427 428
428 REG_WRITE(DMCUB_SCRATCH14, boot_options.all);429 REG_WRITE(DMCUB_SCRATCH14, boot_options.all);
429}430}
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
1002 1002
1003 if (stream->ctx->dc->caps.max_v_total != 0 && stream->timing.h_total != 0) {1003 if (stream->ctx->dc->caps.max_v_total != 0 && stream->timing.h_total != 0) {
1004 min_hardware_refresh_in_uhz = div64_u64((stream->timing.pix_clk_100hz * 100000000ULL),1004 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));
1006 }1006 }
1007 /* Limit minimum refresh rate to what can be supported by hardware */1007 /* Limit minimum refresh rate to what can be supported by hardware */
1008 min_refresh_in_uhz = min_hardware_refresh_in_uhz > in_config->min_refresh_in_uhz ?1008 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
734{734{
735 struct atom_common_table_header table_header;735 struct atom_common_table_header table_header;
736 /*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 */736 /*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[];
738};738};
739 739
740 740
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
727 break;727 break;
728 case IP_VERSION(14, 0, 0):728 case IP_VERSION(14, 0, 0):
729 case IP_VERSION(14, 0, 1):729 case IP_VERSION(14, 0, 1):
730 case IP_VERSION(14, 0, 4):
730 smu_v14_0_0_set_ppt_funcs(smu);731 smu_v14_0_0_set_ppt_funcs(smu);
731 break;732 break;
732 case IP_VERSION(14, 0, 2):733 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
136 1 & ~MP1_SMN_PUB_CTRL__LX3_RESET_MASK);136 1 & ~MP1_SMN_PUB_CTRL__LX3_RESET_MASK);
137 137
138 for (i = 0; i < adev->usec_timeout; i++) {138 for (i = 0; i < adev->usec_timeout; i++) {
139 if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||139 if (smu->is_apu)
140 amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
141 mp1_fw_flags = RREG32_PCIE(MP1_Public |140 mp1_fw_flags = RREG32_PCIE(MP1_Public |
142 (smnMP1_FIRMWARE_FLAGS_14_0_0 & 0xffffffff));141 (smnMP1_FIRMWARE_FLAGS_14_0_0 & 0xffffffff));
143 else142 else
@@ -210,8 +209,7 @@ int smu_v14_0_check_fw_status(struct smu_context *smu) · 66 unmodified lines
210 struct amdgpu_device *adev = smu->adev;209 struct amdgpu_device *adev = smu->adev;
211 uint32_t mp1_fw_flags;210 uint32_t mp1_fw_flags;
212 211
213 if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||212 if (smu->is_apu)
214 amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
215 mp1_fw_flags = RREG32_PCIE(MP1_Public |213 mp1_fw_flags = RREG32_PCIE(MP1_Public |
216 (smnMP1_FIRMWARE_FLAGS_14_0_0 & 0xffffffff));214 (smnMP1_FIRMWARE_FLAGS_14_0_0 & 0xffffffff));
217 else215 else
@@ -245,6 +243,7 @@ int smu_v14_0_check_fw_version(struct smu_context *smu) · 27 unmodified lines
245 243
246 switch (amdgpu_ip_version(adev, MP1_HWIP, 0)) {244 switch (amdgpu_ip_version(adev, MP1_HWIP, 0)) {
247 case IP_VERSION(14, 0, 0):245 case IP_VERSION(14, 0, 0):
246 case IP_VERSION(14, 0, 4):
248 smu->smc_driver_if_version = SMU14_DRIVER_IF_VERSION_SMU_V14_0_0;247 smu->smc_driver_if_version = SMU14_DRIVER_IF_VERSION_SMU_V14_0_0;
249 break;248 break;
250 case IP_VERSION(14, 0, 1):249 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
759 case IP_VERSION(14, 0, 1):758 case IP_VERSION(14, 0, 1):
760 case IP_VERSION(14, 0, 2):759 case IP_VERSION(14, 0, 2):
761 case IP_VERSION(14, 0, 3):760 case IP_VERSION(14, 0, 3):
761 case IP_VERSION(14, 0, 4):
762 if (!(adev->pm.pp_feature & PP_GFXOFF_MASK))762 if (!(adev->pm.pp_feature & PP_GFXOFF_MASK))
763 return 0;763 return 0;
764 if (enable)764 if (enable)
@@ -866,8 +866,7 @@ static int smu_v14_0_set_irq_state(struct amdgpu_device *adev, · 101 unmodified lines
866 WREG32_SOC15(THM, 0, regTHM_THERMAL_INT_ENA, 0);866 WREG32_SOC15(THM, 0, regTHM_THERMAL_INT_ENA, 0);
867 867
868 /* For MP1 SW irqs */868 /* For MP1 SW irqs */
869 if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||869 if (smu->is_apu) {
870 amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) {
871 val = RREG32_SOC15(MP1, 0, regMP1_SMN_IH_SW_INT_CTRL_mp1_14_0_0);870 val = RREG32_SOC15(MP1, 0, regMP1_SMN_IH_SW_INT_CTRL_mp1_14_0_0);
872 val = REG_SET_FIELD(val, MP1_SMN_IH_SW_INT_CTRL, INT_MASK, 1);871 val = REG_SET_FIELD(val, MP1_SMN_IH_SW_INT_CTRL, INT_MASK, 1);
873 WREG32_SOC15(MP1, 0, regMP1_SMN_IH_SW_INT_CTRL_mp1_14_0_0, val);872 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
900 WREG32_SOC15(THM, 0, regTHM_THERMAL_INT_ENA, val);899 WREG32_SOC15(THM, 0, regTHM_THERMAL_INT_ENA, val);
901 900
902 /* For MP1 SW irqs */901 /* For MP1 SW irqs */
903 if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||902 if (smu->is_apu) {
904 amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) {
905 val = RREG32_SOC15(MP1, 0, regMP1_SMN_IH_SW_INT_mp1_14_0_0);903 val = RREG32_SOC15(MP1, 0, regMP1_SMN_IH_SW_INT_mp1_14_0_0);
906 val = REG_SET_FIELD(val, MP1_SMN_IH_SW_INT, ID, 0xFE);904 val = REG_SET_FIELD(val, MP1_SMN_IH_SW_INT, ID, 0xFE);
907 val = REG_SET_FIELD(val, MP1_SMN_IH_SW_INT, VALID, 0);905 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
1494 if (adev->vcn.harvest_config & (1 << i))1492 if (adev->vcn.harvest_config & (1 << i))
1495 continue;1493 continue;
1496 1494
1497 if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||1495 if (smu->is_apu) {
1498 amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) {
1499 if (i == 0)1496 if (i == 0)
1500 ret = smu_cmn_send_smc_msg_with_param(smu, enable ?1497 ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
1501 SMU_MSG_PowerUpVcn0 : SMU_MSG_PowerDownVcn0,1498 SMU_MSG_PowerUpVcn0 : SMU_MSG_PowerDownVcn0,
@@ -1527,8 +1524,7 @@ int smu_v14_0_set_jpeg_enable(struct smu_context *smu, · 25 unmodified lines
1527 if (adev->jpeg.harvest_config & (1 << i))1524 if (adev->jpeg.harvest_config & (1 << i))
1528 continue;1525 continue;
1529 1526
1530 if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) ||1527 if (smu->is_apu) {
1531 amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) {
1532 if (i == 0)1528 if (i == 0)
1533 ret = smu_cmn_send_smc_msg_with_param(smu, enable ?1529 ret = smu_cmn_send_smc_msg_with_param(smu, enable ?
1534 SMU_MSG_PowerUpJpeg0 : SMU_MSG_PowerDownJpeg0,1530 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
723 uint32_t dpm_level,723 uint32_t dpm_level,
724 uint32_t *freq)724 uint32_t *freq)
725{725{
726 if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0))726 if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
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))
729 smu_v14_0_1_get_dpm_freq_by_index(smu, clk_type, dpm_level, freq);727 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);
730 730
731 return 0;731 return 0;
732}732}
@@ -999,10 +999,10 @@ static int smu_v14_0_common_get_dpm_ultimate_freq(struct smu_context *smu, · 266 unmodified lines
999 uint32_t *min,999 uint32_t *min,
1000 uint32_t *max)1000 uint32_t *max)
1001{1001{
1002 if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0))1002 if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
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))
1005 smu_v14_0_1_get_dpm_ultimate_freq(smu, clk_type, min, max);1003 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);
1006 1006
1007 return 0;1007 return 0;
1008}1008}
@@ -1104,10 +1104,10 @@ static int smu_v14_0_common_get_dpm_level_count(struct smu_context *smu, · 95 unmodified lines
1104 enum smu_clk_type clk_type,1104 enum smu_clk_type clk_type,
1105 uint32_t *count)1105 uint32_t *count)
1106{1106{
1107 if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0))1107 if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
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))
1110 smu_v14_0_1_get_dpm_level_count(smu, clk_type, count);1108 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);
1111 1111
1112 return 0;1112 return 0;
1113}1113}
@@ -1372,10 +1372,10 @@ static int smu_v14_0_0_set_fine_grain_gfx_freq_parameters(struct smu_context *sm · 258 unmodified lines
1372 1372
1373static int smu_v14_0_common_set_fine_grain_gfx_freq_parameters(struct smu_context *smu)1373static int smu_v14_0_common_set_fine_grain_gfx_freq_parameters(struct smu_context *smu)
1374{1374{
1375 if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0))1375 if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
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))
1378 smu_v14_0_1_set_fine_grain_gfx_freq_parameters(smu);1376 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);
1379 1379
1380 return 0;1380 return 0;
1381}1381}
@@ -1436,10 +1436,10 @@ static int smu_14_0_0_get_dpm_table(struct smu_context *smu, struct dpm_clocks * · 54 unmodified lines
1436 1436
1437static int smu_v14_0_common_get_dpm_table(struct smu_context *smu, struct dpm_clocks *clock_table)1437static int smu_v14_0_common_get_dpm_table(struct smu_context *smu, struct dpm_clocks *clock_table)
1438{1438{
1439 if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0))1439 if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1))
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))
1442 smu_14_0_1_get_dpm_table(smu, clock_table);1440 smu_14_0_1_get_dpm_table(smu, clock_table);
1441 else
1442 smu_14_0_0_get_dpm_table(smu, clock_table);
1443 1443
1444 return 0;1444 return 0;
1445}1445}
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
642 if (r)642 if (r)
643 goto error_unlock;643 goto error_unlock;
644 644
645 if (bo_va->it.start)645 if (bo_va->it.start && bo_va->bo)
646 r = radeon_vm_bo_update(rdev, bo_va, bo_va->bo->tbo.resource);646 r = radeon_vm_bo_update(rdev, bo_va, bo_va->bo->tbo.resource);
647 647
648error_unlock:648error_unlock:
include/uapi/drm/drm_fourcc.h+2−3
@@ -1506,6 +1506,8 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier) · 1505 unmodified lines
1506 * 6 - 64KB_3D1506 * 6 - 64KB_3D
1507 * 7 - 256KB_3D1507 * 7 - 256KB_3D
1508 */1508 */
1509#define AMD_FMT_MOD_TILE_GFX12_256B_2D 1
1510#define AMD_FMT_MOD_TILE_GFX12_4K_2D 2
1509#define AMD_FMT_MOD_TILE_GFX12_64K_2D 31511#define AMD_FMT_MOD_TILE_GFX12_64K_2D 3
1510#define AMD_FMT_MOD_TILE_GFX12_256K_2D 41512#define AMD_FMT_MOD_TILE_GFX12_256K_2D 4
1511 1513
@@ -1540,9 +1542,6 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier) · 28 unmodified lines
1540#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_SHIFT 181542#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_SHIFT 18
1541#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_MASK 0x31543#define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_MASK 0x3
1542 1544
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
1546/*1545/*
1547 * DCC supports embedding some clear colors directly in the DCC surface.1546 * DCC supports embedding some clear colors directly in the DCC surface.
1548 * However, on older GPUs the rendering HW ignores the embedded clear color1547 * 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