aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/linux-yocto-4.14.71/0718-drm-amd-display-Move-stream_enc-to-stream_res.patch
blob: 99ac5ff9af8c5e117e5e810c6a2bef5c7b6ff7d0 (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
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
From 09cdffb1ae9944c0ea080091e474346508d76d90 Mon Sep 17 00:00:00 2001
From: Harry Wentland <harry.wentland@amd.com>
Date: Sun, 30 Jul 2017 14:36:12 -0400
Subject: [PATCH 0718/4131] drm/amd/display: Move stream_enc to stream_res

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/pipes->stream_enc/pipes->stream_res\.stream_enc/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/ctx->stream_enc->/ctx->stream_res\.stream_enc->/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/pipe->stream_enc/pipe->stream_res\.stream_enc/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/pipe_ctx->stream_enc/pipe_ctx->stream_res\.stream_enc/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/pipe_ctx\[pipe_offset\]\.stream_enc/pipe_ctx\[pipe_offset\]\.stream_res\.stream_enc/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/grouped_pipes\[i\]->stream_enc/grouped_pipes\[i\]->stream_^Cs\.stream_enc/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/grouped_pipes\[0\]->stream_enc/grouped_pipes\[0\]->stream_res\.stream_enc/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/grouped_pipes\[1\]->stream_enc/grouped_pipes\[1\]->stream_res\.stream_enc/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/pipe_ctx\[i\]->stream_enc/pipe_ctx\[i\]->stream_res\.stream_enc/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/pipe_ctx_old->stream_enc/pipe_ctx_old->stream_res\.stream_enc/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/pipe_set\[j\]->stream_enc/pipe_set\[j\]->stream_res\.stream_enc/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/pipe_ctx\[i\]\.stream_enc/pipe_ctx\[i\]\.stream_res\.stream_enc/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i \
's/pipes\[i\]\.stream_enc/pipes\[i\]\.stream_res\.stream_enc/g'

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c           |  4 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link.c      | 12 ++--
 drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c   |  2 +-
 drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c |  6 +-
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  | 16 ++---
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    | 72 +++++++++++-----------
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  |  2 +-
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |  2 +-
 8 files changed, 58 insertions(+), 58 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index 61c2a21..748e709 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -161,7 +161,7 @@ static bool stream_adjust_vmin_vmax(struct dc *dc,
 	for (i = 0; i < MAX_PIPES; i++) {
 		struct pipe_ctx *pipe = &core_dc->current_context->res_ctx.pipe_ctx[i];
 
-		if (pipe->stream == stream && pipe->stream_enc) {
+		if (pipe->stream == stream && pipe->stream_res.stream_enc) {
 			core_dc->hwss.set_drr(&pipe, 1, vmin, vmax);
 
 			/* build and update the info frame */
@@ -189,7 +189,7 @@ static bool stream_get_crtc_position(struct dc *dc,
 		struct pipe_ctx *pipe =
 				&core_dc->current_context->res_ctx.pipe_ctx[i];
 
-		if (pipe->stream == stream && pipe->stream_enc) {
+		if (pipe->stream == stream && pipe->stream_res.stream_enc) {
 			core_dc->hwss.get_position(&pipe, 1, &position);
 
 			*v_pos = position.vertical_count;
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link.c b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
index 2c43edf..6a3d2ad 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link.c
@@ -1311,8 +1311,8 @@ static enum dc_status enable_link(struct pipe_ctx *pipe_ctx)
 
 		/* un-mute audio */
 		/* TODO: audio should be per stream rather than per link */
-		pipe_ctx->stream_enc->funcs->audio_mute_control(
-			pipe_ctx->stream_enc, false);
+		pipe_ctx->stream_res.stream_enc->funcs->audio_mute_control(
+			pipe_ctx->stream_res.stream_enc, false);
 	}
 
 	return status;
@@ -1699,7 +1699,7 @@ static enum dc_status allocate_mst_payload(struct pipe_ctx *pipe_ctx)
 	struct dc_stream_state *stream = pipe_ctx->stream;
 	struct dc_link *link = stream->sink->link;
 	struct link_encoder *link_encoder = link->link_enc;
-	struct stream_encoder *stream_encoder = pipe_ctx->stream_enc;
+	struct stream_encoder *stream_encoder = pipe_ctx->stream_res.stream_enc;
 	struct dp_mst_stream_allocation_table proposed_table = {0};
 	struct fixed31_32 avg_time_slots_per_mtp;
 	struct fixed31_32 pbn;
@@ -1718,7 +1718,7 @@ static enum dc_status allocate_mst_payload(struct pipe_ctx *pipe_ctx)
 		&proposed_table,
 		true)) {
 		update_mst_stream_alloc_table(
-					link, pipe_ctx->stream_enc, &proposed_table);
+					link, pipe_ctx->stream_res.stream_enc, &proposed_table);
 	}
 	else
 		dm_logger_write(link->ctx->logger, LOG_WARNING,
@@ -1781,7 +1781,7 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
 	struct dc_stream_state *stream = pipe_ctx->stream;
 	struct dc_link *link = stream->sink->link;
 	struct link_encoder *link_encoder = link->link_enc;
-	struct stream_encoder *stream_encoder = pipe_ctx->stream_enc;
+	struct stream_encoder *stream_encoder = pipe_ctx->stream_res.stream_enc;
 	struct dp_mst_stream_allocation_table proposed_table = {0};
 	struct fixed31_32 avg_time_slots_per_mtp = dal_fixed31_32_from_int(0);
 	uint8_t i;
@@ -1808,7 +1808,7 @@ static enum dc_status deallocate_mst_payload(struct pipe_ctx *pipe_ctx)
 				false)) {
 
 			update_mst_stream_alloc_table(
-				link, pipe_ctx->stream_enc, &proposed_table);
+				link, pipe_ctx->stream_res.stream_enc, &proposed_table);
 		}
 		else {
 				dm_logger_write(link->ctx->logger, LOG_WARNING,
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
index eda2594..3d296b1 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_dp.c
@@ -2464,7 +2464,7 @@ bool dc_link_dp_set_test_pattern(
 			 * MuteAudioEndpoint(pPathMode->pDisplayPath, true);
 			 */
 			/* Blank stream */
-			pipes->stream_enc->funcs->dp_blank(pipe_ctx->stream_enc);
+			pipes->stream_res.stream_enc->funcs->dp_blank(pipe_ctx->stream_res.stream_enc);
 		}
 
 		dp_set_hw_test_pattern(link, test_pattern,
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c b/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
index f2f57a7..7d52c6c 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_link_hwss.c
@@ -243,12 +243,12 @@ void dp_retrain_link_dp_test(struct dc_link *link,
 		if (pipes[i].stream != NULL &&
 			pipes[i].stream->sink != NULL &&
 			pipes[i].stream->sink->link != NULL &&
-			pipes[i].stream_enc != NULL &&
+			pipes[i].stream_res.stream_enc != NULL &&
 			pipes[i].stream->sink->link == link) {
 			dm_delay_in_microseconds(link->ctx, 100);
 
-			pipes[i].stream_enc->funcs->dp_blank(
-					pipes[i].stream_enc);
+			pipes[i].stream_res.stream_enc->funcs->dp_blank(
+					pipes[i].stream_res.stream_enc);
 
 			/* disable any test pattern that might be active */
 			dp_set_hw_test_pattern(link,
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 fcfd080..31a3535 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -925,7 +925,7 @@ struct pipe_ctx *resource_get_head_pipe_for_stream(
 	int i;
 	for (i = 0; i < MAX_PIPES; i++) {
 		if (res_ctx->pipe_ctx[i].stream == stream &&
-				res_ctx->pipe_ctx[i].stream_enc) {
+				res_ctx->pipe_ctx[i].stream_res.stream_enc) {
 			return &res_ctx->pipe_ctx[i];
 			break;
 		}
@@ -1096,7 +1096,7 @@ bool resource_attach_surfaces_to_context(
 		if (tail_pipe) {
 			free_pipe->stream_res.tg = tail_pipe->stream_res.tg;
 			free_pipe->stream_res.opp = tail_pipe->stream_res.opp;
-			free_pipe->stream_enc = tail_pipe->stream_enc;
+			free_pipe->stream_res.stream_enc = tail_pipe->stream_res.stream_enc;
 			free_pipe->audio = tail_pipe->audio;
 			free_pipe->clock_source = tail_pipe->clock_source;
 			free_pipe->top_pipe = tail_pipe;
@@ -1461,12 +1461,12 @@ enum dc_status resource_map_pool_resources(
 			copy_pipe_ctx(old_pipe_ctx, pipe_ctx);
 
 			/* Split pipe resource, do not acquire back end */
-			if (!pipe_ctx->stream_enc)
+			if (!pipe_ctx->stream_res.stream_enc)
 				continue;
 
 			set_stream_engine_in_use(
 				&context->res_ctx, pool,
-				pipe_ctx->stream_enc);
+				pipe_ctx->stream_res.stream_enc);
 
 			/* Switch to dp clock source only if there is
 			 * no non dp stream that shares the same timing
@@ -1503,16 +1503,16 @@ enum dc_status resource_map_pool_resources(
 
 		pipe_ctx = &context->res_ctx.pipe_ctx[pipe_idx];
 
-		pipe_ctx->stream_enc =
+		pipe_ctx->stream_res.stream_enc =
 			find_first_free_match_stream_enc_for_link(
 				&context->res_ctx, pool, stream);
 
-		if (!pipe_ctx->stream_enc)
+		if (!pipe_ctx->stream_res.stream_enc)
 			return DC_NO_STREAM_ENG_RESOURCE;
 
 		set_stream_engine_in_use(
 			&context->res_ctx, pool,
-			pipe_ctx->stream_enc);
+			pipe_ctx->stream_res.stream_enc);
 
 		/* TODO: Add check if ASIC support and EDID audio */
 		if (!stream->sink->converter_disable_audio &&
@@ -2382,7 +2382,7 @@ bool pipe_need_reprogram(
 			&& pipe_ctx_old->stream != pipe_ctx->stream)
 		return true;
 
-	if (pipe_ctx_old->stream_enc != pipe_ctx->stream_enc)
+	if (pipe_ctx_old->stream_res.stream_enc != pipe_ctx->stream_res.stream_enc)
 		return true;
 
 	if (is_timing_changed(pipe_ctx_old->stream, pipe_ctx->stream))
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
index 1d7c7fb..48d1510 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
@@ -659,7 +659,7 @@ static enum dc_status bios_parser_crtc_source_select(
 	struct bp_crtc_source_select crtc_source_select = {0};
 	const struct dc_sink *sink = pipe_ctx->stream->sink;
 
-	crtc_source_select.engine_id = pipe_ctx->stream_enc->id;
+	crtc_source_select.engine_id = pipe_ctx->stream_res.stream_enc->id;
 	crtc_source_select.controller_id = pipe_ctx->pipe_idx + 1;
 	/*TODO: Need to un-hardcode color depth, dp_audio and account for
 	 * the case where signal and sink signal is different (translator
@@ -684,16 +684,16 @@ void dce110_update_info_frame(struct pipe_ctx *pipe_ctx)
 {
 	ASSERT(pipe_ctx->stream);
 
-	if (pipe_ctx->stream_enc == NULL)
+	if (pipe_ctx->stream_res.stream_enc == NULL)
 		return;  /* this is not root pipe */
 
 	if (dc_is_hdmi_signal(pipe_ctx->stream->signal))
-		pipe_ctx->stream_enc->funcs->update_hdmi_info_packets(
-			pipe_ctx->stream_enc,
+		pipe_ctx->stream_res.stream_enc->funcs->update_hdmi_info_packets(
+			pipe_ctx->stream_res.stream_enc,
 			&pipe_ctx->encoder_info_frame);
 	else if (dc_is_dp_signal(pipe_ctx->stream->signal))
-		pipe_ctx->stream_enc->funcs->update_dp_info_packets(
-			pipe_ctx->stream_enc,
+		pipe_ctx->stream_res.stream_enc->funcs->update_dp_info_packets(
+			pipe_ctx->stream_res.stream_enc,
 			&pipe_ctx->encoder_info_frame);
 }
 
@@ -731,7 +731,7 @@ void dce110_enable_stream(struct pipe_ctx *pipe_ctx)
 	/* enable audio only within mode set */
 	if (pipe_ctx->audio != NULL) {
 		if (dc_is_dp_signal(pipe_ctx->stream->signal))
-			pipe_ctx->stream_enc->funcs->dp_audio_enable(pipe_ctx->stream_enc);
+			pipe_ctx->stream_res.stream_enc->funcs->dp_audio_enable(pipe_ctx->stream_res.stream_enc);
 	}
 
 	/* For MST, there are multiply stream go to only one link.
@@ -739,7 +739,7 @@ void dce110_enable_stream(struct pipe_ctx *pipe_ctx)
 	 * disconnect them during disable_stream
 	 * BY this, it is logic clean to separate stream and link */
 	 link->link_enc->funcs->connect_dig_be_to_fe(link->link_enc,
-			pipe_ctx->stream_enc->id, true);
+			pipe_ctx->stream_res.stream_enc->id, true);
 
 }
 
@@ -752,11 +752,11 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
 		pipe_ctx->audio->funcs->az_disable(pipe_ctx->audio);
 
 		if (dc_is_dp_signal(pipe_ctx->stream->signal))
-			pipe_ctx->stream_enc->funcs->dp_audio_disable(
-					pipe_ctx->stream_enc);
+			pipe_ctx->stream_res.stream_enc->funcs->dp_audio_disable(
+					pipe_ctx->stream_res.stream_enc);
 		else
-			pipe_ctx->stream_enc->funcs->hdmi_audio_disable(
-					pipe_ctx->stream_enc);
+			pipe_ctx->stream_res.stream_enc->funcs->hdmi_audio_disable(
+					pipe_ctx->stream_res.stream_enc);
 
 		pipe_ctx->audio = NULL;
 
@@ -768,24 +768,24 @@ void dce110_disable_stream(struct pipe_ctx *pipe_ctx)
 	}
 
 	if (dc_is_hdmi_signal(pipe_ctx->stream->signal))
-		pipe_ctx->stream_enc->funcs->stop_hdmi_info_packets(
-			pipe_ctx->stream_enc);
+		pipe_ctx->stream_res.stream_enc->funcs->stop_hdmi_info_packets(
+			pipe_ctx->stream_res.stream_enc);
 
 	if (dc_is_dp_signal(pipe_ctx->stream->signal))
-		pipe_ctx->stream_enc->funcs->stop_dp_info_packets(
-			pipe_ctx->stream_enc);
+		pipe_ctx->stream_res.stream_enc->funcs->stop_dp_info_packets(
+			pipe_ctx->stream_res.stream_enc);
 
-	pipe_ctx->stream_enc->funcs->audio_mute_control(
-			pipe_ctx->stream_enc, true);
+	pipe_ctx->stream_res.stream_enc->funcs->audio_mute_control(
+			pipe_ctx->stream_res.stream_enc, true);
 
 
 	/* blank at encoder level */
 	if (dc_is_dp_signal(pipe_ctx->stream->signal))
-		pipe_ctx->stream_enc->funcs->dp_blank(pipe_ctx->stream_enc);
+		pipe_ctx->stream_res.stream_enc->funcs->dp_blank(pipe_ctx->stream_res.stream_enc);
 
 	link->link_enc->funcs->connect_dig_be_to_fe(
 			link->link_enc,
-			pipe_ctx->stream_enc->id,
+			pipe_ctx->stream_res.stream_enc->id,
 			false);
 
 }
@@ -799,14 +799,14 @@ void dce110_unblank_stream(struct pipe_ctx *pipe_ctx,
 	params.pixel_clk_khz =
 		pipe_ctx->stream->timing.pix_clk_khz;
 	params.link_settings.link_rate = link_settings->link_rate;
-	pipe_ctx->stream_enc->funcs->dp_unblank(pipe_ctx->stream_enc, &params);
+	pipe_ctx->stream_res.stream_enc->funcs->dp_unblank(pipe_ctx->stream_res.stream_enc, &params);
 }
 
 
 void dce110_set_avmute(struct pipe_ctx *pipe_ctx, bool enable)
 {
-	if (pipe_ctx != NULL && pipe_ctx->stream_enc != NULL)
-		pipe_ctx->stream_enc->funcs->set_avmute(pipe_ctx->stream_enc, enable);
+	if (pipe_ctx != NULL && pipe_ctx->stream_res.stream_enc != NULL)
+		pipe_ctx->stream_res.stream_enc->funcs->set_avmute(pipe_ctx->stream_res.stream_enc, enable);
 }
 
 static enum audio_dto_source translate_to_dto_source(enum controller_id crtc_id)
@@ -834,7 +834,7 @@ static void build_audio_output(
 	struct audio_output *audio_output)
 {
 	const struct dc_stream_state *stream = pipe_ctx->stream;
-	audio_output->engine_id = pipe_ctx->stream_enc->id;
+	audio_output->engine_id = pipe_ctx->stream_res.stream_enc->id;
 
 	audio_output->signal = pipe_ctx->stream->signal;
 
@@ -1071,8 +1071,8 @@ static enum dc_status apply_single_controller_ctx_to_hw(
 			pipe_ctx->stream->signal);
 
 	if (pipe_ctx->stream->signal != SIGNAL_TYPE_VIRTUAL)
-		pipe_ctx->stream_enc->funcs->setup_stereo_sync(
-		pipe_ctx->stream_enc,
+		pipe_ctx->stream_res.stream_enc->funcs->setup_stereo_sync(
+		pipe_ctx->stream_res.stream_enc,
 		pipe_ctx->stream_res.tg->inst,
 		stream->timing.timing_3d_format != TIMING_3D_FORMAT_NONE);
 
@@ -1084,21 +1084,21 @@ static enum dc_status apply_single_controller_ctx_to_hw(
 			&stream->clamping);
 
 	if (dc_is_dp_signal(pipe_ctx->stream->signal))
-		pipe_ctx->stream_enc->funcs->dp_set_stream_attribute(
-			pipe_ctx->stream_enc,
+		pipe_ctx->stream_res.stream_enc->funcs->dp_set_stream_attribute(
+			pipe_ctx->stream_res.stream_enc,
 			&stream->timing,
 			stream->output_color_space);
 
 	if (dc_is_hdmi_signal(pipe_ctx->stream->signal))
-		pipe_ctx->stream_enc->funcs->hdmi_set_stream_attribute(
-			pipe_ctx->stream_enc,
+		pipe_ctx->stream_res.stream_enc->funcs->hdmi_set_stream_attribute(
+			pipe_ctx->stream_res.stream_enc,
 			&stream->timing,
 			stream->phy_pix_clk,
 			pipe_ctx->audio != NULL);
 
 	if (dc_is_dvi_signal(pipe_ctx->stream->signal))
-		pipe_ctx->stream_enc->funcs->dvi_set_stream_attribute(
-			pipe_ctx->stream_enc,
+		pipe_ctx->stream_res.stream_enc->funcs->dvi_set_stream_attribute(
+			pipe_ctx->stream_res.stream_enc,
 			&stream->timing,
 			(pipe_ctx->stream->signal == SIGNAL_TYPE_DVI_DUAL_LINK) ?
 			true : false);
@@ -1860,13 +1860,13 @@ enum dc_status dce110_apply_ctx_to_hw(
 			build_audio_output(pipe_ctx, &audio_output);
 
 			if (dc_is_dp_signal(pipe_ctx->stream->signal))
-				pipe_ctx->stream_enc->funcs->dp_audio_setup(
-						pipe_ctx->stream_enc,
+				pipe_ctx->stream_res.stream_enc->funcs->dp_audio_setup(
+						pipe_ctx->stream_res.stream_enc,
 						pipe_ctx->audio->inst,
 						&pipe_ctx->stream->audio_info);
 			else
-				pipe_ctx->stream_enc->funcs->hdmi_audio_setup(
-						pipe_ctx->stream_enc,
+				pipe_ctx->stream_res.stream_enc->funcs->hdmi_audio_setup(
+						pipe_ctx->stream_res.stream_enc,
 						pipe_ctx->audio->inst,
 						&pipe_ctx->stream->audio_info,
 						&audio_output.crtc_info);
diff --git a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
index 99ef0f2..16ac963 100644
--- a/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c
@@ -770,7 +770,7 @@ static void reset_back_end_for_pipe(
 {
 	int i;
 
-	if (pipe_ctx->stream_enc == NULL) {
+	if (pipe_ctx->stream_res.stream_enc == NULL) {
 		pipe_ctx->stream = NULL;
 		return;
 	}
diff --git a/drivers/gpu/drm/amd/display/dc/inc/core_types.h b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
index 488ade3..4d35c6d 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/core_types.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
@@ -155,6 +155,7 @@ struct resource_pool {
 struct stream_resource {
 	struct output_pixel_processor *opp;
 	struct timing_generator *tg;
+	struct stream_encoder *stream_enc;
 };
 
 struct plane_resource {
@@ -172,7 +173,6 @@ struct pipe_ctx {
 	struct plane_resource plane_res;
 	struct stream_resource stream_res;
 
-	struct stream_encoder *stream_enc;
 	struct display_clock *dis_clk;
 	struct clock_source *clock_source;
 
-- 
2.7.4