aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarry Wentland <harry.wentland@amd.com>2019-02-13 16:20:27 -0500
committerAlex Deucher <alexander.deucher@amd.com>2019-03-27 23:41:40 -0400
commitd9673c920c035df8f17445d5c81142dbe4bf51a0 (patch)
tree352cf410a5cffa4ef242b27d883231c45ffcbbdf
parenta504ad265dec380d7314b8e02984c8d294ab0bd5 (diff)
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: Harry Wentland <harry.wentland@amd.com> Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com> Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Acked-by: Hersen Wu <hersenxs.wu@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc.c6
-rw-r--r--drivers/gpu/drm/amd/display/dc/core/dc_resource.c26
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c4
-rw-r--r--drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.h2
-rw-r--r--drivers/gpu/drm/amd/display/dc/inc/resource.h8
5 files changed, 19 insertions, 27 deletions
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 699e1ee75035..c7415772e280 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -735,11 +735,7 @@ static bool construct(struct dc *dc,
735 goto fail; 735 goto fail;
736 } 736 }
737 737
738 dc->res_pool = dc_create_resource_pool( 738 dc->res_pool = dc_create_resource_pool(dc, init_params, dc_version);
739 dc,
740 init_params->num_virtual_links,
741 dc_version,
742 init_params->asic_id);
743 if (!dc->res_pool) 739 if (!dc->res_pool)
744 goto fail; 740 goto fail;
745 741
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
index 4a651d7dd052..42ef04230ea2 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -106,44 +106,43 @@ enum dce_version resource_parse_asic_id(struct hw_asic_id asic_id)
106 return dc_version; 106 return dc_version;
107} 107}
108 108
109struct resource_pool *dc_create_resource_pool( 109struct resource_pool *dc_create_resource_pool(struct dc *dc,
110 struct dc *dc, 110 const struct dc_init_data *init_data,
111 int num_virtual_links, 111 enum dce_version dc_version)
112 enum dce_version dc_version,
113 struct hw_asic_id asic_id)
114{ 112{
115 struct resource_pool *res_pool = NULL; 113 struct resource_pool *res_pool = NULL;
116 114
117 switch (dc_version) { 115 switch (dc_version) {
118 case DCE_VERSION_8_0: 116 case DCE_VERSION_8_0:
119 res_pool = dce80_create_resource_pool( 117 res_pool = dce80_create_resource_pool(
120 num_virtual_links, dc); 118 init_data->num_virtual_links, dc);
121 break; 119 break;
122 case DCE_VERSION_8_1: 120 case DCE_VERSION_8_1:
123 res_pool = dce81_create_resource_pool( 121 res_pool = dce81_create_resource_pool(
124 num_virtual_links, dc); 122 init_data->num_virtual_links, dc);
125 break; 123 break;
126 case DCE_VERSION_8_3: 124 case DCE_VERSION_8_3:
127 res_pool = dce83_create_resource_pool( 125 res_pool = dce83_create_resource_pool(
128 num_virtual_links, dc); 126 init_data->num_virtual_links, dc);
129 break; 127 break;
130 case DCE_VERSION_10_0: 128 case DCE_VERSION_10_0:
131 res_pool = dce100_create_resource_pool( 129 res_pool = dce100_create_resource_pool(
132 num_virtual_links, dc); 130 init_data->num_virtual_links, dc);
133 break; 131 break;
134 case DCE_VERSION_11_0: 132 case DCE_VERSION_11_0:
135 res_pool = dce110_create_resource_pool( 133 res_pool = dce110_create_resource_pool(
136 num_virtual_links, dc, asic_id); 134 init_data->num_virtual_links, dc,
135 init_data->asic_id);
137 break; 136 break;
138 case DCE_VERSION_11_2: 137 case DCE_VERSION_11_2:
139 case DCE_VERSION_11_22: 138 case DCE_VERSION_11_22:
140 res_pool = dce112_create_resource_pool( 139 res_pool = dce112_create_resource_pool(
141 num_virtual_links, dc); 140 init_data->num_virtual_links, dc);
142 break; 141 break;
143 case DCE_VERSION_12_0: 142 case DCE_VERSION_12_0:
144 case DCE_VERSION_12_1: 143 case DCE_VERSION_12_1:
145 res_pool = dce120_create_resource_pool( 144 res_pool = dce120_create_resource_pool(
146 num_virtual_links, dc); 145 init_data->num_virtual_links, dc);
147 break; 146 break;
148 147
149#if defined(CONFIG_DRM_AMD_DC_DCN1_0) 148#if defined(CONFIG_DRM_AMD_DC_DCN1_0)
@@ -151,8 +150,7 @@ struct resource_pool *dc_create_resource_pool(
151#if defined(CONFIG_DRM_AMD_DC_DCN1_01) 150#if defined(CONFIG_DRM_AMD_DC_DCN1_01)
152 case DCN_VERSION_1_01: 151 case DCN_VERSION_1_01:
153#endif 152#endif
154 res_pool = dcn10_create_resource_pool( 153 res_pool = dcn10_create_resource_pool(init_data, dc);
155 num_virtual_links, dc);
156 break; 154 break;
157#endif 155#endif
158 156
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
index 29f8893e44b6..7c37836bb9cc 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.c
@@ -1528,7 +1528,7 @@ fail:
1528} 1528}
1529 1529
1530struct resource_pool *dcn10_create_resource_pool( 1530struct resource_pool *dcn10_create_resource_pool(
1531 uint8_t num_virtual_links, 1531 const struct dc_init_data *init_data,
1532 struct dc *dc) 1532 struct dc *dc)
1533{ 1533{
1534 struct dcn10_resource_pool *pool = 1534 struct dcn10_resource_pool *pool =
@@ -1537,7 +1537,7 @@ struct resource_pool *dcn10_create_resource_pool(
1537 if (!pool) 1537 if (!pool)
1538 return NULL; 1538 return NULL;
1539 1539
1540 if (construct(num_virtual_links, dc, pool)) 1540 if (construct(init_data->num_virtual_links, dc, pool))
1541 return &pool->base; 1541 return &pool->base;
1542 1542
1543 BREAK_TO_DEBUGGER(); 1543 BREAK_TO_DEBUGGER();
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.h b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.h
index 8f71225bc61b..999c684a0b36 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.h
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_resource.h
@@ -39,7 +39,7 @@ struct dcn10_resource_pool {
39 struct resource_pool base; 39 struct resource_pool base;
40}; 40};
41struct resource_pool *dcn10_create_resource_pool( 41struct resource_pool *dcn10_create_resource_pool(
42 uint8_t num_virtual_links, 42 const struct dc_init_data *init_data,
43 struct dc *dc); 43 struct dc *dc);
44 44
45 45
diff --git a/drivers/gpu/drm/amd/display/dc/inc/resource.h b/drivers/gpu/drm/amd/display/dc/inc/resource.h
index 028c63061767..0a70254d204f 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/resource.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/resource.h
@@ -70,11 +70,9 @@ bool resource_construct(
70 struct resource_pool *pool, 70 struct resource_pool *pool,
71 const struct resource_create_funcs *create_funcs); 71 const struct resource_create_funcs *create_funcs);
72 72
73struct resource_pool *dc_create_resource_pool( 73struct resource_pool *dc_create_resource_pool(struct dc *dc,
74 struct dc *dc, 74 const struct dc_init_data *init_data,
75 int num_virtual_links, 75 enum dce_version dc_version);
76 enum dce_version dc_version,
77 struct hw_asic_id asic_id);
78 76
79void dc_destroy_resource_pool(struct dc *dc); 77void dc_destroy_resource_pool(struct dc *dc);
80 78