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

drm/amd/display: Added dc_edp_id_count to dc_context

[Why]
We need to keep track of the number of eDP links to
properly enumerate edp panel control instance.

[How]
Added dc_edp_id_count to dc_context to keep track of
number of eDP links.

Signed-off-by: Jake Wang <haonan.wang2@amd.com>
Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: Qingqing Zhuo <qingqing.zhuo@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Jake Wang and committed by
Alex Deucher
3306ace5 37bedd99

+4 -7
+3 -7
drivers/gpu/drm/amd/display/dc/core/dc_link.c
··· 1386 1386 struct dc_bios *bios = init_params->dc->ctx->dc_bios; 1387 1387 const struct dc_vbios_funcs *bp_funcs = bios->funcs; 1388 1388 struct bp_disp_connector_caps_info disp_connect_caps_info = { 0 }; 1389 - struct dc_link *edp_links[MAX_NUM_EDP]; 1390 - int edp_num; 1391 1389 1392 1390 DC_LOGGER_INIT(dc_ctx->logger); 1393 1391 ··· 1511 1513 (link->link_id.id == CONNECTOR_ID_EDP || 1512 1514 link->link_id.id == CONNECTOR_ID_LVDS)) { 1513 1515 panel_cntl_init_data.ctx = dc_ctx; 1514 - get_edp_links(panel_cntl_init_data.ctx->dc, edp_links, &edp_num); 1515 - if ((edp_num > 1) && (link->link_index > edp_links[0]->link_index)) 1516 - panel_cntl_init_data.inst = 1; 1517 - else 1518 - panel_cntl_init_data.inst = 0; 1516 + panel_cntl_init_data.inst = 1517 + panel_cntl_init_data.ctx->dc_edp_id_count; 1519 1518 link->panel_cntl = 1520 1519 link->dc->res_pool->funcs->panel_cntl_create( 1521 1520 &panel_cntl_init_data); 1521 + panel_cntl_init_data.ctx->dc_edp_id_count++; 1522 1522 1523 1523 if (link->panel_cntl == NULL) { 1524 1524 DC_ERROR("Failed to create link panel_cntl!\n");
+1
drivers/gpu/drm/amd/display/dc/dc_types.h
··· 113 113 struct gpio_service *gpio_service; 114 114 uint32_t dc_sink_id_count; 115 115 uint32_t dc_stream_id_count; 116 + uint32_t dc_edp_id_count; 116 117 uint64_t fbc_gpu_addr; 117 118 struct dc_dmub_srv *dmub_srv; 118 119