aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/1014-drm-amd-dal-drop-set_scratch_connected.patch
blob: 4af7c0c4c402f3e32235fdaba5544b6b679b04e3 (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
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
From f7b93015ff2b31e5104a1c75f1b76d2ff414841e Mon Sep 17 00:00:00 2001
From: Dave Airlie <airlied@redhat.com>
Date: Mon, 11 Apr 2016 17:30:36 +1000
Subject: [PATCH 1014/1110] drm/amd/dal: drop set_scratch_connected

this isn't used anywhere

Signed-off-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/dal/dc/bios/bios_parser.c      | 31 -------
 .../gpu/drm/amd/dal/dc/bios/bios_parser_helper.h   |  5 --
 .../dal/dc/bios/dce110/bios_parser_helper_dce110.c | 89 --------------------
 .../dal/dc/bios/dce80/bios_parser_helper_dce80.c   | 96 ----------------------
 drivers/gpu/drm/amd/dal/dc/dc_bios_types.h         |  4 -
 5 files changed, 225 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.c b/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.c
index cdf674d..ddb5fc8 100644
--- a/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.c
+++ b/drivers/gpu/drm/amd/dal/dc/bios/bios_parser.c
@@ -4140,37 +4140,6 @@ bool dc_bios_is_accelerated_mode(struct dc_bios *dcb)
 }
 
 /**
- * bios_parser_set_scratch_connected
- *
- * @brief
- *  update VBIOS scratch register about connected displays
- *
- * @param
- *  bool - update scratch register or just prepare info to be updated
- *  bool - connection state
- *  const ConnectorDeviceTagInfo* - pointer to device type and enum ID
- */
-void dc_bios_set_scratch_connected(
-	struct dc_bios *dcb,
-	struct graphics_object_id connector_id,
-	bool connected,
-	const struct connector_device_tag_info *device_tag)
-{
-	struct bios_parser *bp = BP_FROM_DCB(dcb);
-
-#ifdef CONFIG_DRM_AMD_DAL_VBIOS_PRESENT
-	bp->bios_helper->set_scratch_connected(
-			bp->ctx,
-			connector_id, connected, device_tag);
-#else
-	dal_logger_write(bp->ctx->logger,
-			LOG_MAJOR_BIOS,
-			LOG_MINOR_BIOS_CMD_TABLE,
-			"%s: VBIOS is not supported", __func__);
-#endif
-}
-
-/**
  * bios_parser_set_scratch_critical_state
  *
  * @brief
diff --git a/drivers/gpu/drm/amd/dal/dc/bios/bios_parser_helper.h b/drivers/gpu/drm/amd/dal/dc/bios/bios_parser_helper.h
index b93b046..124a11e 100644
--- a/drivers/gpu/drm/amd/dal/dc/bios/bios_parser_helper.h
+++ b/drivers/gpu/drm/amd/dal/dc/bios/bios_parser_helper.h
@@ -72,11 +72,6 @@ struct bios_parser_helper {
 	void (*set_scratch_active_and_requested)(
 		struct dc_context *ctx,
 		struct vbios_helper_data *d);
-	void (*set_scratch_connected)(
-		struct dc_context *ctx,
-		struct graphics_object_id id,
-		bool connected,
-		const struct connector_device_tag_info *device_tag);
 	void (*set_scratch_lcd_scale)(
 		struct dc_context *ctx,
 		enum lcd_scale lcd_scale_request);
diff --git a/drivers/gpu/drm/amd/dal/dc/bios/dce110/bios_parser_helper_dce110.c b/drivers/gpu/drm/amd/dal/dc/bios/dce110/bios_parser_helper_dce110.c
index 85d3103..924957e 100644
--- a/drivers/gpu/drm/amd/dal/dc/bios/dce110/bios_parser_helper_dce110.c
+++ b/drivers/gpu/drm/amd/dal/dc/bios/dce110/bios_parser_helper_dce110.c
@@ -312,94 +312,6 @@ static enum signal_type detect_sink(
 	return SIGNAL_TYPE_NONE;
 }
 
-/**
- * set_scratch_connected
- *
- * @brief
- *    update BIOS_SCRATCH_0 register about connected displays
- *
- * @param
- * bool - update scratch register or just prepare info to be updated
- * bool - connection state
- * const struct connector_device_tag_info * - pointer to device type and enum ID
- */
-static void set_scratch_connected(
-	struct dc_context *ctx,
-	struct graphics_object_id id,
-	bool connected,
-	const struct connector_device_tag_info *device_tag)
-{
-	uint32_t addr = 0;
-	uint32_t value = 0;
-	uint32_t update = 0;
-
-	switch (device_tag->dev_id.device_type) {
-	case DEVICE_TYPE_LCD:
-		/* For LCD VBIOS will update LCD Panel connected bit always and
-		 * Lid state bit based on SBIOS info do not do anything here
-		 * for LCD
-		 */
-		break;
-	case DEVICE_TYPE_CRT:
-		/*
-		 * CRT is not supported in DCE11
-		 */
-		break;
-	case DEVICE_TYPE_DFP:
-		switch (device_tag->dev_id.enum_id) {
-		case 1:
-			update |= ATOM_S0_DFP1;
-			break;
-		case 2:
-			update |= ATOM_S0_DFP2;
-			break;
-		case 3:
-			update |= ATOM_S0_DFP3;
-			break;
-		case 4:
-			update |= ATOM_S0_DFP4;
-			break;
-		case 5:
-			update |= ATOM_S0_DFP5;
-			break;
-		case 6:
-			update |= ATOM_S0_DFP6;
-			break;
-		default:
-			break;
-		}
-		break;
-	case DEVICE_TYPE_CV:
-		/* DCE 8.0 does not support CV,
-		 * so don't do anything */
-		break;
-
-	case DEVICE_TYPE_TV:
-		/* For TV VBIOS will update S-Video or
-		 * Composite scratch bits on DAL_LoadDetect
-		 * when called by driver, do not do anything
-		 * here for TV
-		 */
-		break;
-
-	default:
-		break;
-
-	}
-
-	/* update scratch register */
-	addr = mmBIOS_SCRATCH_0 + ATOM_DEVICE_CONNECT_INFO_DEF;
-
-	value = dm_read_reg(ctx, addr);
-
-	if (connected)
-		value |= update;
-	else
-		value &= ~update;
-
-	dm_write_reg(ctx, addr, value);
-}
-
 static void set_scratch_critical_state(
 	struct dc_context *ctx,
 	bool state)
@@ -460,7 +372,6 @@ static const struct bios_parser_helper bios_parser_helper_funcs = {
 			prepare_scratch_active_and_requested,
 	.set_scratch_acc_mode_change = set_scratch_acc_mode_change,
 	.set_scratch_active_and_requested = set_scratch_active_and_requested,
-	.set_scratch_connected = set_scratch_connected,
 	.set_scratch_critical_state = set_scratch_critical_state,
 	.set_scratch_lcd_scale = set_scratch_lcd_scale,
 	.take_backlight_control = NULL,
diff --git a/drivers/gpu/drm/amd/dal/dc/bios/dce80/bios_parser_helper_dce80.c b/drivers/gpu/drm/amd/dal/dc/bios/dce80/bios_parser_helper_dce80.c
index 4973132..3963129 100644
--- a/drivers/gpu/drm/amd/dal/dc/bios/dce80/bios_parser_helper_dce80.c
+++ b/drivers/gpu/drm/amd/dal/dc/bios/dce80/bios_parser_helper_dce80.c
@@ -352,101 +352,6 @@ static void set_scratch_active_and_requested(
 	d->requested = 0;
 }
 
-/**
- * set_scratch_connected
- *
- * @brief
- *    update BIOS_SCRATCH_0 register about connected displays
- *
- * @param
- * bool - update scratch register or just prepare info to be updated
- * bool - connection state
- * const struct connector_device_tag_info * - pointer to device type and enum ID
- */
-static void set_scratch_connected(
-	struct dc_context *ctx,
-	struct graphics_object_id id,
-	bool connected,
-	const struct connector_device_tag_info *device_tag)
-{
-	uint32_t addr = 0;
-	uint32_t value = 0;
-	uint32_t update = 0;
-
-	switch (device_tag->dev_id.device_type) {
-	case DEVICE_TYPE_LCD:
-		/* For LCD VBIOS will update LCD Panel connected bit always and
-		 * Lid state bit based on SBIOS info do not do anything here
-		 * for LCD
-		 */
-		break;
-	case DEVICE_TYPE_CRT:
-		switch (device_tag->dev_id.enum_id) {
-		case 1:
-			update |= ATOM_S0_CRT1_COLOR;
-			break;
-		case 2:
-			update |= ATOM_S0_CRT2_COLOR;
-			break;
-		default:
-			break;
-		}
-		break;
-	case DEVICE_TYPE_DFP:
-		switch (device_tag->dev_id.enum_id) {
-		case 1:
-			update |= ATOM_S0_DFP1;
-			break;
-		case 2:
-			update |= ATOM_S0_DFP2;
-			break;
-		case 3:
-			update |= ATOM_S0_DFP3;
-			break;
-		case 4:
-			update |= ATOM_S0_DFP4;
-			break;
-		case 5:
-			update |= ATOM_S0_DFP5;
-			break;
-		case 6:
-			update |= ATOM_S0_DFP6;
-			break;
-		default:
-			break;
-		}
-		break;
-	case DEVICE_TYPE_CV:
-		/* DCE 8.0 does not support CV,
-		 * so don't do anything */
-		break;
-
-	case DEVICE_TYPE_TV:
-		/* For TV VBIOS will update S-Video or
-		 * Composite scratch bits on DAL_LoadDetect
-		 * when called by driver, do not do anything
-		 * here for TV
-		 */
-		break;
-
-	default:
-		break;
-
-	}
-
-	/* update scratch register */
-	addr = mmBIOS_SCRATCH_0 + ATOM_DEVICE_CONNECT_INFO_DEF;
-
-	value = dm_read_reg(ctx, addr);
-
-	if (connected)
-		value |= update;
-	else
-		value &= ~update;
-
-	dm_write_reg(ctx, addr, value);
-}
-
 static void set_scratch_lcd_scale(
 	struct dc_context *ctx,
 	enum lcd_scale lcd_scale_request)
@@ -759,7 +664,6 @@ static const struct bios_parser_helper bios_parser_helper_funcs = {
 		prepare_scratch_active_and_requested,
 	.set_scratch_acc_mode_change = set_scratch_acc_mode_change,
 	.set_scratch_active_and_requested = set_scratch_active_and_requested,
-	.set_scratch_connected = set_scratch_connected,
 	.set_scratch_critical_state = set_scratch_critical_state,
 	.set_scratch_lcd_scale = set_scratch_lcd_scale,
 	.take_backlight_control = take_backlight_control,
diff --git a/drivers/gpu/drm/amd/dal/dc/dc_bios_types.h b/drivers/gpu/drm/amd/dal/dc/dc_bios_types.h
index fa7b1fe..458dcac 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc_bios_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc_bios_types.h
@@ -147,10 +147,6 @@ enum controller_id dc_bios_get_embedded_display_controller_id(struct dc_bios *bi
 uint32_t dc_bios_get_embedded_display_refresh_rate(struct dc_bios *bios);
 #endif
 
-void dc_bios_set_scratch_connected(struct dc_bios *bios,
-				   struct graphics_object_id connector_id,
-				   bool connected,
-				   const struct connector_device_tag_info *device_tag);
 void dc_bios_prepare_scratch_active_and_requested(struct dc_bios *bios,
 						  enum controller_id controller_id,
 						  enum signal_type signal,
-- 
2.7.4