aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/1061-drm-amd-dal-Remove-empty-audio-base-class-functions.patch
blob: c9f3b784aa901da0df22165877ecd29a329c0c82 (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
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
From 14fac719f849ec900a007a8c5a0fa99fde57debd Mon Sep 17 00:00:00 2001
From: Harry Wentland <harry.wentland@amd.com>
Date: Wed, 20 Apr 2016 17:05:19 -0400
Subject: [PATCH 1061/1110] drm/amd/dal: Remove empty audio base class
 functions

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 .../amd/dal/dc/audio/dce110/hw_ctx_audio_dce110.c  |  10 -
 .../amd/dal/dc/audio/dce80/hw_ctx_audio_dce80.c    |  12 -
 drivers/gpu/drm/amd/dal/dc/audio/hw_ctx_audio.c    | 267 ---------------------
 drivers/gpu/drm/amd/dal/dc/audio/hw_ctx_audio.h    |   3 -
 4 files changed, 292 deletions(-)

diff --git a/drivers/gpu/drm/amd/dal/dc/audio/dce110/hw_ctx_audio_dce110.c b/drivers/gpu/drm/amd/dal/dc/audio/dce110/hw_ctx_audio_dce110.c
index d8a674d..d2769c7 100644
--- a/drivers/gpu/drm/amd/dal/dc/audio/dce110/hw_ctx_audio_dce110.c
+++ b/drivers/gpu/drm/amd/dal/dc/audio/dce110/hw_ctx_audio_dce110.c
@@ -57,12 +57,6 @@ static const uint32_t engine_offset[] = {
 	mmDIG5_DIG_FE_CNTL - mmDIG0_DIG_FE_CNTL
 };
 
-static void destruct(
-	struct hw_ctx_audio_dce110 *hw_ctx_dce110)
-{
-	dal_audio_destruct_hw_ctx_audio(&hw_ctx_dce110->base);
-}
-
 static void destroy(
 	struct hw_ctx_audio **ptr)
 {
@@ -71,7 +65,6 @@ static void destroy(
 	hw_ctx_dce110 = container_of(
 		*ptr, struct hw_ctx_audio_dce110, base);
 
-	destruct(hw_ctx_dce110);
 	/* release memory allocated for struct hw_ctx_audio_dce110 */
 	dm_free(hw_ctx_dce110);
 
@@ -1832,9 +1825,6 @@ static bool construct(
 {
 	struct hw_ctx_audio *base = &hw_ctx->base;
 
-	if (!dal_audio_construct_hw_ctx_audio(base))
-		return false;
-
 	base->funcs = &funcs;
 
 	/* save audio endpoint or dig front for current dce110 audio object */
diff --git a/drivers/gpu/drm/amd/dal/dc/audio/dce80/hw_ctx_audio_dce80.c b/drivers/gpu/drm/amd/dal/dc/audio/dce80/hw_ctx_audio_dce80.c
index 5f6a433..3b2fb52 100644
--- a/drivers/gpu/drm/amd/dal/dc/audio/dce80/hw_ctx_audio_dce80.c
+++ b/drivers/gpu/drm/amd/dal/dc/audio/dce80/hw_ctx_audio_dce80.c
@@ -66,7 +66,6 @@ static void destroy(
 	hw_ctx_dce80 = container_of(
 		*ptr, struct hw_ctx_audio_dce80, base);
 
-	dal_audio_destruct_hw_ctx_audio_dce80(hw_ctx_dce80);
 	/* release memory allocated for struct hw_ctx_audio_dce80 */
 	dm_free(hw_ctx_dce80);
 
@@ -1773,9 +1772,6 @@ bool dal_audio_construct_hw_ctx_audio_dce80(
 {
 	struct hw_ctx_audio *base = &hw_ctx->base;
 
-	if (!dal_audio_construct_hw_ctx_audio(base))
-		return false;
-
 	base->funcs = &funcs;
 
 	/* save audio endpoint or dig front for current dce80 audio object */
@@ -1857,14 +1853,6 @@ bool dal_audio_construct_hw_ctx_audio_dce80(
 	return true;
 }
 
-/* audio_dce80 is derived from audio directly, not via dce80  */
-
-void dal_audio_destruct_hw_ctx_audio_dce80(
-	struct hw_ctx_audio_dce80 *hw_ctx_dce80)
-{
-	dal_audio_destruct_hw_ctx_audio(&hw_ctx_dce80->base);
-}
-
 struct hw_ctx_audio *dal_audio_create_hw_ctx_audio_dce80(
 	struct dc_context *ctx,
 	uint32_t azalia_stream_id)
diff --git a/drivers/gpu/drm/amd/dal/dc/audio/hw_ctx_audio.c b/drivers/gpu/drm/amd/dal/dc/audio/hw_ctx_audio.c
index 6d88771..606e98b 100644
--- a/drivers/gpu/drm/amd/dal/dc/audio/hw_ctx_audio.c
+++ b/drivers/gpu/drm/amd/dal/dc/audio/hw_ctx_audio.c
@@ -87,215 +87,6 @@ static const struct audio_clock_info audio_clock_info_table_48bpc[12] = {
 
 /***** static function *****/
 
-/*
- * except of HW context create function, caller will access other functions of
- * hw ctx via handle hw_ctx. Memory allocation for struct hw_ctx_audio_dce8x
- * will happen in hw_ctx_audio_dce8x. Memory allocation is done with
- * dal_audio_create_hw_ctx_audio_dce8x. Memory release is done by caller
- * via hw_ctx->functions.destroy(). It will finally use destroy() of
- * hw_ctx_audio_dce8x. Therefore, no memory allocate and release happen
- * physically at hw ctx base object.
- */
-static void destroy(
-	struct hw_ctx_audio **ptr)
-{
-	/* Attention!
-	 * You must override this method in derived class */
-}
-
-static void setup_audio_wall_dto(
-	const struct hw_ctx_audio *hw_ctx,
-	enum signal_type signal,
-	const struct audio_crtc_info *crtc_info,
-	const struct audio_pll_info *pll_info)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
-/* setup HDMI audio */
-static void setup_hdmi_audio(
-	const struct hw_ctx_audio *hw_ctx,
-	enum engine_id engine_id,
-	const struct audio_crtc_info *crtc_info)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
- /* setup DP audio */
-static void setup_dp_audio(
-	const struct hw_ctx_audio *hw_ctx,
-	enum engine_id engine_id)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
- /* setup VCE audio */
-static void setup_vce_audio(
-	const struct hw_ctx_audio *hw_ctx)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
-/* enable Azalia audio */
-static void enable_azalia_audio(
-	const struct hw_ctx_audio *hw_ctx,
-	enum engine_id engine_id)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
-/* disable Azalia audio */
-static void disable_azalia_audio(
-	const struct hw_ctx_audio *hw_ctx,
-	enum engine_id engine_id)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
-/* enable DP audio */
-static void enable_dp_audio(
-	const struct hw_ctx_audio *hw_ctx,
-	enum engine_id engine_id)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
-/* disable DP audio */
-static void disable_dp_audio(
-	const struct hw_ctx_audio *hw_ctx,
-	enum engine_id engine_id)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
-/* setup Azalia HW block */
-static void setup_azalia(
-	const struct hw_ctx_audio *hw_ctx,
-	enum engine_id engine_id,
-	enum signal_type signal,
-	const struct audio_crtc_info *crtc_info,
-	const struct audio_pll_info *pll_info,
-	const struct audio_info *audio_info)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
-/* unmute audio */
-static void unmute_azalia_audio(
-	const struct hw_ctx_audio *hw_ctx,
-	enum engine_id engine_id)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
-/* mute audio */
-static void mute_azalia_audio(
-	const struct hw_ctx_audio *hw_ctx,
-	enum engine_id engine_id)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
-/* enable channel splitting mapping */
-static void setup_channel_splitting_mapping(
-	const struct hw_ctx_audio *hw_ctx,
-	enum engine_id engine_id,
-	enum signal_type signal,
-	const struct audio_channel_associate_info *audio_mapping,
-	bool enable)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
-/* get current channel spliting */
-static bool get_channel_splitting_mapping(
-	const struct hw_ctx_audio *hw_ctx,
-	enum engine_id engine_id,
-	struct audio_channel_associate_info *audio_mapping)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-	return false;
-}
-
-/* set the payload value for the unsolicited response */
-static void set_unsolicited_response_payload(
-	const struct hw_ctx_audio *hw_ctx,
-	enum audio_payload payload)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
-/* initialize HW state */
-static void hw_initialize(
-	const struct hw_ctx_audio *hw_ctx)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
-/* Assign GTC group and enable GTC value embedding */
-static void enable_gtc_embedding_with_group(
-	const struct hw_ctx_audio *hw_ctx,
-	uint32_t groupNum,
-	uint32_t audioLatency)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
-/* Disable GTC value embedding */
-static void disable_gtc_embedding(
-	const struct hw_ctx_audio *hw_ctx)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
-/* Disable Azalia Clock Gating Feature */
-static void disable_az_clock_gating(
-	const struct hw_ctx_audio *hw_ctx)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-}
-
-/* search pixel clock value for Azalia HDMI Audio */
-static bool get_azalia_clock_info_hdmi(
-	const struct hw_ctx_audio *hw_ctx,
-	uint32_t crtc_pixel_clock_in_khz,
-	uint32_t actual_pixel_clock_in_khz,
-	struct azalia_clock_info *azalia_clock_info)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-	return false;
-}
-
-/* search pixel clock value for Azalia DP Audio */
-static bool get_azalia_clock_info_dp(
-	const struct hw_ctx_audio *hw_ctx,
-	uint32_t requested_pixel_clock_in_khz,
-	const struct audio_pll_info *pll_info,
-	struct azalia_clock_info *azalia_clock_info)
-{
-	/*DCE specific, must be implemented in derived*/
-	BREAK_TO_DEBUGGER();
-	return false;
-}
 
 /*****SCOPE : within audio hw context dal-audio-hw-ctx *****/
 
@@ -700,61 +491,3 @@ bool dal_audio_hw_ctx_get_audio_clock_info(
 	return true;
 }
 
-static const struct hw_ctx_audio_funcs funcs = {
-	.destroy = destroy,
-	.setup_audio_wall_dto =
-		setup_audio_wall_dto,
-	.setup_hdmi_audio =
-		setup_hdmi_audio,
-	.setup_dp_audio = setup_dp_audio,
-	.setup_vce_audio = setup_vce_audio,
-	.enable_azalia_audio =
-		enable_azalia_audio,
-	.disable_azalia_audio =
-		disable_azalia_audio,
-	.enable_dp_audio =
-		enable_dp_audio,
-	.disable_dp_audio =
-		disable_dp_audio,
-	.setup_azalia =
-		setup_azalia,
-	.disable_az_clock_gating =
-		disable_az_clock_gating,
-	.unmute_azalia_audio =
-		unmute_azalia_audio,
-	.mute_azalia_audio =
-		mute_azalia_audio,
-	.setup_channel_splitting_mapping =
-		setup_channel_splitting_mapping,
-	.get_channel_splitting_mapping =
-		get_channel_splitting_mapping,
-	.set_unsolicited_response_payload =
-		set_unsolicited_response_payload,
-	.hw_initialize =
-		hw_initialize,
-	.enable_gtc_embedding_with_group =
-		enable_gtc_embedding_with_group,
-	.disable_gtc_embedding =
-		disable_gtc_embedding,
-	.get_azalia_clock_info_hdmi =
-		get_azalia_clock_info_hdmi,
-	.get_azalia_clock_info_dp =
-		get_azalia_clock_info_dp,
-};
-/* --- object creator, destroy, construct, destruct --- */
-
-bool dal_audio_construct_hw_ctx_audio(
-	struct hw_ctx_audio *ctx)
-{
-	ctx->funcs = &funcs;
-
-	/* internal variables */
-
-	return true;
-}
-
-void dal_audio_destruct_hw_ctx_audio(
-	struct hw_ctx_audio *ctx)
-{
-	/* nothing to do */
-}
diff --git a/drivers/gpu/drm/amd/dal/dc/audio/hw_ctx_audio.h b/drivers/gpu/drm/amd/dal/dc/audio/hw_ctx_audio.h
index 52865c8..8143cd5 100644
--- a/drivers/gpu/drm/amd/dal/dc/audio/hw_ctx_audio.h
+++ b/drivers/gpu/drm/amd/dal/dc/audio/hw_ctx_audio.h
@@ -206,9 +206,6 @@ struct hw_ctx_audio {
 bool dal_audio_construct_hw_ctx_audio(
 	struct hw_ctx_audio *hw_ctx);
 
-void dal_audio_destruct_hw_ctx_audio(
-	struct hw_ctx_audio *hw_ctx);
-
 /*
  *creator of audio HW context will be implemented by specific ASIC object only.
  *Top base or interface object does not have implementation of creator.
-- 
2.7.4