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

drm/amd/display: Fix underflow for fused display pipes case

[Why]
Depend on res_pool->res_cap->num_timing_generator to query timing
gernerator information, it would case underflow at the fused display
pipes case.
Due to the res_pool->res_cap->num_timing_generator records default
timing generator resource built in driver, not the current chip.

[How]
Some ASICs would be fused display pipes less than the default setting.
In dcnxx_resource_construct function, driver would obatin real timing
generator count and store it into res_pool->timing_generator_count.

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Rodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: Yi-Ling Chen <Yi-Ling.Chen2@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Yi-Ling Chen and committed by
Alex Deucher
771ced73 eac4c54b

+6 -1
+6 -1
drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
··· 1365 1365 uint32_t opp_id_src1 = OPP_ID_INVALID; 1366 1366 1367 1367 // Step 1: To find out which OPTC is running & OPTC DSC is ON 1368 - for (i = 0; i < dc->res_pool->res_cap->num_timing_generator; i++) { 1368 + // We can't use res_pool->res_cap->num_timing_generator to check 1369 + // Because it records display pipes default setting built in driver, 1370 + // not display pipes of the current chip. 1371 + // Some ASICs would be fused display pipes less than the default setting. 1372 + // In dcnxx_resource_construct function, driver would obatin real information. 1373 + for (i = 0; i < dc->res_pool->timing_generator_count; i++) { 1369 1374 uint32_t optc_dsc_state = 0; 1370 1375 struct timing_generator *tg = dc->res_pool->timing_generators[i]; 1371 1376