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

drm/amd/display: correct rn NUM_VMID

Save the correct num vmid during resource creation and fix RN gpuvm
level from 1 to 16 vmid entries.

Signed-off-by: Dmytro Laktyushkin <Dmytro.Laktyushkin@amd.com>
Reviewed-by: Eric Bernstein <Eric.Bernstein@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Dmytro Laktyushkin and committed by
Alex Deucher
fdcf62fb b6dbb8ff

+9 -9
+1
drivers/gpu/drm/amd/display/dc/dcn20/dcn20_hubbub.h
··· 80 80 const struct dcn_hubbub_mask *masks; 81 81 unsigned int debug_test_index_pstate; 82 82 struct dcn_watermark_set watermarks; 83 + int num_vmid; 83 84 struct dcn20_vmid vmid[16]; 84 85 unsigned int detile_buf_size; 85 86 };
+1 -6
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_hubbub.c
··· 49 49 #define FN(reg_name, field_name) \ 50 50 hubbub1->shifts->field_name, hubbub1->masks->field_name 51 51 52 - #ifdef NUM_VMID 53 - #undef NUM_VMID 54 - #endif 55 - #define NUM_VMID 16 56 - 57 52 static uint32_t convert_and_clamp( 58 53 uint32_t wm_ns, 59 54 uint32_t refclk_mhz, ··· 133 138 134 139 dcn21_dchvm_init(hubbub); 135 140 136 - return NUM_VMID; 141 + return hubbub1->num_vmid; 137 142 } 138 143 139 144 bool hubbub21_program_urgent_watermarks(
+2 -1
drivers/gpu/drm/amd/display/dc/dcn21/dcn21_resource.c
··· 805 805 .num_pll = 5, // maybe 3 because the last two used for USB-c 806 806 .num_dwb = 1, 807 807 .num_ddc = 5, 808 - .num_vmid = 1, 808 + .num_vmid = 16, 809 809 .num_dsc = 3, 810 810 }; 811 811 ··· 1295 1295 vmid->shifts = &vmid_shifts; 1296 1296 vmid->masks = &vmid_masks; 1297 1297 } 1298 + hubbub->num_vmid = res_cap_rn.num_vmid; 1298 1299 1299 1300 return &hubbub->base; 1300 1301 }
+5 -2
drivers/gpu/drm/amd/display/modules/vmid/vmid.c
··· 112 112 evict_vmids(core_vmid); 113 113 114 114 vmid = get_next_available_vmid(core_vmid); 115 - add_ptb_to_table(core_vmid, vmid, ptb); 115 + if (vmid != -1) { 116 + add_ptb_to_table(core_vmid, vmid, ptb); 116 117 117 - dc_setup_vm_context(core_vmid->dc, &va_config, vmid); 118 + dc_setup_vm_context(core_vmid->dc, &va_config, vmid); 119 + } else 120 + ASSERT(0); 118 121 } 119 122 120 123 return vmid;