Commit d9673c92 authored by Harry Wentland's avatar Harry Wentland Committed by Alex Deucher

drm/amd/display: Pass init_data into DCN resource creation

[WHY]
The resource constructor currently needs num_virtual_links from
init_data but will need access to other items provided by DM.

[HOW]
Pass init_data into DCN create_resource_pool functions.
Signed-off-by: default avatarHarry Wentland <harry.wentland@amd.com>
Reviewed-by: default avatarNicholas Kazlauskas <Nicholas.Kazlauskas@amd.com>
Acked-by: default avatarBhawanpreet Lakha <Bhawanpreet.Lakha@amd.com>
Acked-by: default avatarHersen Wu <hersenxs.wu@amd.com>
Signed-off-by: default avatarAlex Deucher <alexander.deucher@amd.com>
parent a504ad26
...@@ -735,11 +735,7 @@ static bool construct(struct dc *dc, ...@@ -735,11 +735,7 @@ static bool construct(struct dc *dc,
goto fail; goto fail;
} }
dc->res_pool = dc_create_resource_pool( dc->res_pool = dc_create_resource_pool(dc, init_params, dc_version);
dc,
init_params->num_virtual_links,
dc_version,
init_params->asic_id);
if (!dc->res_pool) if (!dc->res_pool)
goto fail; goto fail;
......
...@@ -106,44 +106,43 @@ enum dce_version resource_parse_asic_id(struct hw_asic_id asic_id) ...@@ -106,44 +106,43 @@ enum dce_version resource_parse_asic_id(struct hw_asic_id asic_id)
return dc_version; return dc_version;
} }
struct resource_pool *dc_create_resource_pool( struct resource_pool *dc_create_resource_pool(struct dc *dc,
struct dc *dc, const struct dc_init_data *init_data,
int num_virtual_links, enum dce_version dc_version)
enum dce_version dc_version,
struct hw_asic_id asic_id)
{ {
struct resource_pool *res_pool = NULL; struct resource_pool *res_pool = NULL;
switch (dc_version) { switch (dc_version) {
case DCE_VERSION_8_0: case DCE_VERSION_8_0:
res_pool = dce80_create_resource_pool( res_pool = dce80_create_resource_pool(
num_virtual_links, dc); init_data->num_virtual_links, dc);
break; break;
case DCE_VERSION_8_1: case DCE_VERSION_8_1:
res_pool = dce81_create_resource_pool( res_pool = dce81_create_resource_pool(
num_virtual_links, dc); init_data->num_virtual_links, dc);
break; break;
case DCE_VERSION_8_3: case DCE_VERSION_8_3:
res_pool = dce83_create_resource_pool( res_pool = dce83_create_resource_pool(
num_virtual_links, dc); init_data->num_virtual_links, dc);
break; break;
case DCE_VERSION_10_0: case DCE_VERSION_10_0:
res_pool = dce100_create_resource_pool( res_pool = dce100_create_resource_pool(
num_virtual_links, dc); init_data->num_virtual_links, dc);
break; break;
case DCE_VERSION_11_0: case DCE_VERSION_11_0:
res_pool = dce110_create_resource_pool( res_pool = dce110_create_resource_pool(
num_virtual_links, dc, asic_id); init_data->num_virtual_links, dc,
init_data->asic_id);
break; break;
case DCE_VERSION_11_2: case DCE_VERSION_11_2:
case DCE_VERSION_11_22: case DCE_VERSION_11_22:
res_pool = dce112_create_resource_pool( res_pool = dce112_create_resource_pool(
num_virtual_links, dc); init_data->num_virtual_links, dc);
break; break;
case DCE_VERSION_12_0: case DCE_VERSION_12_0:
case DCE_VERSION_12_1: case DCE_VERSION_12_1:
res_pool = dce120_create_resource_pool( res_pool = dce120_create_resource_pool(
num_virtual_links, dc); init_data->num_virtual_links, dc);
break; break;
#if defined(CONFIG_DRM_AMD_DC_DCN1_0) #if defined(CONFIG_DRM_AMD_DC_DCN1_0)
...@@ -151,8 +150,7 @@ struct resource_pool *dc_create_resource_pool( ...@@ -151,8 +150,7 @@ struct resource_pool *dc_create_resource_pool(
#if defined(CONFIG_DRM_AMD_DC_DCN1_01) #if defined(CONFIG_DRM_AMD_DC_DCN1_01)
case DCN_VERSION_1_01: case DCN_VERSION_1_01:
#endif #endif
res_pool = dcn10_create_resource_pool( res_pool = dcn10_create_resource_pool(init_data, dc);
num_virtual_links, dc);
break; break;
#endif #endif
......
...@@ -1528,7 +1528,7 @@ static bool construct( ...@@ -1528,7 +1528,7 @@ static bool construct(
} }
struct resource_pool *dcn10_create_resource_pool( struct resource_pool *dcn10_create_resource_pool(
uint8_t num_virtual_links, const struct dc_init_data *init_data,
struct dc *dc) struct dc *dc)
{ {
struct dcn10_resource_pool *pool = struct dcn10_resource_pool *pool =
...@@ -1537,7 +1537,7 @@ struct resource_pool *dcn10_create_resource_pool( ...@@ -1537,7 +1537,7 @@ struct resource_pool *dcn10_create_resource_pool(
if (!pool) if (!pool)
return NULL; return NULL;
if (construct(num_virtual_links, dc, pool)) if (construct(init_data->num_virtual_links, dc, pool))
return &pool->base; return &pool->base;
BREAK_TO_DEBUGGER(); BREAK_TO_DEBUGGER();
......
...@@ -39,7 +39,7 @@ struct dcn10_resource_pool { ...@@ -39,7 +39,7 @@ struct dcn10_resource_pool {
struct resource_pool base; struct resource_pool base;
}; };
struct resource_pool *dcn10_create_resource_pool( struct resource_pool *dcn10_create_resource_pool(
uint8_t num_virtual_links, const struct dc_init_data *init_data,
struct dc *dc); struct dc *dc);
......
...@@ -70,11 +70,9 @@ bool resource_construct( ...@@ -70,11 +70,9 @@ bool resource_construct(
struct resource_pool *pool, struct resource_pool *pool,
const struct resource_create_funcs *create_funcs); const struct resource_create_funcs *create_funcs);
struct resource_pool *dc_create_resource_pool( struct resource_pool *dc_create_resource_pool(struct dc *dc,
struct dc *dc, const struct dc_init_data *init_data,
int num_virtual_links, enum dce_version dc_version);
enum dce_version dc_version,
struct hw_asic_id asic_id);
void dc_destroy_resource_pool(struct dc *dc); void dc_destroy_resource_pool(struct dc *dc);
......
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