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
Unified · Split
| @@ -1808,6 +1808,7 @@ static int amdgpu_discovery_set_common_ip_blocks(struct amdgpu_device *adev) · 1807 unmodified lines | ||
| 1808 | 1808 | case IP_VERSION(11, 0, 4): |
| 1809 | 1809 | case IP_VERSION(11, 5, 0): |
| 1810 | 1810 | case IP_VERSION(11, 5, 1): |
| 1811 | + case IP_VERSION(11, 5, 2): | |
| 1811 | 1812 | amdgpu_device_ip_block_add(adev, &soc21_common_ip_block); |
| 1812 | 1813 | break; |
| 1813 | 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 | 1862 | case IP_VERSION(11, 0, 4): |
| 1862 | 1863 | case IP_VERSION(11, 5, 0): |
| 1863 | 1864 | case IP_VERSION(11, 5, 1): |
| 1865 | + case IP_VERSION(11, 5, 2): | |
| 1864 | 1866 | amdgpu_device_ip_block_add(adev, &gmc_v11_0_ip_block); |
| 1865 | 1867 | break; |
| 1866 | 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 | 1964 | case IP_VERSION(13, 0, 14): |
| 1963 | 1965 | case IP_VERSION(14, 0, 0): |
| 1964 | 1966 | case IP_VERSION(14, 0, 1): |
| 1967 | + case IP_VERSION(14, 0, 4): | |
| 1965 | 1968 | amdgpu_device_ip_block_add(adev, &psp_v13_0_ip_block); |
| 1966 | 1969 | break; |
| 1967 | 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 | 2028 | case IP_VERSION(14, 0, 1): |
| 2026 | 2029 | case IP_VERSION(14, 0, 2): |
| 2027 | 2030 | case IP_VERSION(14, 0, 3): |
| 2031 | + case IP_VERSION(14, 0, 4): | |
| 2028 | 2032 | amdgpu_device_ip_block_add(adev, &smu_v14_0_ip_block); |
| 2029 | 2033 | break; |
| 2030 | 2034 | default: |
| @@ -2152,6 +2156,7 @@ static int amdgpu_discovery_set_gc_ip_blocks(struct amdgpu_device *adev) · 121 unmodified lines | ||
| 2152 | 2156 | case IP_VERSION(11, 0, 4): |
| 2153 | 2157 | case IP_VERSION(11, 5, 0): |
| 2154 | 2158 | case IP_VERSION(11, 5, 1): |
| 2159 | + case IP_VERSION(11, 5, 2): | |
| 2155 | 2160 | amdgpu_device_ip_block_add(adev, &gfx_v11_0_ip_block); |
| 2156 | 2161 | break; |
| 2157 | 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 | 2212 | case IP_VERSION(6, 0, 3): |
| 2208 | 2213 | case IP_VERSION(6, 1, 0): |
| 2209 | 2214 | case IP_VERSION(6, 1, 1): |
| 2215 | + case IP_VERSION(6, 1, 2): | |
| 2210 | 2216 | amdgpu_device_ip_block_add(adev, &sdma_v6_0_ip_block); |
| 2211 | 2217 | break; |
| 2212 | 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 | 2331 | case IP_VERSION(11, 0, 4): |
| 2326 | 2332 | case IP_VERSION(11, 5, 0): |
| 2327 | 2333 | case IP_VERSION(11, 5, 1): |
| 2334 | + case IP_VERSION(11, 5, 2): | |
| 2328 | 2335 | amdgpu_device_ip_block_add(adev, &mes_v11_0_ip_block); |
| 2329 | 2336 | adev->enable_mes = true; |
| 2330 | 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 | 2367 | switch (amdgpu_ip_version(adev, VPE_HWIP, 0)) { |
| 2361 | 2368 | case IP_VERSION(6, 1, 0): |
| 2362 | 2369 | case IP_VERSION(6, 1, 1): |
| 2370 | + case IP_VERSION(6, 1, 3): | |
| 2363 | 2371 | amdgpu_device_ip_block_add(adev, &vpe_v6_1_ip_block); |
| 2364 | 2372 | break; |
| 2365 | 2373 | default: |
| @@ -2634,6 +2642,7 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev) · 268 unmodified lines | ||
| 2634 | 2642 | break; |
| 2635 | 2643 | case IP_VERSION(11, 5, 0): |
| 2636 | 2644 | case IP_VERSION(11, 5, 1): |
| 2645 | + case IP_VERSION(11, 5, 2): | |
| 2637 | 2646 | adev->family = AMDGPU_FAMILY_GC_11_5_0; |
| 2638 | 2647 | break; |
| 2639 | 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 | 2667 | case IP_VERSION(11, 0, 4): |
| 2659 | 2668 | case IP_VERSION(11, 5, 0): |
| 2660 | 2669 | case IP_VERSION(11, 5, 1): |
| 2670 | + case IP_VERSION(11, 5, 2): | |
| 2661 | 2671 | adev->flags |= AMD_IS_APU; |
| 2662 | 2672 | break; |
| 2663 | 2673 | default: |
| @@ -2696,6 +2706,7 @@ int amdgpu_discovery_set_ip_blocks(struct amdgpu_device *adev) · 32 unmodified lines | ||
| 2696 | 2706 | break; |
| 2697 | 2707 | case IP_VERSION(7, 11, 0): |
| 2698 | 2708 | case IP_VERSION(7, 11, 1): |
| 2709 | + case IP_VERSION(7, 11, 3): | |
| 2699 | 2710 | adev->nbio.funcs = &nbio_v7_11_funcs; |
| 2700 | 2711 | adev->nbio.hdp_flush_reg = &nbio_v7_11_hdp_flush_reg; |
| 2701 | 2712 | break; |
| @@ -654,6 +654,10 @@ amdgpu_lookup_format_info(u32 format, uint64_t modifier) · 653 unmodified lines | ||
| 654 | 654 | if (!IS_AMD_FMT_MOD(modifier)) |
| 655 | 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 | 661 | if (AMD_FMT_MOD_GET(DCC_RETILE, modifier)) |
| 658 | 662 | return lookup_format_info(dcc_retile_formats, |
| 659 | 663 | ARRAY_SIZE(dcc_retile_formats), |
| @@ -720,32 +724,25 @@ extract_render_dcc_offset(struct amdgpu_device *adev, · 60 unmodified lines | ||
| 720 | 724 | |
| 721 | 725 | static 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 | 727 | u64 modifier = 0; |
| 726 | − int tile = 0; | |
| 727 | − int swizzle = 0; | |
| 728 | + int swizzle_mode = AMDGPU_TILING_GET(afb->tiling_flags, GFX12_SWIZZLE_MODE); | |
| 728 | 729 | |
| 729 | − if (amdgpu_ip_version(adev, GC_HWIP, 0) >= IP_VERSION(12, 0, 0)) { | |
| 730 | − tile = AMD_FMT_MOD_TILE_VER_GFX12; | |
| 731 | − swizzle = AMDGPU_TILING_GET(afb->tiling_flags, GFX12_SWIZZLE_MODE); | |
| 730 | + if (!swizzle_mode) { | |
| 731 | + modifier = DRM_FORMAT_MOD_LINEAR; | |
| 732 | + } else { | |
| 733 | + int max_comp_block = | |
| 734 | + AMDGPU_TILING_GET(afb->tiling_flags, GFX12_DCC_MAX_COMPRESSED_BLOCK); | |
| 735 | + | |
| 736 | + modifier = | |
| 737 | + AMD_FMT_MOD | | |
| 738 | + AMD_FMT_MOD_SET(TILE_VERSION, AMD_FMT_MOD_TILE_VER_GFX12) | | |
| 739 | + AMD_FMT_MOD_SET(TILE, swizzle_mode) | | |
| 740 | + AMD_FMT_MOD_SET(DCC, afb->gfx12_dcc) | | |
| 741 | + AMD_FMT_MOD_SET(DCC_MAX_COMPRESSED_BLOCK, max_comp_block); | |
| 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 | 744 | afb->base.modifier = modifier; |
| 747 | 745 | afb->base.flags |= DRM_MODE_FB_MODIFIERS; |
| 748 | − | |
| 749 | 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 | 770 | int pipes = ilog2(num_pipes); |
| 774 | 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 | 773 | switch (swizzle >> 2) { |
| 783 | 774 | case 0: /* 256B */ |
| 784 | 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 | 946 | u64 micro_tile_mode; |
| 956 | 947 | |
| 957 | − /* Zero swizzle mode means linear */ | |
| 958 | − if (AMDGPU_TILING_GET(afb->tiling_flags, SWIZZLE_MODE) == 0) | |
| 948 | + if (AMDGPU_TILING_GET(afb->tiling_flags, ARRAY_MODE) == 1) /* LINEAR_ALIGNED */ | |
| 959 | 949 | return 0; |
| 960 | 950 | |
| 961 | 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 | 1069 | block_width = 256 / format_info->cpp[i]; |
| 1080 | 1070 | block_height = 1; |
| 1081 | 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 | 1096 | } else { |
| 1083 | 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 | 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 | 1133 | if (AMD_FMT_MOD_GET(DCC_RETILE, modifier)) { |
| 1119 | 1134 | block_size_log2 = get_dcc_block_size(modifier, false, false); |
| 1120 | 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 | |
| 1146 | 1161 | static int amdgpu_display_get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb, |
| 1147 | − uint64_t *tiling_flags, bool *tmz_surface) | |
| 1162 | + uint64_t *tiling_flags, bool *tmz_surface, | |
| 1163 | + bool *gfx12_dcc) | |
| 1148 | 1164 | { |
| 1149 | 1165 | struct amdgpu_bo *rbo; |
| 1150 | 1166 | int r; |
| @@ -1152,6 +1168,7 @@ static int amdgpu_display_get_fb_info(const struct amdgpu_framebuffer *amdgpu_fb · 1 unmodified line | ||
| 1152 | 1168 | if (!amdgpu_fb) { |
| 1153 | 1169 | *tiling_flags = 0; |
| 1154 | 1170 | *tmz_surface = false; |
| 1171 | + *gfx12_dcc = false; | |
| 1155 | 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 | 1182 | return r; |
| 1166 | 1183 | } |
| 1167 | 1184 | |
| 1168 | − if (tiling_flags) | |
| 1169 | − amdgpu_bo_get_tiling_flags(rbo, tiling_flags); | |
| 1170 | − | |
| 1171 | − if (tmz_surface) | |
| 1172 | − *tmz_surface = amdgpu_bo_encrypted(rbo); | |
| 1185 | + amdgpu_bo_get_tiling_flags(rbo, tiling_flags); | |
| 1186 | + *tmz_surface = amdgpu_bo_encrypted(rbo); | |
| 1187 | + *gfx12_dcc = rbo->flags & AMDGPU_GEM_CREATE_GFX12_DCC; | |
| 1173 | 1188 | |
| 1174 | 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 | 1258 | if (ret) |
| 1243 | 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 | 1269 | if (!dev->mode_config.fb_modifiers_not_supported && |
| 1254 | 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 | 1276 | if (ret) { |
| 1257 | 1277 | drm_dbg_kms(dev, "Failed to convert tiling flags 0x%llX to a modifier", |
| 1258 | 1278 | rfb->tiling_flags); |
| @@ -848,6 +848,7 @@ void amdgpu_gmc_tmz_set(struct amdgpu_device *adev) · 847 unmodified lines | ||
| 848 | 848 | case IP_VERSION(11, 0, 4): |
| 849 | 849 | case IP_VERSION(11, 5, 0): |
| 850 | 850 | case IP_VERSION(11, 5, 1): |
| 851 | + case IP_VERSION(11, 5, 2): | |
| 851 | 852 | /* Don't enable it by default yet. |
| 852 | 853 | */ |
| 853 | 854 | if (amdgpu_tmz < 1) { |
| @@ -300,6 +300,7 @@ struct amdgpu_framebuffer { · 299 unmodified lines | ||
| 300 | 300 | |
| 301 | 301 | uint64_t tiling_flags; |
| 302 | 302 | bool tmz_surface; |
| 303 | + bool gfx12_dcc; | |
| 303 | 304 | |
| 304 | 305 | /* caching for later use */ |
| 305 | 306 | uint64_t address; |
| @@ -219,6 +219,7 @@ static int psp_early_init(void *handle) · 218 unmodified lines | ||
| 219 | 219 | case IP_VERSION(13, 0, 11): |
| 220 | 220 | case IP_VERSION(14, 0, 0): |
| 221 | 221 | case IP_VERSION(14, 0, 1): |
| 222 | + case IP_VERSION(14, 0, 4): | |
| 222 | 223 | psp_v13_0_set_psp_funcs(psp); |
| 223 | 224 | psp->boot_time_tmr = false; |
| 224 | 225 | break; |
| @@ -4565,7 +4565,7 @@ static void amdgpu_ras_boot_time_error_reporting(struct amdgpu_device *adev, · 4564 unmodified lines | ||
| 4565 | 4565 | |
| 4566 | 4566 | socket_id = AMDGPU_RAS_GPU_ERR_SOCKET_ID(boot_error); |
| 4567 | 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 | 4570 | if (AMDGPU_RAS_GPU_ERR_MEM_TRAINING(boot_error)) |
| 4571 | 4571 | dev_info(adev->dev, |
| @@ -302,6 +302,7 @@ static int vpe_early_init(void *handle) · 301 unmodified lines | ||
| 302 | 302 | |
| 303 | 303 | switch (amdgpu_ip_version(adev, VPE_HWIP, 0)) { |
| 304 | 304 | case IP_VERSION(6, 1, 0): |
| 305 | + case IP_VERSION(6, 1, 3): | |
| 305 | 306 | vpe_v6_1_set_funcs(vpe); |
| 306 | 307 | break; |
| 307 | 308 | case IP_VERSION(6, 1, 1): |
| @@ -9287,6 +9287,7 @@ static void gfx_v10_ip_print(void *handle, struct drm_printer *p) · 9286 unmodified lines | ||
| 9287 | 9287 | if (!adev->gfx.ip_dump_gfx_queues) |
| 9288 | 9288 | return; |
| 9289 | 9289 | |
| 9290 | + index = 0; | |
| 9290 | 9291 | reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_10); |
| 9291 | 9292 | drm_printf(p, "\nnum_me: %d num_pipe: %d num_queue: %d\n", |
| 9292 | 9293 | adev->gfx.me.num_me, |
| @@ -9352,6 +9353,7 @@ static void gfx_v10_ip_dump(void *handle) · 59 unmodified lines | ||
| 9352 | 9353 | if (!adev->gfx.ip_dump_gfx_queues) |
| 9353 | 9354 | return; |
| 9354 | 9355 | |
| 9356 | + index = 0; | |
| 9355 | 9357 | reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_10); |
| 9356 | 9358 | amdgpu_gfx_off_ctrl(adev, false); |
| 9357 | 9359 | mutex_lock(&adev->srbm_mutex); |
| @@ -93,6 +93,10 @@ MODULE_FIRMWARE("amdgpu/gc_11_5_1_pfp.bin"); · 92 unmodified lines | ||
| 93 | 93 | MODULE_FIRMWARE("amdgpu/gc_11_5_1_me.bin"); |
| 94 | 94 | MODULE_FIRMWARE("amdgpu/gc_11_5_1_mec.bin"); |
| 95 | 95 | MODULE_FIRMWARE("amdgpu/gc_11_5_1_rlc.bin"); |
| 96 | +MODULE_FIRMWARE("amdgpu/gc_11_5_2_pfp.bin"); | |
| 97 | +MODULE_FIRMWARE("amdgpu/gc_11_5_2_me.bin"); | |
| 98 | +MODULE_FIRMWARE("amdgpu/gc_11_5_2_mec.bin"); | |
| 99 | +MODULE_FIRMWARE("amdgpu/gc_11_5_2_rlc.bin"); | |
| 96 | 100 | |
| 97 | 101 | static const struct amdgpu_hwip_reg_entry gc_reg_list_11_0[] = { |
| 98 | 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 | 1058 | case IP_VERSION(11, 0, 4): |
| 1055 | 1059 | case IP_VERSION(11, 5, 0): |
| 1056 | 1060 | case IP_VERSION(11, 5, 1): |
| 1061 | + case IP_VERSION(11, 5, 2): | |
| 1057 | 1062 | adev->gfx.config.max_hw_contexts = 8; |
| 1058 | 1063 | adev->gfx.config.sc_prim_fifo_size_frontend = 0x20; |
| 1059 | 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 | 1539 | case IP_VERSION(11, 0, 4): |
| 1535 | 1540 | case IP_VERSION(11, 5, 0): |
| 1536 | 1541 | case IP_VERSION(11, 5, 1): |
| 1542 | + case IP_VERSION(11, 5, 2): | |
| 1537 | 1543 | adev->gfx.me.num_me = 1; |
| 1538 | 1544 | adev->gfx.me.num_pipe_per_me = 1; |
| 1539 | 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 | 2788 | amdgpu_ip_version(adev, GC_HWIP, 0) == |
| 2783 | 2789 | IP_VERSION(11, 0, 4) || |
| 2784 | 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 | 2793 | bootload_status = RREG32_SOC15(GC, 0, |
| 2787 | 2794 | regRLC_RLCS_BOOTLOAD_STATUS_gc_11_0_1); |
| 2788 | 2795 | else |
| @@ -5296,6 +5303,7 @@ static void gfx_v11_cntl_power_gating(struct amdgpu_device *adev, bool enable) · 2507 unmodified lines | ||
| 5296 | 5303 | case IP_VERSION(11, 0, 4): |
| 5297 | 5304 | case IP_VERSION(11, 5, 0): |
| 5298 | 5305 | case IP_VERSION(11, 5, 1): |
| 5306 | + case IP_VERSION(11, 5, 2): | |
| 5299 | 5307 | WREG32_SOC15(GC, 0, regRLC_PG_DELAY_3, RLC_PG_DELAY_3_DEFAULT_GC_11_0_1); |
| 5300 | 5308 | break; |
| 5301 | 5309 | default: |
| @@ -5332,6 +5340,7 @@ static int gfx_v11_0_set_powergating_state(void *handle, · 30 unmodified lines | ||
| 5332 | 5340 | case IP_VERSION(11, 0, 4): |
| 5333 | 5341 | case IP_VERSION(11, 5, 0): |
| 5334 | 5342 | case IP_VERSION(11, 5, 1): |
| 5343 | + case IP_VERSION(11, 5, 2): | |
| 5335 | 5344 | if (!enable) |
| 5336 | 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 | 5373 | case IP_VERSION(11, 0, 4): |
| 5365 | 5374 | case IP_VERSION(11, 5, 0): |
| 5366 | 5375 | case IP_VERSION(11, 5, 1): |
| 5376 | + case IP_VERSION(11, 5, 2): | |
| 5367 | 5377 | gfx_v11_0_update_gfx_clock_gating(adev, |
| 5368 | 5378 | state == AMD_CG_STATE_GATE); |
| 5369 | 5379 | break; |
| @@ -5604,11 +5614,7 @@ static void gfx_v11_0_ring_emit_fence(struct amdgpu_ring *ring, u64 addr, · 234 unmodified lines | ||
| 5604 | 5614 | amdgpu_ring_write(ring, PACKET3(PACKET3_RELEASE_MEM, 6)); |
| 5605 | 5615 | amdgpu_ring_write(ring, (PACKET3_RELEASE_MEM_GCR_SEQ | |
| 5606 | 5616 | PACKET3_RELEASE_MEM_GCR_GL2_WB | |
| 5607 | − PACKET3_RELEASE_MEM_GCR_GL2_INV | | |
| 5608 | − PACKET3_RELEASE_MEM_GCR_GL2_US | | |
| 5609 | − PACKET3_RELEASE_MEM_GCR_GL1_INV | | |
| 5610 | − PACKET3_RELEASE_MEM_GCR_GLV_INV | | |
| 5611 | − PACKET3_RELEASE_MEM_GCR_GLM_INV | | |
| 5617 | + PACKET3_RELEASE_MEM_GCR_GLM_INV | /* must be set with GLM_WB */ | |
| 5612 | 5618 | PACKET3_RELEASE_MEM_GCR_GLM_WB | |
| 5613 | 5619 | PACKET3_RELEASE_MEM_CACHE_POLICY(3) | |
| 5614 | 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 | 6411 | if (!adev->gfx.ip_dump_gfx_queues) |
| 6406 | 6412 | return; |
| 6407 | 6413 | |
| 6414 | + index = 0; | |
| 6408 | 6415 | reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_11); |
| 6409 | 6416 | drm_printf(p, "\nnum_me: %d num_pipe: %d num_queue: %d\n", |
| 6410 | 6417 | adev->gfx.me.num_me, |
| @@ -6469,6 +6476,7 @@ static void gfx_v11_ip_dump(void *handle) · 58 unmodified lines | ||
| 6469 | 6476 | if (!adev->gfx.ip_dump_gfx_queues) |
| 6470 | 6477 | return; |
| 6471 | 6478 | |
| 6479 | + index = 0; | |
| 6472 | 6480 | reg_count = ARRAY_SIZE(gc_gfx_queue_reg_list_11); |
| 6473 | 6481 | amdgpu_gfx_off_ctrl(adev, false); |
| 6474 | 6482 | mutex_lock(&adev->srbm_mutex); |
| @@ -4108,21 +4108,6 @@ static void gfx_v12_0_ring_emit_ib_compute(struct amdgpu_ring *ring, · 4107 unmodified lines | ||
| 4108 | 4108 | /* inherit vmid from mqd */ |
| 4109 | 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 | 4111 | amdgpu_ring_write(ring, PACKET3(PACKET3_INDIRECT_BUFFER, 2)); |
| 4127 | 4112 | BUG_ON(ib->gpu_addr & 0x3); /* Dword align */ |
| 4128 | 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 | 4129 | amdgpu_ring_write(ring, PACKET3(PACKET3_RELEASE_MEM, 6)); |
| 4145 | 4130 | amdgpu_ring_write(ring, (PACKET3_RELEASE_MEM_GCR_SEQ | |
| 4146 | 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 | 4132 | PACKET3_RELEASE_MEM_CACHE_POLICY(3) | |
| 4154 | 4133 | PACKET3_RELEASE_MEM_EVENT_TYPE(CACHE_FLUSH_AND_INV_TS_EVENT) | |
| 4155 | 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 | 4706 | SOC15_FLUSH_GPU_TLB_NUM_REG_WAIT * 7 + |
| 4728 | 4707 | 2 + /* VM_FLUSH */ |
| 4729 | 4708 | 8 + /* FENCE for VM_FLUSH */ |
| 4730 | − 20 + /* GDS switch */ | |
| 4731 | 4709 | 5 + /* COND_EXEC */ |
| 4732 | 4710 | 7 + /* HDP_flush */ |
| 4733 | 4711 | 4 + /* VGT_flush */ |
| @@ -592,6 +592,7 @@ static void gmc_v11_0_set_gfxhub_funcs(struct amdgpu_device *adev) · 591 unmodified lines | ||
| 592 | 592 | break; |
| 593 | 593 | case IP_VERSION(11, 5, 0): |
| 594 | 594 | case IP_VERSION(11, 5, 1): |
| 595 | + case IP_VERSION(11, 5, 2): | |
| 595 | 596 | adev->gfxhub.funcs = &gfxhub_v11_5_0_funcs; |
| 596 | 597 | break; |
| 597 | 598 | default: |
| @@ -754,6 +755,7 @@ static int gmc_v11_0_sw_init(void *handle) · 156 unmodified lines | ||
| 754 | 755 | case IP_VERSION(11, 0, 4): |
| 755 | 756 | case IP_VERSION(11, 5, 0): |
| 756 | 757 | case IP_VERSION(11, 5, 1): |
| 758 | + case IP_VERSION(11, 5, 2): | |
| 757 | 759 | set_bit(AMDGPU_GFXHUB(0), adev->vmhubs_mask); |
| 758 | 760 | set_bit(AMDGPU_MMHUB0(0), adev->vmhubs_mask); |
| 759 | 761 | /* |
| @@ -38,6 +38,7 @@ MODULE_FIRMWARE("amdgpu/gc_11_0_3_imu.bin"); · 37 unmodified lines | ||
| 38 | 38 | MODULE_FIRMWARE("amdgpu/gc_11_0_4_imu.bin"); |
| 39 | 39 | MODULE_FIRMWARE("amdgpu/gc_11_5_0_imu.bin"); |
| 40 | 40 | MODULE_FIRMWARE("amdgpu/gc_11_5_1_imu.bin"); |
| 41 | +MODULE_FIRMWARE("amdgpu/gc_11_5_2_imu.bin"); | |
| 41 | 42 | |
| 42 | 43 | static int imu_v11_0_init_microcode(struct amdgpu_device *adev) |
| 43 | 44 | { |
| @@ -51,6 +51,8 @@ MODULE_FIRMWARE("amdgpu/gc_11_5_0_mes_2.bin"); · 50 unmodified lines | ||
| 51 | 51 | MODULE_FIRMWARE("amdgpu/gc_11_5_0_mes1.bin"); |
| 52 | 52 | MODULE_FIRMWARE("amdgpu/gc_11_5_1_mes_2.bin"); |
| 53 | 53 | MODULE_FIRMWARE("amdgpu/gc_11_5_1_mes1.bin"); |
| 54 | +MODULE_FIRMWARE("amdgpu/gc_11_5_2_mes_2.bin"); | |
| 55 | +MODULE_FIRMWARE("amdgpu/gc_11_5_2_mes1.bin"); | |
| 54 | 56 | |
| 55 | 57 | static int mes_v11_0_hw_init(void *handle); |
| 56 | 58 | static int mes_v11_0_hw_fini(void *handle); |
| @@ -569,7 +569,7 @@ static bool mmhub_v1_8_query_utcl2_poison_status(struct amdgpu_device *adev, · 568 unmodified lines | ||
| 569 | 569 | if (!amdgpu_sriov_vf(adev)) { |
| 570 | 570 | /* clear page fault status and address */ |
| 571 | 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 | 575 | return fed; |
| @@ -57,6 +57,8 @@ MODULE_FIRMWARE("amdgpu/psp_14_0_0_toc.bin"); · 56 unmodified lines | ||
| 57 | 57 | MODULE_FIRMWARE("amdgpu/psp_14_0_0_ta.bin"); |
| 58 | 58 | MODULE_FIRMWARE("amdgpu/psp_14_0_1_toc.bin"); |
| 59 | 59 | MODULE_FIRMWARE("amdgpu/psp_14_0_1_ta.bin"); |
| 60 | +MODULE_FIRMWARE("amdgpu/psp_14_0_4_toc.bin"); | |
| 61 | +MODULE_FIRMWARE("amdgpu/psp_14_0_4_ta.bin"); | |
| 60 | 62 | |
| 61 | 63 | /* For large FW files the time to complete can be very long */ |
| 62 | 64 | #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 | 108 | case IP_VERSION(13, 0, 11): |
| 107 | 109 | case IP_VERSION(14, 0, 0): |
| 108 | 110 | case IP_VERSION(14, 0, 1): |
| 111 | + case IP_VERSION(14, 0, 4): | |
| 109 | 112 | err = psp_init_toc_microcode(psp, ucode_prefix); |
| 110 | 113 | if (err) |
| 111 | 114 | return err; |
| @@ -50,6 +50,7 @@ MODULE_FIRMWARE("amdgpu/sdma_6_0_2.bin"); · 49 unmodified lines | ||
| 50 | 50 | MODULE_FIRMWARE("amdgpu/sdma_6_0_3.bin"); |
| 51 | 51 | MODULE_FIRMWARE("amdgpu/sdma_6_1_0.bin"); |
| 52 | 52 | MODULE_FIRMWARE("amdgpu/sdma_6_1_1.bin"); |
| 53 | +MODULE_FIRMWARE("amdgpu/sdma_6_1_2.bin"); | |
| 53 | 54 | |
| 54 | 55 | #define SDMA1_REG_OFFSET 0x600 |
| 55 | 56 | #define SDMA0_HYP_DEC_REG_START 0x5880 |
| @@ -389,6 +389,7 @@ soc21_asic_reset_method(struct amdgpu_device *adev) · 388 unmodified lines | ||
| 389 | 389 | case IP_VERSION(13, 0, 11): |
| 390 | 390 | case IP_VERSION(14, 0, 0): |
| 391 | 391 | case IP_VERSION(14, 0, 1): |
| 392 | + case IP_VERSION(14, 0, 4): | |
| 392 | 393 | return AMD_RESET_METHOD_MODE2; |
| 393 | 394 | default: |
| 394 | 395 | if (amdgpu_dpm_is_baco_supported(adev)) |
| @@ -752,6 +753,32 @@ static int soc21_common_early_init(void *handle) · 357 unmodified lines | ||
| 752 | 753 | AMD_PG_SUPPORT_JPEG; |
| 753 | 754 | adev->external_rev_id = adev->rev_id + 0xc1; |
| 754 | 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 | 782 | default: |
| 756 | 783 | /* FIXME: not supported yet */ |
| 757 | 784 | return -EINVAL; |
| @@ -927,6 +954,7 @@ static int soc21_common_set_clockgating_state(void *handle, · 169 unmodified lines | ||
| 927 | 954 | case IP_VERSION(7, 7, 1): |
| 928 | 955 | case IP_VERSION(7, 11, 0): |
| 929 | 956 | case IP_VERSION(7, 11, 1): |
| 957 | + case IP_VERSION(7, 11, 3): | |
| 930 | 958 | adev->nbio.funcs->update_medium_grain_clock_gating(adev, |
| 931 | 959 | state == AMD_CG_STATE_GATE); |
| 932 | 960 | adev->nbio.funcs->update_medium_grain_light_sleep(adev, |
| @@ -34,6 +34,7 @@ · 33 unmodified lines | ||
| 34 | 34 | |
| 35 | 35 | MODULE_FIRMWARE("amdgpu/vpe_6_1_0.bin"); |
| 36 | 36 | MODULE_FIRMWARE("amdgpu/vpe_6_1_1.bin"); |
| 37 | +MODULE_FIRMWARE("amdgpu/vpe_6_1_3.bin"); | |
| 37 | 38 | |
| 38 | 39 | #define VPE_THREAD1_UCODE_OFFSET 0x8000 |
| 39 | 40 | |
| @@ -1678,6 +1678,7 @@ int kfd_get_gpu_cache_info(struct kfd_node *kdev, struct kfd_gpu_cache_info **pc · 1677 unmodified lines | ||
| 1678 | 1678 | case IP_VERSION(11, 0, 4): |
| 1679 | 1679 | case IP_VERSION(11, 5, 0): |
| 1680 | 1680 | case IP_VERSION(11, 5, 1): |
| 1681 | + case IP_VERSION(11, 5, 2): | |
| 1681 | 1682 | case IP_VERSION(12, 0, 0): |
| 1682 | 1683 | case IP_VERSION(12, 0, 1): |
| 1683 | 1684 | num_of_cache_types = |
| @@ -99,6 +99,7 @@ static void kfd_device_info_set_sdma_info(struct kfd_dev *kfd) · 98 unmodified lines | ||
| 99 | 99 | case IP_VERSION(6, 0, 3): |
| 100 | 100 | case IP_VERSION(6, 1, 0): |
| 101 | 101 | case IP_VERSION(6, 1, 1): |
| 102 | + case IP_VERSION(6, 1, 2): | |
| 102 | 103 | case IP_VERSION(7, 0, 0): |
| 103 | 104 | case IP_VERSION(7, 0, 1): |
| 104 | 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 | 120 | case IP_VERSION(6, 0, 3): |
| 120 | 121 | case IP_VERSION(6, 1, 0): |
| 121 | 122 | case IP_VERSION(6, 1, 1): |
| 123 | + case IP_VERSION(6, 1, 2): | |
| 122 | 124 | case IP_VERSION(7, 0, 0): |
| 123 | 125 | case IP_VERSION(7, 0, 1): |
| 124 | 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 | 177 | case IP_VERSION(11, 0, 4): |
| 176 | 178 | case IP_VERSION(11, 5, 0): |
| 177 | 179 | case IP_VERSION(11, 5, 1): |
| 180 | + case IP_VERSION(11, 5, 2): | |
| 178 | 181 | kfd->device_info.event_interrupt_class = &event_interrupt_class_v11; |
| 179 | 182 | break; |
| 180 | 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 | 441 | gfx_target_version = 110501; |
| 439 | 442 | f2g = &gfx_v11_kfd2kgd; |
| 440 | 443 | break; |
| 444 | + case IP_VERSION(11, 5, 2): | |
| 445 | + gfx_target_version = 110502; | |
| 446 | + f2g = &gfx_v11_kfd2kgd; | |
| 447 | + break; | |
| 441 | 448 | case IP_VERSION(12, 0, 0): |
| 442 | 449 | gfx_target_version = 120000; |
| 443 | 450 | f2g = &gfx_v12_kfd2kgd; |
| @@ -380,7 +380,8 @@ int kfd_init_apertures(struct kfd_process *process) · 379 unmodified lines | ||
| 380 | 380 | |
| 381 | 381 | pdd = kfd_create_process_device_data(dev, process); |
| 382 | 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 | 385 | return -ENOMEM; |
| 385 | 386 | } |
| 386 | 387 | /* |
| @@ -69,7 +69,7 @@ static bool kq_initialize(struct kernel_queue *kq, struct kfd_node *dev, · 68 unmodified lines | ||
| 69 | 69 | kq->mqd_mgr = dev->dqm->mqd_mgrs[KFD_MQD_TYPE_HIQ]; |
| 70 | 70 | break; |
| 71 | 71 | default: |
| 72 | − pr_err("Invalid queue type %d\n", type); | |
| 72 | + dev_err(dev->adev->dev, "Invalid queue type %d\n", type); | |
| 73 | 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 | 79 | prop.doorbell_ptr = kfd_get_kernel_doorbell(dev->kfd, &prop.doorbell_off); |
| 80 | 80 | |
| 81 | 81 | if (!prop.doorbell_ptr) { |
| 82 | − pr_err("Failed to initialize doorbell"); | |
| 82 | + dev_err(dev->adev->dev, "Failed to initialize doorbell"); | |
| 83 | 83 | goto err_get_kernel_doorbell; |
| 84 | 84 | } |
| 85 | 85 | |
| 86 | 86 | retval = kfd_gtt_sa_allocate(dev, queue_size, &kq->pq); |
| 87 | 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 | 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 | 342 | if (kq_initialize(kq, dev, type, KFD_KERNEL_QUEUE_SIZE)) |
| 342 | 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 | 347 | kfree(kq); |
| 347 | 348 | return NULL; |
| @@ -360,26 +361,26 @@ static __attribute__((unused)) void test_kq(struct kfd_node *dev) · 12 unmodified lines | ||
| 360 | 361 | uint32_t *buffer, i; |
| 361 | 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 | 366 | kq = kernel_queue_init(dev, KFD_QUEUE_TYPE_HIQ); |
| 366 | 367 | if (unlikely(!kq)) { |
| 367 | − pr_err(" Failed to initialize HIQ\n"); | |
| 368 | − pr_err("Kernel queue test failed\n"); | |
| 368 | + dev_err(dev->adev->dev, " Failed to initialize HIQ\n"); | |
| 369 | + dev_err(dev->adev->dev, "Kernel queue test failed\n"); | |
| 369 | 370 | return; |
| 370 | 371 | } |
| 371 | 372 | |
| 372 | 373 | retval = kq_acquire_packet_buffer(kq, 5, &buffer); |
| 373 | 374 | if (unlikely(retval != 0)) { |
| 374 | − pr_err(" Failed to acquire packet buffer\n"); | |
| 375 | − pr_err("Kernel queue test failed\n"); | |
| 375 | + dev_err(dev->adev->dev, " Failed to acquire packet buffer\n"); | |
| 376 | + dev_err(dev->adev->dev, "Kernel queue test failed\n"); | |
| 376 | 377 | return; |
| 377 | 378 | } |
| 378 | 379 | for (i = 0; i < 5; i++) |
| 379 | 380 | buffer[i] = kq->nop_packet; |
| 380 | 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 | |
| @@ -118,12 +118,14 @@ void mqd_symmetrically_map_cu_mask(struct mqd_manager *mm, · 117 unmodified lines | ||
| 118 | 118 | * attention grabbing. |
| 119 | 119 | */ |
| 120 | 120 | if (gfx_info->max_shader_engines > KFD_MAX_NUM_SE) { |
| 121 | − pr_err("Exceeded KFD_MAX_NUM_SE, chip reports %d\n", | |
| 122 | − gfx_info->max_shader_engines); | |
| 121 | + dev_err(mm->dev->adev->dev, | |
| 122 | + "Exceeded KFD_MAX_NUM_SE, chip reports %d\n", | |
| 123 | + gfx_info->max_shader_engines); | |
| 123 | 124 | return; |
| 124 | 125 | } |
| 125 | 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 | 129 | gfx_info->max_sh_per_se * gfx_info->max_shader_engines); |
| 128 | 130 | return; |
| 129 | 131 | } |
| @@ -45,7 +45,8 @@ static void pm_calc_rlib_size(struct packet_manager *pm, · 44 unmodified lines | ||
| 45 | 45 | unsigned int process_count, queue_count, compute_queue_count, gws_queue_count; |
| 46 | 46 | unsigned int map_queue_size; |
| 47 | 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 | 51 | process_count = pm->dqm->processes_count; |
| 51 | 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 | 61 | *over_subscription = false; |
| 61 | 62 | |
| 62 | − if (dev->max_proc_per_quantum > 1) | |
| 63 | − max_proc_per_quantum = dev->max_proc_per_quantum; | |
| 63 | + if (node->max_proc_per_quantum > 1) | |
| 64 | + max_proc_per_quantum = node->max_proc_per_quantum; | |
| 64 | 65 | |
| 65 | 66 | if ((process_count > max_proc_per_quantum) || |
| 66 | 67 | compute_queue_count > get_cp_queues_num(pm->dqm) || |
| 67 | 68 | gws_queue_count > 1) { |
| 68 | 69 | *over_subscription = true; |
| 69 | − pr_debug("Over subscribed runlist\n"); | |
| 70 | + dev_dbg(dev, "Over subscribed runlist\n"); | |
| 70 | 71 | } |
| 71 | 72 | |
| 72 | 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 | 82 | if (*over_subscription) |
| 82 | 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 | |
| 87 | 88 | static int pm_allocate_runlist_ib(struct packet_manager *pm, |
| @@ -90,6 +91,8 @@ static int pm_allocate_runlist_ib(struct packet_manager *pm, · 2 unmodified lines | ||
| 90 | 91 | unsigned int *rl_buffer_size, |
| 91 | 92 | bool *is_over_subscription) |
| 92 | 93 | { |
| 94 | + struct kfd_node *node = pm->dqm->dev; | |
| 95 | + struct device *dev = node->adev->dev; | |
| 93 | 96 | int retval; |
| 94 | 97 | |
| 95 | 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 | 103 | mutex_lock(&pm->lock); |
| 101 | 104 | |
| 102 | − retval = kfd_gtt_sa_allocate(pm->dqm->dev, *rl_buffer_size, | |
| 103 | − &pm->ib_buffer_obj); | |
| 105 | + retval = kfd_gtt_sa_allocate(node, *rl_buffer_size, &pm->ib_buffer_obj); | |
| 104 | 106 | |
| 105 | 107 | if (retval) { |
| 106 | − pr_err("Failed to allocate runlist IB\n"); | |
| 108 | + dev_err(dev, "Failed to allocate runlist IB\n"); | |
| 107 | 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 | 128 | unsigned int alloc_size_bytes; |
| 127 | 129 | unsigned int *rl_buffer, rl_wptr, i; |
| 130 | + struct kfd_node *node = pm->dqm->dev; | |
| 131 | + struct device *dev = node->adev->dev; | |
| 128 | 132 | int retval, processes_mapped; |
| 129 | 133 | struct device_process_node *cur; |
| 130 | 134 | struct qcm_process_device *qpd; |
| @@ -142,7 +146,7 @@ static int pm_create_runlist_ib(struct packet_manager *pm, · 11 unmodified lines | ||
| 142 | 146 | *rl_size_bytes = alloc_size_bytes; |
| 143 | 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 | 150 | pm->dqm->processes_count, pm->dqm->active_queue_count); |
| 147 | 151 | |
| 148 | 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 | 154 | qpd = cur->qpd; |
| 151 | 155 | /* build map process packet */ |
| 152 | 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 | 158 | pm_release_ib(pm); |
| 155 | 159 | return -ENOMEM; |
| 156 | 160 | } |
| @@ -167,7 +171,8 @@ static int pm_create_runlist_ib(struct packet_manager *pm, · 10 unmodified lines | ||
| 167 | 171 | if (!kq->queue->properties.is_active) |
| 168 | 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 | 176 | kq->queue->queue, qpd->is_debug); |
| 172 | 177 | |
| 173 | 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 | 191 | if (!q->properties.is_active) |
| 187 | 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 | 196 | q->queue, qpd->is_debug); |
| 191 | 197 | |
| 192 | 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 | 214 | if (is_over_subscription) { |
| 209 | 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 | 219 | retval = pm->pmf->runlist(pm, &rl_buffer[rl_wptr], |
| 212 | 220 | *rl_gpu_addr, |
| 213 | 221 | alloc_size_bytes / sizeof(uint32_t), |
| @@ -273,6 +281,8 @@ void pm_uninit(struct packet_manager *pm) · 59 unmodified lines | ||
| 273 | 281 | int pm_send_set_resources(struct packet_manager *pm, |
| 274 | 282 | struct scheduling_resources *res) |
| 275 | 283 | { |
| 284 | + struct kfd_node *node = pm->dqm->dev; | |
| 285 | + struct device *dev = node->adev->dev; | |
| 276 | 286 | uint32_t *buffer, size; |
| 277 | 287 | int retval = 0; |
| 278 | 288 | |
| @@ -282,7 +292,7 @@ int pm_send_set_resources(struct packet_manager *pm, · 3 unmodified lines | ||
| 282 | 292 | size / sizeof(uint32_t), |
| 283 | 293 | (unsigned int **)&buffer); |
| 284 | 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 | 296 | retval = -ENOMEM; |
| 287 | 297 | goto out; |
| 288 | 298 | } |
| @@ -344,6 +354,8 @@ fail_create_runlist_ib: · 55 unmodified lines | ||
| 344 | 354 | int pm_send_query_status(struct packet_manager *pm, uint64_t fence_address, |
| 345 | 355 | uint64_t fence_value) |
| 346 | 356 | { |
| 357 | + struct kfd_node *node = pm->dqm->dev; | |
| 358 | + struct device *dev = node->adev->dev; | |
| 347 | 359 | uint32_t *buffer, size; |
| 348 | 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 | 367 | kq_acquire_packet_buffer(pm->priv_queue, |
| 356 | 368 | size / sizeof(uint32_t), (unsigned int **)&buffer); |
| 357 | 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 | 371 | retval = -ENOMEM; |
| 360 | 372 | goto out; |
| 361 | 373 | } |
| @@ -373,6 +385,8 @@ out: · 11 unmodified lines | ||
| 373 | 385 | |
| 374 | 386 | int 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 | 390 | int retval = 0; |
| 377 | 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 | 400 | (unsigned int **)&buffer); |
| 387 | 401 | |
| 388 | 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 | 405 | retval = -ENOMEM; |
| 391 | 406 | goto out; |
| 392 | 407 | } |
| @@ -407,6 +422,8 @@ int pm_send_unmap_queue(struct packet_manager *pm, · 14 unmodified lines | ||
| 407 | 422 | enum kfd_unmap_queues_filter filter, |
| 408 | 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 | 427 | uint32_t *buffer, size; |
| 411 | 428 | int retval = 0; |
| 412 | 429 | |
| @@ -415,7 +432,7 @@ int pm_send_unmap_queue(struct packet_manager *pm, · 2 unmodified lines | ||
| 415 | 432 | kq_acquire_packet_buffer(pm->priv_queue, |
| 416 | 433 | size / sizeof(uint32_t), (unsigned int **)&buffer); |
| 417 | 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 | 436 | retval = -ENOMEM; |
| 420 | 437 | goto out; |
| 421 | 438 | } |
| @@ -464,6 +481,8 @@ out: · 42 unmodified lines | ||
| 464 | 481 | |
| 465 | 482 | int 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 | 486 | uint32_t *buffer, size; |
| 468 | 487 | int r = 0; |
| 469 | 488 | |
| @@ -475,16 +494,16 @@ int pm_debugfs_hang_hws(struct packet_manager *pm) · 5 unmodified lines | ||
| 475 | 494 | kq_acquire_packet_buffer(pm->priv_queue, |
| 476 | 495 | size / sizeof(uint32_t), (unsigned int **)&buffer); |
| 477 | 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 | 498 | r = -ENOMEM; |
| 480 | 499 | goto out; |
| 481 | 500 | } |
| 482 | 501 | memset(buffer, 0x55, size); |
| 483 | 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.", | |
| 486 | − buffer[0], buffer[1], buffer[2], buffer[3], | |
| 487 | − buffer[4], buffer[5], buffer[6]); | |
| 504 | + dev_info(dev, "Submitting %x %x %x %x %x %x %x to HIQ to hang the HWS.", | |
| 505 | + buffer[0], buffer[1], buffer[2], buffer[3], buffer[4], | |
| 506 | + buffer[5], buffer[6]); | |
| 488 | 507 | out: |
| 489 | 508 | mutex_unlock(&pm->lock); |
| 490 | 509 | return r; |
| @@ -1311,7 +1311,8 @@ int kfd_process_init_cwsr_apu(struct kfd_process *p, struct file *filep) · 1310 unmodified lines | ||
| 1311 | 1311 | if (IS_ERR_VALUE(qpd->tba_addr)) { |
| 1312 | 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 | 1316 | qpd->tba_addr = 0; |
| 1316 | 1317 | qpd->cwsr_kaddr = NULL; |
| 1317 | 1318 | return err; |
| @@ -1611,7 +1612,8 @@ struct kfd_process_device *kfd_create_process_device_data(struct kfd_node *dev, · 293 unmodified lines | ||
| 1611 | 1612 | &pdd->proc_ctx_cpu_ptr, |
| 1612 | 1613 | false); |
| 1613 | 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 | 1617 | goto err_free_pdd; |
| 1616 | 1618 | } |
| 1617 | 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 | 1678 | &p->kgd_process_info, |
| 1677 | 1679 | &ef); |
| 1678 | 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 | 1682 | return ret; |
| 1681 | 1683 | } |
| 1682 | 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 | 1726 | pdd = kfd_get_process_device_data(dev, p); |
| 1725 | 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 | 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 | 1836 | for (i = 0; i < p->n_pdds; i++) { |
| 1835 | 1837 | struct kfd_process_device *pdd = p->pdds[i]; |
| 1838 | + struct device *dev = pdd->dev->adev->dev; | |
| 1836 | 1839 | |
| 1837 | 1840 | kfd_smi_event_queue_eviction(pdd->dev, p->lead_thread->pid, |
| 1838 | 1841 | trigger); |
| @@ -1844,7 +1847,7 @@ int kfd_process_evict_queues(struct kfd_process *p, uint32_t trigger) · 5 unmodified lines | ||
| 1844 | 1847 | * them been add back since they actually not be saved right now. |
| 1845 | 1848 | */ |
| 1846 | 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 | 1851 | goto fail; |
| 1849 | 1852 | } |
| 1850 | 1853 | n_evicted++; |
| @@ -1866,7 +1869,8 @@ fail: · 15 unmodified lines | ||
| 1866 | 1869 | |
| 1867 | 1870 | if (pdd->dev->dqm->ops.restore_process_queues(pdd->dev->dqm, |
| 1868 | 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 | 1875 | n_evicted--; |
| 1872 | 1876 | } |
| @@ -1882,13 +1886,14 @@ int kfd_process_restore_queues(struct kfd_process *p) · 9 unmodified lines | ||
| 1882 | 1886 | |
| 1883 | 1887 | for (i = 0; i < p->n_pdds; i++) { |
| 1884 | 1888 | struct kfd_process_device *pdd = p->pdds[i]; |
| 1889 | + struct device *dev = pdd->dev->adev->dev; | |
| 1885 | 1890 | |
| 1886 | 1891 | kfd_smi_event_queue_restore(pdd->dev, p->lead_thread->pid); |
| 1887 | 1892 | |
| 1888 | 1893 | r = pdd->dev->dqm->ops.restore_process_queues(pdd->dev->dqm, |
| 1889 | 1894 | &pdd->qpd); |
| 1890 | 1895 | if (r) { |
| 1891 | − pr_err("Failed to restore process queues\n"); | |
| 1896 | + dev_err(dev, "Failed to restore process queues\n"); | |
| 1892 | 1897 | if (!ret) |
| 1893 | 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 | 2070 | struct qcm_process_device *qpd; |
| 2066 | 2071 | |
| 2067 | 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 | 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 | 2082 | qpd->cwsr_kaddr = (void *)__get_free_pages(GFP_KERNEL | __GFP_ZERO, |
| 2078 | 2083 | get_order(KFD_CWSR_TBA_TMA_SIZE)); |
| 2079 | 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 | 2087 | return -ENOMEM; |
| 2082 | 2088 | } |
| 2083 | 2089 | |
| @@ -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 | 7565 | continue; |
| 7566 | 7566 | |
| 7567 | 7567 | slot_num = DIV_ROUND_UP(pbn, pbn_div); |
| @@ -10462,6 +10462,7 @@ skip_modeset: · 2894 unmodified lines | ||
| 10462 | 10462 | } |
| 10463 | 10463 | |
| 10464 | 10464 | /* Update Freesync settings. */ |
| 10465 | + reset_freesync_config_for_crtc(dm_new_crtc_state); | |
| 10465 | 10466 | get_freesync_config_for_crtc(dm_new_crtc_state, |
| 10466 | 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 | 10667 | * check tiling flags when the FB doesn't have a modifier. |
| 10667 | 10668 | */ |
| 10668 | 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 | 10675 | linear = AMDGPU_TILING_GET(afb->tiling_flags, ARRAY_MODE) != DC_ARRAY_2D_TILED_THIN1 && |
| 10671 | 10676 | AMDGPU_TILING_GET(afb->tiling_flags, ARRAY_MODE) != DC_ARRAY_1D_TILED_THIN1 && |
| 10672 | 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 | 10679 | if (!linear) { |
| 10677 | 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 | 11866 | return ret; |
| 11864 | 11867 | } |
| 11865 | 11868 | |
| 11869 | +static void parse_edid_displayid_vrr(struct drm_connector *connector, | |
| 11870 | + struct edid *edid) | |
| 11871 | +{ | |
| 11872 | + u8 *edid_ext = NULL; | |
| 11873 | + int i; | |
| 11874 | + int j = 0; | |
| 11875 | + u16 min_vfreq; | |
| 11876 | + u16 max_vfreq; | |
| 11877 | + | |
| 11878 | + if (edid == NULL || edid->extensions == 0) | |
| 11879 | + return; | |
| 11880 | + | |
| 11881 | + /* Find DisplayID extension */ | |
| 11882 | + for (i = 0; i < edid->extensions; i++) { | |
| 11883 | + edid_ext = (void *)(edid + (i + 1)); | |
| 11884 | + if (edid_ext[0] == DISPLAYID_EXT) | |
| 11885 | + break; | |
| 11886 | + } | |
| 11887 | + | |
| 11888 | + if (edid_ext == NULL) | |
| 11889 | + return; | |
| 11890 | + | |
| 11891 | + while (j < EDID_LENGTH) { | |
| 11892 | + /* Get dynamic video timing range from DisplayID if available */ | |
| 11893 | + if (EDID_LENGTH - j > 13 && edid_ext[j] == 0x25 && | |
| 11894 | + (edid_ext[j+1] & 0xFE) == 0 && (edid_ext[j+2] == 9)) { | |
| 11895 | + min_vfreq = edid_ext[j+9]; | |
| 11896 | + if (edid_ext[j+1] & 7) | |
| 11897 | + max_vfreq = edid_ext[j+10] + ((edid_ext[j+11] & 3) << 8); | |
| 11898 | + else | |
| 11899 | + max_vfreq = edid_ext[j+10]; | |
| 11900 | + | |
| 11901 | + if (max_vfreq && min_vfreq) { | |
| 11902 | + connector->display_info.monitor_range.max_vfreq = max_vfreq; | |
| 11903 | + connector->display_info.monitor_range.min_vfreq = min_vfreq; | |
| 11904 | + | |
| 11905 | + return; | |
| 11906 | + } | |
| 11907 | + } | |
| 11908 | + j++; | |
| 11909 | + } | |
| 11910 | +} | |
| 11911 | + | |
| 11866 | 11912 | static int parse_amd_vsdb(struct amdgpu_dm_connector *aconnector, |
| 11867 | 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 | 12029 | if (!adev->dm.freesync_module) |
| 11984 | 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 | 12037 | if (edid && (sink->sink_signal == SIGNAL_TYPE_DISPLAY_PORT || |
| 11987 | 12038 | sink->sink_signal == SIGNAL_TYPE_EDP)) { |
| 11988 | 12039 | bool edid_check_required = false; |
| @@ -11990,9 +12041,11 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, · 1 unmodified line | ||
| 11990 | 12041 | if (is_dp_capable_without_timing_msa(adev->dm.dc, |
| 11991 | 12042 | amdgpu_dm_connector)) { |
| 11992 | 12043 | if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) { |
| 11993 | − freesync_capable = true; | |
| 11994 | 12044 | amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq; |
| 11995 | 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 | 12049 | } else { |
| 11997 | 12050 | edid_check_required = edid->version > 1 || |
| 11998 | 12051 | (edid->version == 1 && |
| @@ -575,10 +575,8 @@ bool dm_helpers_dp_write_dpcd( · 574 unmodified lines | ||
| 575 | 575 | { |
| 576 | 576 | struct amdgpu_dm_connector *aconnector = link->priv; |
| 577 | 577 | |
| 578 | − if (!aconnector) { | |
| 579 | − DRM_ERROR("Failed to find connector for link!"); | |
| 578 | + if (!aconnector) | |
| 580 | 579 | return false; |
| 581 | − } | |
| 582 | 580 | |
| 583 | 581 | return drm_dp_dpcd_write(&aconnector->dm_dp_aux.aux, |
| 584 | 582 | address, (uint8_t *)data, size) > 0; |
| @@ -23,6 +23,7 @@ · 22 unmodified lines | ||
| 23 | 23 | * |
| 24 | 24 | */ |
| 25 | 25 | |
| 26 | +#include <linux/vmalloc.h> | |
| 26 | 27 | #include <drm/display/drm_dp_helper.h> |
| 27 | 28 | #include <drm/display/drm_dp_mst_helper.h> |
| 28 | 29 | #include <drm/drm_atomic.h> |
| @@ -1491,9 +1492,10 @@ int pre_validate_dsc(struct drm_atomic_state *state, · 1462 unmodified lines | ||
| 1491 | 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 | 1496 | if (!local_dc_state) |
| 1496 | 1497 | return -ENOMEM; |
| 1498 | + memcpy(local_dc_state, dm_state->context, sizeof(struct dc_state)); | |
| 1497 | 1499 | |
| 1498 | 1500 | for (i = 0; i < local_dc_state->stream_count; i++) { |
| 1499 | 1501 | struct dc_stream_state *stream = dm_state->context->streams[i]; |
| @@ -1563,7 +1565,7 @@ clean_exit: · 63 unmodified lines | ||
| 1563 | 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 | 1570 | return ret; |
| 1569 | 1571 | } |
| @@ -352,6 +352,46 @@ static int amdgpu_dm_plane_fill_gfx9_plane_attributes_from_modifiers(struct amdg · 351 unmodified lines | ||
| 352 | 352 | return ret; |
| 353 | 353 | } |
| 354 | 354 | |
| 355 | +static int amdgpu_dm_plane_fill_gfx12_plane_attributes_from_modifiers(struct amdgpu_device *adev, | |
| 356 | + const struct amdgpu_framebuffer *afb, | |
| 357 | + const enum surface_pixel_format format, | |
| 358 | + const enum dc_rotation_angle rotation, | |
| 359 | + const struct plane_size *plane_size, | |
| 360 | + union dc_tiling_info *tiling_info, | |
| 361 | + struct dc_plane_dcc_param *dcc, | |
| 362 | + struct dc_plane_address *address, | |
| 363 | + const bool force_disable_dcc) | |
| 364 | +{ | |
| 365 | + const uint64_t modifier = afb->base.modifier; | |
| 366 | + int ret = 0; | |
| 367 | + | |
| 368 | + /* TODO: Most of this function shouldn't be needed on GFX12. */ | |
| 369 | + amdgpu_dm_plane_fill_gfx9_tiling_info_from_device(adev, tiling_info); | |
| 370 | + | |
| 371 | + tiling_info->gfx9.swizzle = amdgpu_dm_plane_modifier_gfx9_swizzle_mode(modifier); | |
| 372 | + | |
| 373 | + if (amdgpu_dm_plane_modifier_has_dcc(modifier) && !force_disable_dcc) { | |
| 374 | + int max_compressed_block = AMD_FMT_MOD_GET(DCC_MAX_COMPRESSED_BLOCK, modifier); | |
| 375 | + | |
| 376 | + dcc->enable = 1; | |
| 377 | + dcc->independent_64b_blks = max_compressed_block == 0; | |
| 378 | + | |
| 379 | + if (max_compressed_block == 0) | |
| 380 | + dcc->dcc_ind_blk = hubp_ind_block_64b; | |
| 381 | + else if (max_compressed_block == 1) | |
| 382 | + dcc->dcc_ind_blk = hubp_ind_block_128b; | |
| 383 | + else | |
| 384 | + dcc->dcc_ind_blk = hubp_ind_block_unconstrained; | |
| 385 | + } | |
| 386 | + | |
| 387 | + /* TODO: This seems wrong because there is no DCC plane on GFX12. */ | |
| 388 | + ret = amdgpu_dm_plane_validate_dcc(adev, format, rotation, tiling_info, dcc, address, plane_size); | |
| 389 | + if (ret) | |
| 390 | + drm_dbg_kms(adev_to_drm(adev), "amdgpu_dm_plane_validate_dcc: returned error: %d\n", ret); | |
| 391 | + | |
| 392 | + return ret; | |
| 393 | +} | |
| 394 | + | |
| 355 | 395 | static void amdgpu_dm_plane_add_gfx10_1_modifiers(const struct amdgpu_device *adev, |
| 356 | 396 | uint64_t **mods, |
| 357 | 397 | uint64_t *size, |
| @@ -648,12 +688,13 @@ static void amdgpu_dm_plane_add_gfx11_modifiers(struct amdgpu_device *adev, · 290 unmodified lines | ||
| 648 | 688 | static void amdgpu_dm_plane_add_gfx12_modifiers(struct amdgpu_device *adev, |
| 649 | 689 | uint64_t **mods, uint64_t *size, uint64_t *capacity) |
| 650 | 690 | { |
| 651 | − uint64_t mod_64K_2D = AMD_FMT_MOD | | |
| 652 | − AMD_FMT_MOD_SET(TILE_VERSION, AMD_FMT_MOD_TILE_VER_GFX12) | | |
| 653 | − AMD_FMT_MOD_SET(TILE, AMD_FMT_MOD_TILE_GFX12_64K_2D); | |
| 691 | + uint64_t ver = AMD_FMT_MOD | AMD_FMT_MOD_SET(TILE_VERSION, AMD_FMT_MOD_TILE_VER_GFX12); | |
| 654 | 692 | |
| 655 | − /* 64K without DCC */ | |
| 656 | − amdgpu_dm_plane_add_modifier(mods, size, capacity, mod_64K_2D); | |
| 693 | + /* Without DCC: */ | |
| 694 | + amdgpu_dm_plane_add_modifier(mods, size, capacity, ver | AMD_FMT_MOD_SET(TILE, AMD_FMT_MOD_TILE_GFX12_256K_2D)); | |
| 695 | + amdgpu_dm_plane_add_modifier(mods, size, capacity, ver | AMD_FMT_MOD_SET(TILE, AMD_FMT_MOD_TILE_GFX12_64K_2D)); | |
| 696 | + amdgpu_dm_plane_add_modifier(mods, size, capacity, ver | AMD_FMT_MOD_SET(TILE, AMD_FMT_MOD_TILE_GFX12_4K_2D)); | |
| 697 | + amdgpu_dm_plane_add_modifier(mods, size, capacity, ver | AMD_FMT_MOD_SET(TILE, AMD_FMT_MOD_TILE_GFX12_256B_2D)); | |
| 657 | 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 | 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 | 888 | ret = amdgpu_dm_plane_fill_gfx9_plane_attributes_from_modifiers(adev, afb, format, |
| 840 | 889 | rotation, plane_size, |
| 841 | 890 | tiling_info, dcc, |
| @@ -1419,8 +1468,6 @@ static bool amdgpu_dm_plane_format_mod_supported(struct drm_plane *plane, · 577 unmodified lines | ||
| 1419 | 1468 | const struct drm_format_info *info = drm_format_info(format); |
| 1420 | 1469 | int i; |
| 1421 | 1470 | |
| 1422 | − enum dm_micro_swizzle microtile = amdgpu_dm_plane_modifier_gfx9_swizzle_mode(modifier) & 3; | |
| 1423 | − | |
| 1424 | 1471 | if (!info) |
| 1425 | 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 | 1489 | if (i == plane->modifier_count) |
| 1443 | 1490 | return false; |
| 1444 | 1491 | |
| 1445 | − /* | |
| 1446 | − * For D swizzle the canonical modifier depends on the bpp, so check | |
| 1447 | − * it here. | |
| 1448 | − */ | |
| 1449 | − if (AMD_FMT_MOD_GET(TILE_VERSION, modifier) == AMD_FMT_MOD_TILE_VER_GFX9 && | |
| 1450 | − adev->family >= AMDGPU_FAMILY_NV) { | |
| 1451 | − if (microtile == MICRO_SWIZZLE_D && info->cpp[0] == 4) | |
| 1452 | − return false; | |
| 1453 | − } | |
| 1454 | − | |
| 1455 | − if (adev->family >= AMDGPU_FAMILY_RV && microtile == MICRO_SWIZZLE_D && | |
| 1456 | − info->cpp[0] < 8) | |
| 1457 | − return false; | |
| 1492 | + /* GFX12 doesn't have these limitations. */ | |
| 1493 | + if (AMD_FMT_MOD_GET(TILE_VERSION, modifier) <= AMD_FMT_MOD_TILE_VER_GFX11) { | |
| 1494 | + enum dm_micro_swizzle microtile = amdgpu_dm_plane_modifier_gfx9_swizzle_mode(modifier) & 3; | |
| 1458 | 1495 | |
| 1459 | − if (amdgpu_dm_plane_modifier_has_dcc(modifier)) { | |
| 1460 | − /* Per radeonsi comments 16/64 bpp are more complicated. */ | |
| 1461 | − if (info->cpp[0] != 4) | |
| 1462 | − return false; | |
| 1463 | − /* We support multi-planar formats, but not when combined with | |
| 1464 | − * additional DCC metadata planes. | |
| 1496 | + /* | |
| 1497 | + * For D swizzle the canonical modifier depends on the bpp, so check | |
| 1498 | + * it here. | |
| 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 | 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 | 1522 | return true; |
| @@ -158,7 +158,7 @@ void amdgpu_dm_psr_enable(struct dc_stream_state *stream) · 157 unmodified lines | ||
| 158 | 158 | DRM_DEBUG_DRIVER("Enabling psr...\n"); |
| 159 | 159 | |
| 160 | 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 | 162 | stream->timing.v_total), |
| 163 | 163 | stream->timing.h_total); |
| 164 | 164 | |
| @@ -1853,7 +1853,7 @@ static void calculate_bandwidth( · 1852 unmodified lines | ||
| 1853 | 1853 | /*compute total time to request one chunk from each active display pipe*/ |
| 1854 | 1854 | for (i = 0; i <= maximum_number_of_surfaces - 1; i++) { |
| 1855 | 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 | 1859 | /*compute total time to request cursor data*/ |
| @@ -131,7 +131,7 @@ int dce_get_dp_ref_freq_khz(struct clk_mgr *clk_mgr_base) · 130 unmodified lines | ||
| 131 | 131 | struct clk_mgr_internal *clk_mgr = TO_CLK_MGR_INTERNAL(clk_mgr_base); |
| 132 | 132 | int dprefclk_wdivider; |
| 133 | 133 | int dprefclk_src_sel; |
| 134 | − int dp_ref_clk_khz = 600000; | |
| 134 | + int dp_ref_clk_khz; | |
| 135 | 135 | int target_div; |
| 136 | 136 | |
| 137 | 137 | /* ASSERT DP Reference Clock source is from DFS*/ |
| @@ -576,7 +576,7 @@ static void dcn32_auto_dpm_test_log( · 575 unmodified lines | ||
| 576 | 576 | p_state_list[i] = curr_pipe_ctx->p_state_type; |
| 577 | 577 | |
| 578 | 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 | 580 | refresh_rate = div_u64(refresh_rate, curr_pipe_ctx->stream->timing.v_total); |
| 581 | 581 | refresh_rate = div_u64(refresh_rate, curr_pipe_ctx->stream->timing.h_total); |
| 582 | 582 | disp_src_refresh_list[i] = refresh_rate; |
| @@ -137,8 +137,8 @@ static void dcn35_disable_otg_wa(struct clk_mgr *clk_mgr_base, struct dc_state * · 136 unmodified lines | ||
| 137 | 137 | if (pipe->stream && (pipe->stream->dpms_off || dc_is_virtual_signal(pipe->stream->signal) || |
| 138 | 138 | !pipe->stream->link_enc)) { |
| 139 | 139 | if (disable) { |
| 140 | − if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->immediate_disable_crtc) | |
| 141 | − pipe->stream_res.tg->funcs->immediate_disable_crtc(pipe->stream_res.tg); | |
| 140 | + if (pipe->stream_res.tg && pipe->stream_res.tg->funcs->disable_crtc) | |
| 141 | + pipe->stream_res.tg->funcs->disable_crtc(pipe->stream_res.tg); | |
| 142 | 142 | |
| 143 | 143 | reset_sync_context_for_pipe(dc, context, i); |
| 144 | 144 | } else { |
| @@ -306,27 +306,29 @@ static void dcn401_update_clocks_update_dtb_dto(struct clk_mgr_internal *clk_mgr · 305 unmodified lines | ||
| 306 | 306 | struct dc_state *context, |
| 307 | 307 | int ref_dtbclk_khz) |
| 308 | 308 | { |
| 309 | − struct dccg *dccg = clk_mgr->dccg; | |
| 310 | − uint32_t tg_mask = 0; | |
| 311 | 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 | |
| @@ -888,21 +888,21 @@ static struct rect calculate_plane_rec_in_timing_active( · 887 unmodified lines | ||
| 888 | 888 | struct rect rec_out = {0}; |
| 889 | 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 | 892 | stream->src.width); |
| 893 | 893 | rec_out.x = stream->dst.x + dc_fixpt_round(temp); |
| 894 | 894 | |
| 895 | 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 | 897 | stream->src.width); |
| 898 | 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 | 901 | stream->src.height); |
| 902 | 902 | rec_out.y = stream->dst.y + dc_fixpt_round(temp); |
| 903 | 903 | |
| 904 | 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 | 906 | stream->src.height); |
| 907 | 907 | rec_out.height = stream->dst.y + dc_fixpt_round(temp) - rec_out.y; |
| 908 | 908 | |
| @@ -975,7 +975,7 @@ static int dc_stream_calculate_flickerless_refresh_rate(struct dc_stream_state * · 974 unmodified lines | ||
| 975 | 975 | } |
| 976 | 976 | |
| 977 | 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 | 979 | else |
| 980 | 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 | 1024 | if (stream->timing.v_total * stream->timing.h_total == 0) |
| 1025 | 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 | 1029 | int safe_refresh_hz = dc_stream_calculate_flickerless_refresh_rate(stream, |
| 1030 | 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 | 1032 | is_gaming, |
| 1033 | 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 | 1037 | if (increase) |
| 1038 | 1038 | return (((int) stream->timing.v_total - safe_refresh_v_total) >= 0) ? (stream->timing.v_total - safe_refresh_v_total) : 0; |
| @@ -55,7 +55,7 @@ struct aux_payload; · 54 unmodified lines | ||
| 55 | 55 | struct set_config_cmd_payload; |
| 56 | 56 | struct dmub_notification; |
| 57 | 57 | |
| 58 | −#define DC_VER "3.2.290" | |
| 58 | +#define DC_VER "3.2.291" | |
| 59 | 59 | |
| 60 | 60 | #define MAX_SURFACES 3 |
| 61 | 61 | #define MAX_PLANES 6 |
| @@ -293,6 +293,8 @@ struct dc_caps { · 231 unmodified lines | ||
| 293 | 293 | bool cursor_not_scaled; |
| 294 | 294 | bool dcmode_power_limits_present; |
| 295 | 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 | |
| 298 | 300 | struct dc_bug_wa { |
| @@ -353,7 +353,7 @@ static uint32_t calculate_required_audio_bw_in_symbols( · 352 unmodified lines | ||
| 353 | 353 | /* DP spec recommends between 1.05 to 1.1 safety margin to prevent sample under-run */ |
| 354 | 354 | struct fixed31_32 audio_sdp_margin = dc_fixpt_from_fraction(110, 100); |
| 355 | 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 | 357 | struct fixed31_32 samples_per_line; |
| 358 | 358 | struct fixed31_32 layouts_per_line; |
| 359 | 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 | 455 | available_hblank_bw -= crtc_info->dsc_num_slices * 4; /* EOC overhead */ |
| 456 | 456 | |
| 457 | 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 | 461 | if (available_hblank_bw < 12) |
| 461 | 462 | available_hblank_bw = 0; |
| @@ -217,7 +217,7 @@ static bool calc_fb_divider_checking_tolerance( · 216 unmodified lines | ||
| 217 | 217 | actual_calc_clk_100hz = (uint64_t)feedback_divider * |
| 218 | 218 | calc_pll_cs->fract_fb_divider_factor + |
| 219 | 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 | 221 | actual_calc_clk_100hz = |
| 222 | 222 | div_u64(actual_calc_clk_100hz, |
| 223 | 223 | ref_divider * post_divider * |
| @@ -680,7 +680,7 @@ static bool calculate_ss( · 456 unmodified lines | ||
| 680 | 680 | * so have to divided by 100 * 100*/ |
| 681 | 681 | ss_amount = dc_fixpt_mul( |
| 682 | 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 | 684 | ds_data->feedback_amount = dc_fixpt_floor(ss_amount); |
| 685 | 685 | |
| 686 | 686 | ss_nslip_amount = dc_fixpt_sub(ss_amount, |
| @@ -695,8 +695,8 @@ static bool calculate_ss( · 8 unmodified lines | ||
| 695 | 695 | |
| 696 | 696 | /* compute SS_STEP_SIZE_DSFRAC */ |
| 697 | 697 | modulation_time = dc_fixpt_from_fraction( |
| 698 | − pll_settings->reference_freq * 1000, | |
| 699 | − pll_settings->reference_divider * ss_data->modulation_freq_hz); | |
| 698 | + pll_settings->reference_freq * (uint64_t)1000, | |
| 699 | + pll_settings->reference_divider * (uint64_t)ss_data->modulation_freq_hz); | |
| 700 | 700 | |
| 701 | 701 | if (ss_data->flags.CENTER_SPREAD) |
| 702 | 702 | modulation_time = dc_fixpt_div_int(modulation_time, 4); |
| @@ -218,7 +218,7 @@ static void dce_driver_set_backlight(struct panel_cntl *panel_cntl, · 217 unmodified lines | ||
| 218 | 218 | * contain integer component, lower 16 bits contain fractional component |
| 219 | 219 | * 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 | 223 | /* 1.3 Calculate 16 bit active duty cycle from integer and fractional |
| 224 | 224 | * components shift by bitCount then mask 16 bits and add rounding bit |
| @@ -27,7 +27,6 @@ DCN10 = dcn10_ipp.o \ · 26 unmodified lines | ||
| 27 | 27 | dcn10_opp.o \ |
| 28 | 28 | dcn10_mpc.o \ |
| 29 | 29 | dcn10_cm_common.o \ |
| 30 | − dcn10_stream_encoder.o dcn10_link_encoder.o | |
| 31 | 30 | |
| 32 | 31 | AMD_DAL_DCN10 = $(addprefix $(AMDDALPATH)/dc/dcn10/,$(DCN10)) |
| 33 | 32 | |
| @@ -2,7 +2,6 @@ · 1 unmodified line | ||
| 2 | 2 | # Copyright © 2019-2024 Advanced Micro Devices, Inc. All rights reserved. |
| 3 | 3 | |
| 4 | 4 | DCN20 = dcn20_mpc.o dcn20_opp.o dcn20_mmhubbub.o \ |
| 5 | − dcn20_stream_encoder.o dcn20_link_encoder.o \ | |
| 6 | 5 | dcn20_vmid.o dcn20_dwb.o dcn20_dwb_scl.o |
| 7 | 6 | |
| 8 | 7 | AMD_DAL_DCN20 = $(addprefix $(AMDDALPATH)/dc/dcn20/,$(DCN20)) |
| @@ -25,12 +25,10 @@ · 24 unmodified lines | ||
| 25 | 25 | |
| 26 | 26 | DCN30 := dcn30_mpc.o dcn30_vpg.o \ |
| 27 | 27 | dcn30_afmt.o \ |
| 28 | − dcn30_dio_stream_encoder.o \ | |
| 29 | 28 | dcn30_dwb.o \ |
| 30 | 29 | dcn30_dwb_cm.o \ |
| 31 | 30 | dcn30_cm_common.o \ |
| 32 | 31 | dcn30_mmhubbub.o \ |
| 33 | − dcn30_dio_link_encoder.o | |
| 34 | 32 | |
| 35 | 33 | |
| 36 | 34 | |
| @@ -4,7 +4,7 @@ · 3 unmodified lines | ||
| 4 | 4 | # |
| 5 | 5 | # Makefile for dcn31. |
| 6 | 6 | |
| 7 | −DCN31 = dcn31_dio_link_encoder.o dcn31_panel_cntl.o \ | |
| 7 | +DCN31 = dcn31_panel_cntl.o \ | |
| 8 | 8 | dcn31_apg.o dcn31_hpo_dp_stream_encoder.o dcn31_hpo_dp_link_encoder.o \ |
| 9 | 9 | dcn31_afmt.o dcn31_vpg.o |
| 10 | 10 | |
| @@ -24,6 +24,42 @@ · 23 unmodified lines | ||
| 24 | 24 | # |
| 25 | 25 | |
| 26 | 26 | ifdef CONFIG_DRM_AMD_DC_FP |
| 27 | +############################################################################### | |
| 28 | +# DCN10 | |
| 29 | +############################################################################### | |
| 30 | +DIO_DCN10 = dcn10_link_encoder.o dcn10_stream_encoder.o | |
| 31 | + | |
| 32 | +AMD_DAL_DIO_DCN10 = $(addprefix $(AMDDALPATH)/dc/dio/dcn10/,$(DIO_DCN10)) | |
| 33 | + | |
| 34 | +AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN10) | |
| 35 | + | |
| 36 | +############################################################################### | |
| 37 | +# DCN20 | |
| 38 | +############################################################################### | |
| 39 | +DIO_DCN20 = dcn20_link_encoder.o dcn20_stream_encoder.o | |
| 40 | + | |
| 41 | +AMD_DAL_DIO_DCN20 = $(addprefix $(AMDDALPATH)/dc/dio/dcn20/,$(DIO_DCN20)) | |
| 42 | + | |
| 43 | +AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN20) | |
| 44 | + | |
| 45 | +############################################################################### | |
| 46 | +# DCN30 | |
| 47 | +############################################################################### | |
| 48 | +DIO_DCN30 = dcn30_dio_link_encoder.o dcn30_dio_stream_encoder.o | |
| 49 | + | |
| 50 | +AMD_DAL_DIO_DCN30 = $(addprefix $(AMDDALPATH)/dc/dio/dcn30/,$(DIO_DCN30)) | |
| 51 | + | |
| 52 | +AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN30) | |
| 53 | + | |
| 54 | +############################################################################### | |
| 55 | +# DCN31 | |
| 56 | +############################################################################### | |
| 57 | +DIO_DCN31 = dcn31_dio_link_encoder.o | |
| 58 | + | |
| 59 | +AMD_DAL_DIO_DCN31 = $(addprefix $(AMDDALPATH)/dc/dio/dcn31/,$(DIO_DCN31)) | |
| 60 | + | |
| 61 | +AMD_DISPLAY_FILES += $(AMD_DAL_DIO_DCN31) | |
| 62 | + | |
| 27 | 63 | ############################################################################### |
| 28 | 64 | # DCN32 |
| 29 | 65 | ############################################################################### |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
| @@ -997,7 +997,7 @@ static bool subvp_subvp_admissable(struct dc *dc, · 996 unmodified lines | ||
| 997 | 997 | if (pipe->plane_state && !pipe->top_pipe && |
| 998 | 998 | dc_state_get_pipe_subvp_type(context, pipe) == SUBVP_MAIN) { |
| 999 | 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 | 1001 | refresh_rate = div_u64(refresh_rate, pipe->stream->timing.v_total); |
| 1002 | 1002 | refresh_rate = div_u64(refresh_rate, pipe->stream->timing.h_total); |
| 1003 | 1003 | |
| @@ -3364,6 +3364,9 @@ void dml32_ModeSupportAndSystemConfigurationFull(struct display_mode_lib *mode_l · 3363 unmodified lines | ||
| 3364 | 3364 | &mode_lib->vba.UrgentBurstFactorLumaPre[k], |
| 3365 | 3365 | &mode_lib->vba.UrgentBurstFactorChromaPre[k], |
| 3366 | 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 | { |
| @@ -197,9 +197,14 @@ static bool dml21_mode_check_and_programming(const struct dc *in_dc, struct dc_s · 196 unmodified lines | ||
| 197 | 197 | memset(&dml_ctx->v21.dml_to_dc_pipe_mapping, 0, sizeof(struct dml2_dml_to_dc_pipe_mapping)); |
| 198 | 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 | 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 | 208 | /* scrub phantom's from current dc_state */ |
| 204 | 209 | dml_ctx->config.svp_pstate.callbacks.remove_phantom_streams_and_planes(in_dc, context); |
| 205 | 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 | |
| 281 | 286 | void 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 | 290 | struct pipe_ctx *dc_main_pipes[__DML2_WRAPPER_MAX_STREAMS_PLANES__]; |
| 285 | 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 | 322 | num_pipes = dml21_find_dc_pipes_for_plane(in_dc, context, dml_ctx, dc_main_pipes, dc_phantom_pipes, dml_prog_idx); |
| 317 | − | |
| 318 | − if (num_pipes <= 0 || | |
| 319 | − dc_main_pipes[0]->stream == NULL || | |
| 320 | − dc_main_pipes[0]->plane_state == NULL) | |
| 323 | + if (num_pipes <= 0 || dc_main_pipes[0]->stream == NULL || | |
| 324 | + dc_main_pipes[0]->plane_state == NULL) | |
| 321 | 325 | continue; |
| 322 | 326 | |
| 323 | 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 | 360 | pln_prog = &dml_ctx->v21.mode_programming.programming->plane_programming[dml_prog_idx]; |
| 357 | 361 | |
| 358 | 362 | num_pipes = dml21_find_dc_pipes_for_plane(in_dc, context, dml_ctx, dc_main_pipes, dc_phantom_pipes, dml_prog_idx); |
| 359 | − | |
| 360 | − if (num_pipes <= 0 || | |
| 361 | − dc_main_pipes[0]->stream == NULL || | |
| 362 | − dc_main_pipes[0]->plane_state == NULL) | |
| 363 | + if (num_pipes <= 0 || dc_main_pipes[0]->stream == NULL || | |
| 364 | + dc_main_pipes[0]->plane_state == NULL) | |
| 363 | 365 | continue; |
| 364 | 366 | |
| 365 | 367 | /* get config for each pipe */ |
| @@ -11,7 +11,7 @@ bool dml2_core_create(enum dml2_project_id project_id, struct dml2_core_instance · 10 unmodified lines | ||
| 11 | 11 | { |
| 12 | 12 | bool result = false; |
| 13 | 13 | |
| 14 | − if (out == 0) | |
| 14 | + if (!out) | |
| 15 | 15 | return false; |
| 16 | 16 | |
| 17 | 17 | memset(out, 0, sizeof(struct dml2_core_instance)); |
| @@ -21,7 +21,7 @@ bool dml2_dpmm_create(enum dml2_project_id project_id, struct dml2_dpmm_instance · 20 unmodified lines | ||
| 21 | 21 | { |
| 22 | 22 | bool result = false; |
| 23 | 23 | |
| 24 | − if (out == 0) | |
| 24 | + if (!out) | |
| 25 | 25 | return false; |
| 26 | 26 | |
| 27 | 27 | memset(out, 0, sizeof(struct dml2_dpmm_instance)); |
| @@ -16,7 +16,7 @@ bool dml2_mcg_create(enum dml2_project_id project_id, struct dml2_mcg_instance * · 15 unmodified lines | ||
| 16 | 16 | { |
| 17 | 17 | bool result = false; |
| 18 | 18 | |
| 19 | − if (out == 0) | |
| 19 | + if (!out) | |
| 20 | 20 | return false; |
| 21 | 21 | |
| 22 | 22 | memset(out, 0, sizeof(struct dml2_mcg_instance)); |
| @@ -28,7 +28,7 @@ bool dml2_pmo_create(enum dml2_project_id project_id, struct dml2_pmo_instance * · 27 unmodified lines | ||
| 28 | 28 | { |
| 29 | 29 | bool result = false; |
| 30 | 30 | |
| 31 | − if (out == 0) | |
| 31 | + if (!out) | |
| 32 | 32 | return false; |
| 33 | 33 | |
| 34 | 34 | memset(out, 0, sizeof(struct dml2_pmo_instance)); |
| @@ -296,6 +296,7 @@ void dml2_init_socbb_params(struct dml2_context *dml2, const struct dc *in_dc, s · 295 unmodified lines | ||
| 296 | 296 | out->round_trip_ping_latency_dcfclk_cycles = 106; |
| 297 | 297 | out->smn_latency_us = 2; |
| 298 | 298 | out->dispclk_dppclk_vco_speed_mhz = 3600; |
| 299 | + out->pct_ideal_dram_bw_after_urgent_pixel_only = 65.0; | |
| 299 | 300 | break; |
| 300 | 301 | |
| 301 | 302 | case dml_project_dcn401: |
| @@ -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 | 289 | unsigned int dc_pipe_ctx_index, dml_pipe_idx, plane_id; |
| 290 | 290 | enum mall_stream_type pipe_mall_type; |
| 291 | − bool unbounded_req_enabled = false; | |
| 292 | 291 | struct dml2_calculate_rq_and_dlg_params_scratch *s = &in_ctx->v20.scratch.calculate_rq_and_dlg_params_scratch; |
| 293 | 292 | |
| 294 | 293 | context->bw_ctx.bw.dcn.clk.dcfclk_deep_sleep_khz = (unsigned int)in_ctx->v20.dml_core_ctx.mp.DCFCLKDeepSleep * 1000; |
| 295 | 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 | 297 | context->bw_ctx.bw.dcn.clk.fclk_p_state_change_support = false; |
| 299 | 298 | else |
| 300 | 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 | 301 | if (context->bw_ctx.bw.dcn.clk.dispclk_khz < dc->debug.min_disp_clk_khz) |
| 303 | 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 | 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 | 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 | 335 | context->res_ctx.pipe_ctx[dc_pipe_ctx_index].unbounded_req = false; |
| 345 | 336 | } else { |
| 346 | 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 | 342 | context->bw_ctx.bw.dcn.compbuf_size_kb -= context->res_ctx.pipe_ctx[dc_pipe_ctx_index].det_buffer_size_kb; |
| @@ -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 | 627 | if (result) { |
| 628 | 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 | 629 | out_clks.dispclk_khz = (unsigned int)dml2->v20.dml_core_ctx.mp.Dispclk_calculated * 1000; |
| 645 | 630 | out_clks.p_state_supported = s->mode_support_info.DRAMClockChangeSupport[0] != dml_dram_clock_change_unsupported; |
| 646 | 631 | if (in_dc->config.use_default_clock_table && |
| @@ -237,8 +237,6 @@ struct dml2_configuration_options { · 236 unmodified lines | ||
| 237 | 237 | bool use_clock_dc_limits; |
| 238 | 238 | bool gpuvm_enable; |
| 239 | 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 | /* |
| @@ -829,6 +829,7 @@ bool hubbub401_get_dcc_compression_cap(struct hubbub *hubbub, · 828 unmodified lines | ||
| 829 | 829 | struct dc_surface_dcc_cap *output) |
| 830 | 830 | { |
| 831 | 831 | struct dc *dc = hubbub->ctx->dc; |
| 832 | + const unsigned int max_dcc_plane_width = dc->caps.dcc_plane_width_limit; | |
| 832 | 833 | /* DCN4_Programming_Guide_DCHUB.docx, Section 5.11.2.2 */ |
| 833 | 834 | enum dcc_control dcc_control; |
| 834 | 835 | unsigned int plane0_bpe, plane1_bpe; |
| @@ -843,6 +844,11 @@ bool hubbub401_get_dcc_compression_cap(struct hubbub *hubbub, · 8 unmodified lines | ||
| 843 | 844 | if (dc->debug.disable_dcc == DCC_DISABLE) |
| 844 | 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 | 852 | switch (input->format) { |
| 847 | 853 | default: |
| 848 | 854 | is_dual_plane = false; |
| @@ -677,12 +677,23 @@ void hubp401_cursor_set_position( · 676 unmodified lines | ||
| 677 | 677 | int rec_x_offset = x_pos - pos->x_hotspot; |
| 678 | 678 | int rec_y_offset = y_pos - pos->y_hotspot; |
| 679 | 679 | int dst_x_offset; |
| 680 | − int x_pos_viewport = x_pos * param->viewport.width / param->recout.width; | |
| 681 | − int x_hot_viewport = pos->x_hotspot * param->viewport.width / param->recout.width; | |
| 680 | + int x_pos_viewport = 0; | |
| 681 | + int x_hot_viewport = 0; | |
| 682 | 682 | uint32_t cur_en = pos->enable ? 1 : 0; |
| 683 | 683 | |
| 684 | 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 | 698 | * Guard aganst cursor_set_position() from being called with invalid |
| 688 | 699 | * attributes |
| @@ -1305,13 +1305,65 @@ static void populate_audio_dp_link_info( · 1304 unmodified lines | ||
| 1305 | 1305 | |
| 1306 | 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. | |
| 1309 | − * TODO: Plumb the actual programmed HBlank min symbol width to here. | |
| 1308 | + /* Calculates hblank_min_symbol_width for 128b/132b | |
| 1309 | + * Corresponding HBLANK_MIN_SYMBOL_WIDTH register is calculated as: | |
| 1310 | + * floor(h_blank * bits_per_pixel / 128) | |
| 1310 | 1311 | */ |
| 1311 | − if (dp_link_info->encoding == DP_128b_132b_ENCODING) | |
| 1312 | − dp_link_info->hblank_min_symbol_width = 4; | |
| 1313 | − else | |
| 1312 | + if (dp_link_info->encoding == DP_128b_132b_ENCODING) { | |
| 1313 | + struct dc_crtc_timing *crtc_timing = &pipe_ctx->stream->timing; | |
| 1314 | + | |
| 1315 | + uint32_t h_active = crtc_timing->h_addressable + crtc_timing->h_border_left | |
| 1316 | + + crtc_timing->h_border_right; | |
| 1317 | + uint32_t h_blank = crtc_timing->h_total - h_active; | |
| 1318 | + | |
| 1319 | + uint32_t bpp; | |
| 1320 | + | |
| 1321 | + if (crtc_timing->flags.DSC) { | |
| 1322 | + bpp = crtc_timing->dsc_cfg.bits_per_pixel; | |
| 1323 | + } else { | |
| 1324 | + /* When the timing is using DSC, dsc_cfg.bits_per_pixel is in 16th bits. | |
| 1325 | + * The bpp in this path is scaled to 16th bits so the final calculation | |
| 1326 | + * is correct for both cases. | |
| 1327 | + */ | |
| 1328 | + bpp = 16; | |
| 1329 | + switch (crtc_timing->display_color_depth) { | |
| 1330 | + case COLOR_DEPTH_666: | |
| 1331 | + bpp *= 18; | |
| 1332 | + break; | |
| 1333 | + case COLOR_DEPTH_888: | |
| 1334 | + bpp *= 24; | |
| 1335 | + break; | |
| 1336 | + case COLOR_DEPTH_101010: | |
| 1337 | + bpp *= 30; | |
| 1338 | + break; | |
| 1339 | + case COLOR_DEPTH_121212: | |
| 1340 | + bpp *= 36; | |
| 1341 | + break; | |
| 1342 | + default: | |
| 1343 | + bpp = 0; | |
| 1344 | + break; | |
| 1345 | + } | |
| 1346 | + | |
| 1347 | + switch (crtc_timing->pixel_encoding) { | |
| 1348 | + case PIXEL_ENCODING_YCBCR422: | |
| 1349 | + bpp = bpp * 2 / 3; | |
| 1350 | + break; | |
| 1351 | + case PIXEL_ENCODING_YCBCR420: | |
| 1352 | + bpp /= 2; | |
| 1353 | + break; | |
| 1354 | + default: | |
| 1355 | + break; | |
| 1356 | + } | |
| 1357 | + } | |
| 1358 | + | |
| 1359 | + /* Min symbol width = floor(h_blank * (bpp/16) / 128) */ | |
| 1360 | + dp_link_info->hblank_min_symbol_width = dc_fixpt_floor( | |
| 1361 | + dc_fixpt_div(dc_fixpt_from_int(h_blank * bpp), | |
| 1362 | + dc_fixpt_from_int(128 / 16))); | |
| 1363 | + | |
| 1364 | + } else { | |
| 1314 | 1365 | dp_link_info->hblank_min_symbol_width = 0; |
| 1366 | + } | |
| 1315 | 1367 | } |
| 1316 | 1368 | |
| 1317 | 1369 | static void build_audio_output( |
| @@ -2208,7 +2208,7 @@ static int dcn10_align_pixel_clocks(struct dc *dc, int group_size, · 2207 unmodified lines | ||
| 2208 | 2208 | grouped_pipes[i]->stream->signal)) { |
| 2209 | 2209 | embedded = i; |
| 2210 | 2210 | master = i; |
| 2211 | − phase[i] = embedded_pix_clk_100hz*100; | |
| 2211 | + phase[i] = embedded_pix_clk_100hz*(uint64_t)100; | |
| 2212 | 2212 | modulo[i] = dp_ref_clk_100hz*100; |
| 2213 | 2213 | } else { |
| 2214 | 2214 | |
| @@ -183,6 +183,12 @@ void dcn21_set_abm_immediate_disable(struct pipe_ctx *pipe_ctx) · 182 unmodified lines | ||
| 183 | 183 | struct panel_cntl *panel_cntl = pipe_ctx->stream->link->panel_cntl; |
| 184 | 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 | 192 | if (dmcu) { |
| 187 | 193 | dce110_set_abm_immediate_disable(pipe_ctx); |
| 188 | 194 | return; |
| @@ -1088,6 +1088,17 @@ static bool dcn401_can_pipe_disable_cursor(struct pipe_ctx *pipe_ctx) · 1087 unmodified lines | ||
| 1088 | 1088 | return false; |
| 1089 | 1089 | } |
| 1090 | 1090 | |
| 1091 | +void adjust_hotspot_between_slices_for_2x_magnify(uint32_t cursor_width, struct dc_cursor_position *pos_cpy) | |
| 1092 | +{ | |
| 1093 | + if (cursor_width <= 128) { | |
| 1094 | + pos_cpy->x_hotspot /= 2; | |
| 1095 | + pos_cpy->x_hotspot += 1; | |
| 1096 | + } else { | |
| 1097 | + pos_cpy->x_hotspot /= 2; | |
| 1098 | + pos_cpy->x_hotspot += 2; | |
| 1099 | + } | |
| 1100 | +} | |
| 1101 | + | |
| 1091 | 1102 | void dcn401_set_cursor_position(struct pipe_ctx *pipe_ctx) |
| 1092 | 1103 | { |
| 1093 | 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 | 1120 | int prev_odm_width = 0; |
| 1110 | 1121 | int prev_odm_offset = 0; |
| 1111 | 1122 | struct pipe_ctx *prev_odm_pipe = NULL; |
| 1123 | + bool mpc_combine_on = false; | |
| 1124 | + int bottom_pipe_x_pos = 0; | |
| 1112 | 1125 | |
| 1113 | 1126 | int x_pos = pos_cpy.x; |
| 1114 | 1127 | int y_pos = pos_cpy.y; |
| 1115 | 1128 | int recout_x_pos = 0; |
| 1116 | 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 | 1138 | /* DCN4 moved cursor composition after Scaler, so in HW it is in |
| 1119 | 1139 | * recout space and for HW Cursor position programming need to |
| 1120 | 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 | 1198 | if (x_pos < 0) { |
| 1179 | 1199 | pos_cpy.x_hotspot -= x_pos; |
| 1180 | − if ((odm_combine_on) && (hubp->curs_attr.attribute_flags.bits.ENABLE_MAGNIFICATION)) { | |
| 1181 | − if (hubp->curs_attr.width <= 128) { | |
| 1182 | − pos_cpy.x_hotspot /= 2; | |
| 1183 | − pos_cpy.x_hotspot += 1; | |
| 1184 | − } else { | |
| 1185 | − pos_cpy.x_hotspot /= 2; | |
| 1186 | − pos_cpy.x_hotspot += 2; | |
| 1187 | − } | |
| 1188 | − } | |
| 1200 | + if (hubp->curs_attr.attribute_flags.bits.ENABLE_MAGNIFICATION) | |
| 1201 | + adjust_hotspot_between_slices_for_2x_magnify(hubp->curs_attr.width, &pos_cpy); | |
| 1189 | 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 | 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 | 1226 | pos_cpy.x = (uint32_t)x_pos; |
| 1198 | 1227 | pos_cpy.y = (uint32_t)y_pos; |
| 1199 | 1228 | |
| @@ -80,4 +80,5 @@ void dcn401_unblank_stream(struct pipe_ctx *pipe_ctx, struct dc_link_settings *l · 79 unmodified lines | ||
| 80 | 80 | void dcn401_hardware_release(struct dc *dc); |
| 81 | 81 | void dcn401_update_odm(struct dc *dc, struct dc_state *context, |
| 82 | 82 | struct pipe_ctx *otg_master); |
| 83 | +void adjust_hotspot_between_slices_for_2x_magnify(uint32_t cursor_width, struct dc_cursor_position *pos_cpy); | |
| 83 | 84 | #endif /* __DC_HWSS_DCN401_H__ */ |
| @@ -763,7 +763,7 @@ bool edp_setup_psr(struct dc_link *link, · 762 unmodified lines | ||
| 763 | 763 | |
| 764 | 764 | psr_context->crtcTimingVerticalTotal = stream->timing.v_total; |
| 765 | 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 | 767 | stream->timing.v_total), |
| 768 | 768 | stream->timing.h_total); |
| 769 | 769 | |
| @@ -1695,25 +1695,6 @@ static void dcn314_get_panel_config_defaults(struct dc_panel_config *panel_confi · 1694 unmodified lines | ||
| 1695 | 1695 | *panel_config = panel_config_defaults; |
| 1696 | 1696 | } |
| 1697 | 1697 | |
| 1698 | −static bool filter_modes_for_single_channel_workaround(struct dc *dc, | |
| 1699 | − struct dc_state *context) | |
| 1700 | −{ | |
| 1701 | − // Filter 2K@240Hz+8K@24fps above combination timing if memory only has single dimm LPDDR | |
| 1702 | − if (dc->clk_mgr->bw_params->vram_type == 34 && | |
| 1703 | − dc->clk_mgr->bw_params->num_channels < 2 && | |
| 1704 | − context->stream_count > 1) { | |
| 1705 | − int total_phy_pix_clk = 0; | |
| 1706 | − | |
| 1707 | − for (int i = 0; i < context->stream_count; i++) | |
| 1708 | − if (context->res_ctx.pipe_ctx[i].stream) | |
| 1709 | − total_phy_pix_clk += context->res_ctx.pipe_ctx[i].stream->phy_pix_clk; | |
| 1710 | − | |
| 1711 | − if (total_phy_pix_clk >= (1148928+826260)) //2K@240Hz+8K@24fps | |
| 1712 | − return true; | |
| 1713 | − } | |
| 1714 | − return false; | |
| 1715 | −} | |
| 1716 | − | |
| 1717 | 1698 | bool dcn314_validate_bandwidth(struct dc *dc, |
| 1718 | 1699 | struct dc_state *context, |
| 1719 | 1700 | bool fast_validate) |
| @@ -1732,9 +1713,6 @@ bool dcn314_validate_bandwidth(struct dc *dc, · 12 unmodified lines | ||
| 1732 | 1713 | if (!pipes) |
| 1733 | 1714 | goto validate_fail; |
| 1734 | 1715 | |
| 1735 | − if (filter_modes_for_single_channel_workaround(dc, context)) | |
| 1736 | − goto validate_fail; | |
| 1737 | − | |
| 1738 | 1716 | DC_FP_START(); |
| 1739 | 1717 | // do not support self refresh only |
| 1740 | 1718 | out = dcn30_internal_validate_bw(dc, context, pipes, &pipe_cnt, &vlevel, fast_validate, false); |
| @@ -1760,7 +1760,7 @@ static int dcn315_populate_dml_pipes_from_context( · 1759 unmodified lines | ||
| 1760 | 1760 | bool split_required = pipe->stream->timing.pix_clk_100hz >= dcn_get_max_non_odm_pix_rate_100hz(&dc->dml.soc) |
| 1761 | 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 | 1764 | pipes[pipe_cnt].pipe.src.det_size_override += (remaining_det_segs - MIN_RESERVED_DET_SEGS) / crb_pipes + |
| 1765 | 1765 | (crb_idx < (remaining_det_segs - MIN_RESERVED_DET_SEGS) % crb_pipes ? 1 : 0); |
| 1766 | 1766 | if (pipes[pipe_cnt].pipe.src.det_size_override > 2 * DCN3_15_MAX_DET_SEGS) { |
| @@ -2153,8 +2153,6 @@ static bool dcn35_resource_construct( · 2152 unmodified lines | ||
| 2153 | 2153 | |
| 2154 | 2154 | dc->dml2_options.max_segments_per_hubp = 24; |
| 2155 | 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 | 2157 | if (dc->config.sdpif_request_limit_words_per_umc == 0) |
| 2160 | 2158 | dc->config.sdpif_request_limit_words_per_umc = 16;/*todo*/ |
| @@ -1822,6 +1822,9 @@ static bool dcn401_resource_construct( · 1821 unmodified lines | ||
| 1822 | 1822 | dc->caps.extended_aux_timeout_support = true; |
| 1823 | 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 | 1828 | /* Color pipeline capabilities */ |
| 1826 | 1829 | dc->caps.color.dpp.dcn_arch = 1; |
| 1827 | 1830 | dc->caps.color.dpp.input_lut_shared = 0; |
| @@ -110,21 +110,21 @@ static struct spl_rect calculate_plane_rec_in_timing_active( · 109 unmodified lines | ||
| 110 | 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 | 114 | stream_src->width); |
| 115 | 115 | rec_out.x = stream_dst->x + dc_fixpt_round(temp); |
| 116 | 116 | |
| 117 | 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 | 119 | stream_src->width); |
| 120 | 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 | 123 | stream_src->height); |
| 124 | 124 | rec_out.y = stream_dst->y + dc_fixpt_round(temp); |
| 125 | 125 | |
| 126 | 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 | 128 | stream_src->height); |
| 129 | 129 | rec_out.height = stream_dst->y + dc_fixpt_round(temp) - rec_out.y; |
| 130 | 130 | |
| @@ -299,6 +299,7 @@ struct dmub_srv_hw_params { · 298 unmodified lines | ||
| 299 | 299 | enum dmub_memory_access_type mem_access_type; |
| 300 | 300 | enum dmub_ips_disable_type disable_ips; |
| 301 | 301 | bool disallow_phy_access; |
| 302 | + bool disable_sldo_opt; | |
| 302 | 303 | }; |
| 303 | 304 | |
| 304 | 305 | /** |
| @@ -684,7 +684,8 @@ union dmub_fw_boot_options { · 683 unmodified lines | ||
| 684 | 684 | uint32_t ips_pg_disable: 1; /* 1 to disable ONO domains power gating*/ |
| 685 | 685 | uint32_t ips_disable: 3; /* options to disable ips support*/ |
| 686 | 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 | 689 | } bits; /**< boot bits */ |
| 689 | 690 | uint32_t all; /**< 32-bit access to bits */ |
| 690 | 691 | }; |
| @@ -3326,6 +3327,7 @@ enum replay_state { · 2635 unmodified lines | ||
| 3326 | 3327 | REPLAY_STATE_1 = 0x10, |
| 3327 | 3328 | REPLAY_STATE_1A = 0x11, |
| 3328 | 3329 | REPLAY_STATE_2 = 0x20, |
| 3330 | + REPLAY_STATE_2A = 0x21, | |
| 3329 | 3331 | REPLAY_STATE_3 = 0x30, |
| 3330 | 3332 | REPLAY_STATE_3INIT = 0x31, |
| 3331 | 3333 | REPLAY_STATE_4 = 0x40, |
| @@ -3333,6 +3335,7 @@ enum replay_state { · 1 unmodified line | ||
| 3333 | 3335 | REPLAY_STATE_4B = 0x42, |
| 3334 | 3336 | REPLAY_STATE_4C = 0x43, |
| 3335 | 3337 | REPLAY_STATE_4D = 0x44, |
| 3338 | + REPLAY_STATE_4E = 0x45, | |
| 3336 | 3339 | REPLAY_STATE_4B_LOCKED = 0x4A, |
| 3337 | 3340 | REPLAY_STATE_4C_UNLOCKED = 0x4B, |
| 3338 | 3341 | REPLAY_STATE_5 = 0x50, |
| @@ -424,6 +424,7 @@ void dmub_dcn35_enable_dmub_boot_options(struct dmub_srv *dmub, const struct dmu · 423 unmodified lines | ||
| 424 | 424 | boot_options.bits.disable_clk_gate = params->disable_clock_gate; |
| 425 | 425 | boot_options.bits.ips_disable = params->disable_ips; |
| 426 | 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 | 429 | REG_WRITE(DMCUB_SCRATCH14, boot_options.all); |
| 429 | 430 | } |
| @@ -1002,7 +1002,7 @@ void mod_freesync_build_vrr_params(struct mod_freesync *mod_freesync, · 1001 unmodified lines | ||
| 1002 | 1002 | |
| 1003 | 1003 | if (stream->ctx->dc->caps.max_v_total != 0 && stream->timing.h_total != 0) { |
| 1004 | 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 | 1007 | /* Limit minimum refresh rate to what can be supported by hardware */ |
| 1008 | 1008 | min_refresh_in_uhz = min_hardware_refresh_in_uhz > in_config->min_refresh_in_uhz ? |
| @@ -734,7 +734,7 @@ struct atom_gpio_pin_lut_v2_1 · 733 unmodified lines | ||
| 734 | 734 | { |
| 735 | 735 | struct atom_common_table_header table_header; |
| 736 | 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 | |
| @@ -727,6 +727,7 @@ static int smu_set_funcs(struct amdgpu_device *adev) · 726 unmodified lines | ||
| 727 | 727 | break; |
| 728 | 728 | case IP_VERSION(14, 0, 0): |
| 729 | 729 | case IP_VERSION(14, 0, 1): |
| 730 | + case IP_VERSION(14, 0, 4): | |
| 730 | 731 | smu_v14_0_0_set_ppt_funcs(smu); |
| 731 | 732 | break; |
| 732 | 733 | case IP_VERSION(14, 0, 2): |
| @@ -136,8 +136,7 @@ int smu_v14_0_load_microcode(struct smu_context *smu) · 135 unmodified lines | ||
| 136 | 136 | 1 & ~MP1_SMN_PUB_CTRL__LX3_RESET_MASK); |
| 137 | 137 | |
| 138 | 138 | for (i = 0; i < adev->usec_timeout; i++) { |
| 139 | − if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) || | |
| 140 | − amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) | |
| 139 | + if (smu->is_apu) | |
| 141 | 140 | mp1_fw_flags = RREG32_PCIE(MP1_Public | |
| 142 | 141 | (smnMP1_FIRMWARE_FLAGS_14_0_0 & 0xffffffff)); |
| 143 | 142 | else |
| @@ -210,8 +209,7 @@ int smu_v14_0_check_fw_status(struct smu_context *smu) · 66 unmodified lines | ||
| 210 | 209 | struct amdgpu_device *adev = smu->adev; |
| 211 | 210 | uint32_t mp1_fw_flags; |
| 212 | 211 | |
| 213 | − if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) || | |
| 214 | − amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) | |
| 212 | + if (smu->is_apu) | |
| 215 | 213 | mp1_fw_flags = RREG32_PCIE(MP1_Public | |
| 216 | 214 | (smnMP1_FIRMWARE_FLAGS_14_0_0 & 0xffffffff)); |
| 217 | 215 | else |
| @@ -245,6 +243,7 @@ int smu_v14_0_check_fw_version(struct smu_context *smu) · 27 unmodified lines | ||
| 245 | 243 | |
| 246 | 244 | switch (amdgpu_ip_version(adev, MP1_HWIP, 0)) { |
| 247 | 245 | case IP_VERSION(14, 0, 0): |
| 246 | + case IP_VERSION(14, 0, 4): | |
| 248 | 247 | smu->smc_driver_if_version = SMU14_DRIVER_IF_VERSION_SMU_V14_0_0; |
| 249 | 248 | break; |
| 250 | 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 | 758 | case IP_VERSION(14, 0, 1): |
| 760 | 759 | case IP_VERSION(14, 0, 2): |
| 761 | 760 | case IP_VERSION(14, 0, 3): |
| 761 | + case IP_VERSION(14, 0, 4): | |
| 762 | 762 | if (!(adev->pm.pp_feature & PP_GFXOFF_MASK)) |
| 763 | 763 | return 0; |
| 764 | 764 | if (enable) |
| @@ -866,8 +866,7 @@ static int smu_v14_0_set_irq_state(struct amdgpu_device *adev, · 101 unmodified lines | ||
| 866 | 866 | WREG32_SOC15(THM, 0, regTHM_THERMAL_INT_ENA, 0); |
| 867 | 867 | |
| 868 | 868 | /* For MP1 SW irqs */ |
| 869 | − if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) || | |
| 870 | − amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) { | |
| 869 | + if (smu->is_apu) { | |
| 871 | 870 | val = RREG32_SOC15(MP1, 0, regMP1_SMN_IH_SW_INT_CTRL_mp1_14_0_0); |
| 872 | 871 | val = REG_SET_FIELD(val, MP1_SMN_IH_SW_INT_CTRL, INT_MASK, 1); |
| 873 | 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 | 899 | WREG32_SOC15(THM, 0, regTHM_THERMAL_INT_ENA, val); |
| 901 | 900 | |
| 902 | 901 | /* For MP1 SW irqs */ |
| 903 | − if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) || | |
| 904 | − amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) { | |
| 902 | + if (smu->is_apu) { | |
| 905 | 903 | val = RREG32_SOC15(MP1, 0, regMP1_SMN_IH_SW_INT_mp1_14_0_0); |
| 906 | 904 | val = REG_SET_FIELD(val, MP1_SMN_IH_SW_INT, ID, 0xFE); |
| 907 | 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 | 1492 | if (adev->vcn.harvest_config & (1 << i)) |
| 1495 | 1493 | continue; |
| 1496 | 1494 | |
| 1497 | − if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) || | |
| 1498 | − amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) { | |
| 1495 | + if (smu->is_apu) { | |
| 1499 | 1496 | if (i == 0) |
| 1500 | 1497 | ret = smu_cmn_send_smc_msg_with_param(smu, enable ? |
| 1501 | 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 | 1524 | if (adev->jpeg.harvest_config & (1 << i)) |
| 1528 | 1525 | continue; |
| 1529 | 1526 | |
| 1530 | − if (amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0) || | |
| 1531 | − amdgpu_ip_version(adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) { | |
| 1527 | + if (smu->is_apu) { | |
| 1532 | 1528 | if (i == 0) |
| 1533 | 1529 | ret = smu_cmn_send_smc_msg_with_param(smu, enable ? |
| 1534 | 1530 | SMU_MSG_PowerUpJpeg0 : SMU_MSG_PowerDownJpeg0, |
| @@ -723,10 +723,10 @@ static int smu_v14_0_common_get_dpm_freq_by_index(struct smu_context *smu, · 722 unmodified lines | ||
| 723 | 723 | uint32_t dpm_level, |
| 724 | 724 | uint32_t *freq) |
| 725 | 725 | { |
| 726 | − if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0)) | |
| 727 | − smu_v14_0_0_get_dpm_freq_by_index(smu, clk_type, dpm_level, freq); | |
| 728 | − else if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) | |
| 726 | + if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) | |
| 729 | 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 | 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 | 999 | uint32_t *min, |
| 1000 | 1000 | uint32_t *max) |
| 1001 | 1001 | { |
| 1002 | − if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0)) | |
| 1003 | − smu_v14_0_0_get_dpm_ultimate_freq(smu, clk_type, min, max); | |
| 1004 | − else if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) | |
| 1002 | + if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) | |
| 1005 | 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 | 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 | 1104 | enum smu_clk_type clk_type, |
| 1105 | 1105 | uint32_t *count) |
| 1106 | 1106 | { |
| 1107 | − if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 0)) | |
| 1108 | − smu_v14_0_0_get_dpm_level_count(smu, clk_type, count); | |
| 1109 | − else if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) | |
| 1107 | + if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) | |
| 1110 | 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 | 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 | |
| 1373 | 1373 | static 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)) | |
| 1376 | − smu_v14_0_0_set_fine_grain_gfx_freq_parameters(smu); | |
| 1377 | − else if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) | |
| 1375 | + if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) | |
| 1378 | 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 | 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 | |
| 1437 | 1437 | static 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)) | |
| 1440 | − smu_14_0_0_get_dpm_table(smu, clock_table); | |
| 1441 | − else if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) | |
| 1439 | + if (amdgpu_ip_version(smu->adev, MP1_HWIP, 0) == IP_VERSION(14, 0, 1)) | |
| 1442 | 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 | 1444 | return 0; |
| 1445 | 1445 | } |
| @@ -642,7 +642,7 @@ static void radeon_gem_va_update_vm(struct radeon_device *rdev, · 641 unmodified lines | ||
| 642 | 642 | if (r) |
| 643 | 643 | goto error_unlock; |
| 644 | 644 | |
| 645 | − if (bo_va->it.start) | |
| 645 | + if (bo_va->it.start && bo_va->bo) | |
| 646 | 646 | r = radeon_vm_bo_update(rdev, bo_va, bo_va->bo->tbo.resource); |
| 647 | 647 | |
| 648 | 648 | error_unlock: |
| @@ -1506,6 +1506,8 @@ drm_fourcc_canonicalize_nvidia_format_mod(__u64 modifier) · 1505 unmodified lines | ||
| 1506 | 1506 | * 6 - 64KB_3D |
| 1507 | 1507 | * 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 | 1511 | #define AMD_FMT_MOD_TILE_GFX12_64K_2D 3 |
| 1510 | 1512 | #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 | 1542 | #define AMD_FMT_MOD_DCC_MAX_COMPRESSED_BLOCK_SHIFT 18 |
| 1541 | 1543 | #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 | 1546 | * DCC supports embedding some clear colors directly in the DCC surface. |
| 1548 | 1547 | * However, on older GPUs the rendering HW ignores the embedded clear color |