Commit e1f4328f authored by Jimmy Kizito's avatar Jimmy Kizito Committed by Alex Deucher

drm/amd/display: Update link encoder object creation

[Why]
Currently the creation of link encoder objects is tightly coupled to the
creation of link objects. Decoupling link encoder object creation is a
preliminary step in the process of allowing link encoders to be
dynamically assigned to links.

[How]
Add "minimal" link encoder objects which are not associated with any
link until required.
Tested-by: default avatarDaniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: default avatarJimmy Kizito <Jimmy.Kizito@amd.com>
Reviewed-by: default avatarJun Lei <Jun.Lei@amd.com>
Acked-by: default avatarRodrigo Siqueira <Rodrigo.Siqueira@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent 4f8e37db
......@@ -91,8 +91,14 @@ static void dc_link_destruct(struct dc_link *link)
if (link->panel_cntl)
link->panel_cntl->funcs->destroy(&link->panel_cntl);
if (link->link_enc)
if (link->link_enc) {
/* Update link encoder tracking variables. These are used for the dynamic
* assignment of link encoders to streams.
*/
link->dc->res_pool->link_encoders[link->link_enc->preferred_engine] = NULL;
link->dc->res_pool->dig_link_enc_count--;
link->link_enc->funcs->destroy(&link->link_enc);
}
if (link->local_sink)
dc_sink_release(link->local_sink);
......@@ -1532,6 +1538,12 @@ static bool dc_link_construct(struct dc_link *link,
DC_LOG_DC("BIOS object table - DP_IS_USB_C: %d", link->link_enc->features.flags.bits.DP_IS_USB_C);
/* Update link encoder tracking variables. These are used for the dynamic
* assignment of link encoders to streams.
*/
link->dc->res_pool->link_encoders[link->link_enc->preferred_engine] = link->link_enc;
link->dc->res_pool->dig_link_enc_count++;
link->link_enc_hw_inst = link->link_enc->transmitter;
for (i = 0; i < 4; i++) {
......
......@@ -103,6 +103,10 @@ struct dc_link {
bool lttpr_non_transparent_mode;
bool is_internal_display;
/* TODO: Rename. Flag an endpoint as having a programmable mapping to a
* DIG encoder. */
bool is_dig_mapping_flexible;
bool edp_sink_present;
/* caps is the same as reported_link_cap. link_traing use
......
......@@ -97,6 +97,10 @@ struct resource_funcs {
const struct panel_cntl_init_data *panel_cntl_init_data);
struct link_encoder *(*link_enc_create)(
const struct encoder_init_data *init);
/* Create a minimal link encoder object with no dc_link object
* associated with it. */
struct link_encoder *(*link_enc_create_minimal)(struct dc_context *ctx, enum engine_id eng_id);
bool (*validate_bandwidth)(
struct dc *dc,
struct dc_state *context,
......@@ -210,6 +214,15 @@ struct resource_pool {
unsigned int underlay_pipe_index;
unsigned int stream_enc_count;
/* An array for accessing the link encoder objects that have been created.
* Index in array corresponds to engine ID - viz. 0: ENGINE_ID_DIGA
*/
struct link_encoder *link_encoders[MAX_DIG_LINK_ENCODERS];
/* Number of DIG link encoder objects created - i.e. number of valid
* entries in link_encoders array.
*/
unsigned int dig_link_enc_count;
#if defined(CONFIG_DRM_AMD_DC_DCN)
struct dc_3dlut *mpc_lut[MAX_PIPES];
struct dc_transfer_func *mpc_shaper[MAX_PIPES];
......
......@@ -36,6 +36,7 @@
#define MAX_AUDIOS 7
#define MAX_PIPES 6
#define MAX_DIG_LINK_ENCODERS 7
#define MAX_DWB_PIPES 1
struct gamma_curve {
......
......@@ -48,6 +48,7 @@ struct resource_caps {
int num_ddc;
int num_vmid;
int num_dsc;
unsigned int num_dig_link_enc; // Total number of DIGs (digital encoders) in DIO (Display Input/Output).
int num_mpc_3dlut;
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment