Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

drm/amdgpu: retire render backend setup from gfx_v9_4_3

gfx v9_4_3 only support compute. render backend
doesn't need to be involved in any compute shader
execution.

Signed-off-by: Hawking Zhang <Hawking.Zhang@amd.com>
Reviewed-by: Le Ma <le.ma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Hawking Zhang and committed by
Alex Deucher
ebadc106 553f973a

-44
-44
drivers/gpu/drm/amd/amdgpu/gfx_v9_4_3.c
··· 888 888 return 0; 889 889 } 890 890 891 - static u32 gfx_v9_4_3_get_rb_active_bitmap(struct amdgpu_device *adev) 892 - { 893 - u32 data, mask; 894 - 895 - data = RREG32_SOC15(GC, GET_INST(GC, 0), regCC_RB_BACKEND_DISABLE); 896 - data |= RREG32_SOC15(GC, GET_INST(GC, 0), regGC_USER_RB_BACKEND_DISABLE); 897 - 898 - data &= CC_RB_BACKEND_DISABLE__BACKEND_DISABLE_MASK; 899 - data >>= GC_USER_RB_BACKEND_DISABLE__BACKEND_DISABLE__SHIFT; 900 - 901 - mask = amdgpu_gfx_create_bitmask(adev->gfx.config.max_backends_per_se / 902 - adev->gfx.config.max_sh_per_se); 903 - 904 - return (~data) & mask; 905 - } 906 - 907 - static void gfx_v9_4_3_setup_rb(struct amdgpu_device *adev, int xcc_id) 908 - { 909 - int i, j; 910 - u32 data; 911 - u32 active_rbs = 0; 912 - u32 rb_bitmap_width_per_sh = adev->gfx.config.max_backends_per_se / 913 - adev->gfx.config.max_sh_per_se; 914 - 915 - mutex_lock(&adev->grbm_idx_mutex); 916 - for (i = 0; i < adev->gfx.config.max_shader_engines; i++) { 917 - for (j = 0; j < adev->gfx.config.max_sh_per_se; j++) { 918 - gfx_v9_4_3_select_se_sh(adev, i, j, 0xffffffff, xcc_id); 919 - data = gfx_v9_4_3_get_rb_active_bitmap(adev); 920 - active_rbs |= data << ((i * adev->gfx.config.max_sh_per_se + j) * 921 - rb_bitmap_width_per_sh); 922 - } 923 - } 924 - gfx_v9_4_3_select_se_sh(adev, 0xffffffff, 0xffffffff, 0xffffffff, xcc_id); 925 - mutex_unlock(&adev->grbm_idx_mutex); 926 - 927 - adev->gfx.config.backend_enable_mask = active_rbs; 928 - adev->gfx.config.num_rbs = hweight32(active_rbs); 929 - } 930 - 931 891 #define DEFAULT_SH_MEM_BASES (0x6000) 932 892 static void gfx_v9_4_3_init_compute_vmid(struct amdgpu_device *adev, int xcc_id) 933 893 { ··· 951 991 int i, j, num_xcc; 952 992 953 993 num_xcc = NUM_XCC(adev->gfx.xcc_mask); 954 - for (i = 0; i < num_xcc; i++) { 955 - WREG32_FIELD15_PREREG(GC, GET_INST(GC, i), GRBM_CNTL, READ_TIMEOUT, 0xff); 956 - gfx_v9_4_3_setup_rb(adev, i); 957 - } 958 994 959 995 gfx_v9_4_3_get_cu_info(adev, &adev->gfx.cu_info); 960 996 adev->gfx.config.db_debug2 = RREG32_SOC15(GC, GET_INST(GC, 0), regDB_DEBUG2);