aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0878-drm-amd-dal-Start-calling-create_links-for-diag.patch
blob: f01c488b2cb8116eb3e330b11c5dc5790ae304d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
From ec6ea01b7ddafd72ebf915d74446cfdd30fdf850 Mon Sep 17 00:00:00 2001
From: Jordan Lazare <Jordan.Lazare@amd.com>
Date: Thu, 3 Mar 2016 17:25:56 -0500
Subject: [PATCH 0878/1110] drm/amd/dal: Start calling create_links for diag

Also store bios pointer inside dc_context rather than in AS
as a step of removing adapter service

Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/dal/dc/core/dc.c  | 79 +++++++++++++++++++----------------
 drivers/gpu/drm/amd/dal/dc/dc_types.h |  2 +
 2 files changed, 45 insertions(+), 36 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c
index a25741d..3a6d0c1 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c
@@ -80,7 +80,7 @@ static bool create_links(
 
 	dc->link_count = 0;
 
-	dcb = dal_adapter_service_get_bios_parser(as);
+	dcb = dc->ctx->dc_bios;
 
 	connectors_num = dcb->funcs->get_connectors_number(dcb);
 
@@ -169,7 +169,7 @@ static void init_hw(struct core_dc *dc)
 	struct dc_bios *bp;
 	struct transform *xfm;
 
-	bp = dal_adapter_service_get_bios_parser(dc->res_pool.adapter_srv);
+	bp = dc->ctx->dc_bios;
 	for (i = 0; i < dc->res_pool.pipe_count; i++) {
 		xfm = dc->res_pool.transforms[i];
 
@@ -330,48 +330,55 @@ static bool construct(struct core_dc *dc, const struct dc_init_data *init_params
 	dc_version = resource_parse_asic_id(init_params->asic_id);
 
 
-/* TODO: Refactor DCE code to remove AS and asic caps */
-if (dc_version < DCE_VERSION_MAX) {
-	/* Create adapter service */
-	as = create_as(init_params, dc_ctx);
+	/* TODO: Refactor DCE code to remove AS and asic caps */
+	if (dc_version < DCE_VERSION_MAX) {
+		/* Create adapter service */
+		as = create_as(init_params, dc_ctx);
 
-	if (!as) {
-		dm_error("%s: create_as() failed!\n", __func__);
-		goto as_fail;
-	}
+		if (!as) {
+			dm_error("%s: create_as() failed!\n", __func__);
+			goto as_fail;
+		}
 
-	/* Initialize HW controlled by Adapter Service */
-	if (false == dal_adapter_service_initialize_hw_data(
-			as)) {
-		dm_error("%s: dal_adapter_service_initialize_hw_data()"\
-				"  failed!\n", __func__);
-		/* Note that AS exist, so have to destroy it.*/
-		goto as_fail;
-	}
+		/* Initialize HW controlled by Adapter Service */
+		if (false == dal_adapter_service_initialize_hw_data(
+				as)) {
+			dm_error("%s: dal_adapter_service_initialize_hw_data()"\
+					"  failed!\n", __func__);
+			/* Note that AS exist, so have to destroy it.*/
+			goto as_fail;
+		}
 
-	/* Create hardware sequencer */
-	if (!dc_construct_hw_sequencer(as, dc))
-		goto hwss_fail;
+		dc_ctx->dc_bios = dal_adapter_service_get_bios_parser(as);
 
-	if (!dc_construct_resource_pool(
-		as, dc, init_params->num_virtual_links, dc_version))
-		goto construct_resource_fail;
+		/* Create hardware sequencer */
+		if (!dc_construct_hw_sequencer(as, dc))
+			goto hwss_fail;
 
-	if (!create_links(dc, as, init_params->num_virtual_links))
-		goto create_links_fail;
+		if (!dc_construct_resource_pool(
+			as, dc, init_params->num_virtual_links, dc_version))
+			goto construct_resource_fail;
 
-	bw_calcs_init(&dc->bw_dceip, &dc->bw_vbios);
+		if (!create_links(dc, as, init_params->num_virtual_links))
+			goto create_links_fail;
 
-	bw_calcs_data_update_from_pplib(dc);
-} else {
+		bw_calcs_init(&dc->bw_dceip, &dc->bw_vbios);
 
-	/* Resource should construct all asic specific resources.
-	 * This should be the only place where we need to parse the asic id
-	 */
-	if (!dc_construct_resource_pool(
-		NULL, dc, init_params->num_virtual_links, dc_version))
-		goto construct_resource_fail;
-}
+		bw_calcs_data_update_from_pplib(dc);
+	} else {
+
+		/* Resource should construct all asic specific resources.
+		 * This should be the only place where we need to parse the asic id
+		 */
+
+		dc_ctx->dc_bios = init_params->vbios_override;
+		if (!dc_construct_resource_pool(
+			NULL, dc, init_params->num_virtual_links, dc_version))
+			goto construct_resource_fail;
+
+		if (!create_links(dc, NULL, init_params->num_virtual_links))
+			goto create_links_fail;
+	}
 
 	return true;
 
diff --git a/drivers/gpu/drm/amd/dal/dc/dc_types.h b/drivers/gpu/drm/amd/dal/dc/dc_types.h
index a0a8542..d3d105e 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc_types.h
@@ -80,6 +80,8 @@ struct dc_context {
 	void *cgs_device;
 
 	enum dce_environment dce_environment;
+
+	struct dc_bios *dc_bios;
 };
 
 /*
-- 
2.7.4