aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0714-drm-amd-display-Move-scl_data-to-plane_res.patch
blob: d4d854c5d27d4808a04a4a5bce9b874fdfb9d1db (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
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
From ad41547a31617928b8c03bb54c996ddb6f8b9d4d Mon Sep 17 00:00:00 2001
From: Harry Wentland <harry.wentland@amd.com>
Date: Sun, 30 Jul 2017 11:51:21 -0400
Subject: [PATCH 0714/4131] drm/amd/display: Move scl_data to plane_res

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/\.scl_data/\.plane_res.scl_data/g'

find -name Makefile -o -name Kconfig -o -name "*.c" -o -name "*.h" \
-o -name "*.cpp" -o -name "*.hpp" | \
xargs sed -i 's/->scl_data/->plane_res.scl_data/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/calcs/dce_calcs.c   |  36 ++++----
 drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c   |  84 ++++++++---------
 drivers/gpu/drm/amd/display/dc/core/dc_resource.c  | 100 ++++++++++-----------
 drivers/gpu/drm/amd/display/dc/core/dc_stream.c    |   6 +-
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    |  34 +++----
 .../drm/amd/display/dc/dcn10/dcn10_hw_sequencer.c  |  28 +++---
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |   4 +-
 7 files changed, 145 insertions(+), 147 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
index 28dbd18..dba2585 100644
--- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
+++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
@@ -2613,13 +2613,13 @@ static void populate_initial_data(
 		data->h_total[num_displays + 4] = bw_int_to_fixed(pipe[i].stream->timing.h_total);
 		data->v_total[num_displays + 4] = bw_int_to_fixed(pipe[i].stream->timing.v_total);
 		data->pixel_rate[num_displays + 4] = bw_frc_to_fixed(pipe[i].stream->timing.pix_clk_khz, 1000);
-		data->src_width[num_displays + 4] = bw_int_to_fixed(pipe[i].scl_data.viewport.width);
+		data->src_width[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.viewport.width);
 		data->pitch_in_pixels[num_displays + 4] = data->src_width[num_displays + 4];
-		data->src_height[num_displays + 4] = bw_int_to_fixed(pipe[i].scl_data.viewport.height);
-		data->h_taps[num_displays + 4] = bw_int_to_fixed(pipe[i].scl_data.taps.h_taps);
-		data->v_taps[num_displays + 4] = bw_int_to_fixed(pipe[i].scl_data.taps.v_taps);
-		data->h_scale_ratio[num_displays + 4] = fixed31_32_to_bw_fixed(pipe[i].scl_data.ratios.horz.value);
-		data->v_scale_ratio[num_displays + 4] = fixed31_32_to_bw_fixed(pipe[i].scl_data.ratios.vert.value);
+		data->src_height[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.viewport.height);
+		data->h_taps[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.taps.h_taps);
+		data->v_taps[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.taps.v_taps);
+		data->h_scale_ratio[num_displays + 4] = fixed31_32_to_bw_fixed(pipe[i].plane_res.scl_data.ratios.horz.value);
+		data->v_scale_ratio[num_displays + 4] = fixed31_32_to_bw_fixed(pipe[i].plane_res.scl_data.ratios.vert.value);
 		switch (pipe[i].plane_state->rotation) {
 		case ROTATION_ANGLE_0:
 			data->rotation_angle[num_displays + 4] = bw_int_to_fixed(0);
@@ -2667,16 +2667,16 @@ static void populate_initial_data(
 			data->fbc_en[num_displays * 2 + j] = false;
 			data->lpt_en[num_displays * 2 + j] = false;
 
-			data->src_height[num_displays * 2 + j] = bw_int_to_fixed(pipe[i].bottom_pipe->scl_data.viewport.height);
-			data->src_width[num_displays * 2 + j] = bw_int_to_fixed(pipe[i].bottom_pipe->scl_data.viewport.width);
+			data->src_height[num_displays * 2 + j] = bw_int_to_fixed(pipe[i].bottom_pipe->plane_res.scl_data.viewport.height);
+			data->src_width[num_displays * 2 + j] = bw_int_to_fixed(pipe[i].bottom_pipe->plane_res.scl_data.viewport.width);
 			data->pitch_in_pixels[num_displays * 2 + j] = bw_int_to_fixed(
 					pipe[i].bottom_pipe->plane_state->plane_size.grph.surface_pitch);
-			data->h_taps[num_displays * 2 + j] = bw_int_to_fixed(pipe[i].bottom_pipe->scl_data.taps.h_taps);
-			data->v_taps[num_displays * 2 + j] = bw_int_to_fixed(pipe[i].bottom_pipe->scl_data.taps.v_taps);
+			data->h_taps[num_displays * 2 + j] = bw_int_to_fixed(pipe[i].bottom_pipe->plane_res.scl_data.taps.h_taps);
+			data->v_taps[num_displays * 2 + j] = bw_int_to_fixed(pipe[i].bottom_pipe->plane_res.scl_data.taps.v_taps);
 			data->h_scale_ratio[num_displays * 2 + j] = fixed31_32_to_bw_fixed(
-					pipe[i].bottom_pipe->scl_data.ratios.horz.value);
+					pipe[i].bottom_pipe->plane_res.scl_data.ratios.horz.value);
 			data->v_scale_ratio[num_displays * 2 + j] = fixed31_32_to_bw_fixed(
-					pipe[i].bottom_pipe->scl_data.ratios.vert.value);
+					pipe[i].bottom_pipe->plane_res.scl_data.ratios.vert.value);
 			switch (pipe[i].bottom_pipe->plane_state->rotation) {
 			case ROTATION_ANGLE_0:
 				data->rotation_angle[num_displays * 2 + j] = bw_int_to_fixed(0);
@@ -2711,13 +2711,13 @@ static void populate_initial_data(
 		data->v_total[num_displays + 4] = bw_int_to_fixed(pipe[i].stream->timing.v_total);
 		data->pixel_rate[num_displays + 4] = bw_frc_to_fixed(pipe[i].stream->timing.pix_clk_khz, 1000);
 		if (pipe[i].plane_state) {
-			data->src_width[num_displays + 4] = bw_int_to_fixed(pipe[i].scl_data.viewport.width);
+			data->src_width[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.viewport.width);
 			data->pitch_in_pixels[num_displays + 4] = data->src_width[num_displays + 4];
-			data->src_height[num_displays + 4] = bw_int_to_fixed(pipe[i].scl_data.viewport.height);
-			data->h_taps[num_displays + 4] = bw_int_to_fixed(pipe[i].scl_data.taps.h_taps);
-			data->v_taps[num_displays + 4] = bw_int_to_fixed(pipe[i].scl_data.taps.v_taps);
-			data->h_scale_ratio[num_displays + 4] = fixed31_32_to_bw_fixed(pipe[i].scl_data.ratios.horz.value);
-			data->v_scale_ratio[num_displays + 4] = fixed31_32_to_bw_fixed(pipe[i].scl_data.ratios.vert.value);
+			data->src_height[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.viewport.height);
+			data->h_taps[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.taps.h_taps);
+			data->v_taps[num_displays + 4] = bw_int_to_fixed(pipe[i].plane_res.scl_data.taps.v_taps);
+			data->h_scale_ratio[num_displays + 4] = fixed31_32_to_bw_fixed(pipe[i].plane_res.scl_data.ratios.horz.value);
+			data->v_scale_ratio[num_displays + 4] = fixed31_32_to_bw_fixed(pipe[i].plane_res.scl_data.ratios.vert.value);
 			switch (pipe[i].plane_state->rotation) {
 			case ROTATION_ANGLE_0:
 				data->rotation_angle[num_displays + 4] = bw_int_to_fixed(0);
diff --git a/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
index 404b39e..cb76200 100644
--- a/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
+++ b/drivers/gpu/drm/amd/display/dc/calcs/dcn_calcs.c
@@ -244,10 +244,10 @@ static void pipe_ctx_to_e2e_pipe_params (
 	input->src.source_scan         = dm_horz;
 	input->src.sw_mode             = pipe->plane_state->tiling_info.gfx9.swizzle;
 
-	input->src.viewport_width      = pipe->scl_data.viewport.width;
-	input->src.viewport_height     = pipe->scl_data.viewport.height;
-	input->src.data_pitch          = pipe->scl_data.viewport.width;
-	input->src.data_pitch_c        = pipe->scl_data.viewport.width;
+	input->src.viewport_width      = pipe->plane_res.scl_data.viewport.width;
+	input->src.viewport_height     = pipe->plane_res.scl_data.viewport.height;
+	input->src.data_pitch          = pipe->plane_res.scl_data.viewport.width;
+	input->src.data_pitch_c        = pipe->plane_res.scl_data.viewport.width;
 	input->src.cur0_src_width      = 128; /* TODO: Cursor calcs, not curently stored */
 	input->src.cur0_bpp            = 32;
 
@@ -341,21 +341,21 @@ static void pipe_ctx_to_e2e_pipe_params (
 		break;
 	}
 
-	input->scale_taps.htaps                = pipe->scl_data.taps.h_taps;
-	input->scale_ratio_depth.hscl_ratio    = pipe->scl_data.ratios.horz.value/4294967296.0;
-	input->scale_ratio_depth.vscl_ratio    = pipe->scl_data.ratios.vert.value/4294967296.0;
-	input->scale_ratio_depth.vinit =  pipe->scl_data.inits.v.value/4294967296.0;
+	input->scale_taps.htaps                = pipe->plane_res.scl_data.taps.h_taps;
+	input->scale_ratio_depth.hscl_ratio    = pipe->plane_res.scl_data.ratios.horz.value/4294967296.0;
+	input->scale_ratio_depth.vscl_ratio    = pipe->plane_res.scl_data.ratios.vert.value/4294967296.0;
+	input->scale_ratio_depth.vinit =  pipe->plane_res.scl_data.inits.v.value/4294967296.0;
 	if (input->scale_ratio_depth.vinit < 1.0)
 			input->scale_ratio_depth.vinit = 1;
-	input->scale_taps.vtaps = pipe->scl_data.taps.v_taps;
-	input->scale_taps.vtaps_c = pipe->scl_data.taps.v_taps_c;
-	input->scale_taps.htaps_c              = pipe->scl_data.taps.h_taps_c;
-	input->scale_ratio_depth.hscl_ratio_c  = pipe->scl_data.ratios.horz_c.value/4294967296.0;
-	input->scale_ratio_depth.vscl_ratio_c  = pipe->scl_data.ratios.vert_c.value/4294967296.0;
-	input->scale_ratio_depth.vinit_c       = pipe->scl_data.inits.v_c.value/4294967296.0;
+	input->scale_taps.vtaps = pipe->plane_res.scl_data.taps.v_taps;
+	input->scale_taps.vtaps_c = pipe->plane_res.scl_data.taps.v_taps_c;
+	input->scale_taps.htaps_c              = pipe->plane_res.scl_data.taps.h_taps_c;
+	input->scale_ratio_depth.hscl_ratio_c  = pipe->plane_res.scl_data.ratios.horz_c.value/4294967296.0;
+	input->scale_ratio_depth.vscl_ratio_c  = pipe->plane_res.scl_data.ratios.vert_c.value/4294967296.0;
+	input->scale_ratio_depth.vinit_c       = pipe->plane_res.scl_data.inits.v_c.value/4294967296.0;
 	if (input->scale_ratio_depth.vinit_c < 1.0)
 			input->scale_ratio_depth.vinit_c = 1;
-	switch (pipe->scl_data.lb_params.depth) {
+	switch (pipe->plane_res.scl_data.lb_params.depth) {
 	case LB_PIXEL_DEPTH_30BPP:
 		input->scale_ratio_depth.lb_depth = 30; break;
 	case LB_PIXEL_DEPTH_36BPP:
@@ -367,11 +367,11 @@ static void pipe_ctx_to_e2e_pipe_params (
 
 	input->dest.vactive        = pipe->stream->timing.v_addressable;
 
-	input->dest.recout_width   = pipe->scl_data.recout.width;
-	input->dest.recout_height  = pipe->scl_data.recout.height;
+	input->dest.recout_width   = pipe->plane_res.scl_data.recout.width;
+	input->dest.recout_height  = pipe->plane_res.scl_data.recout.height;
 
-	input->dest.full_recout_width   = pipe->scl_data.recout.width;
-	input->dest.full_recout_height  = pipe->scl_data.recout.height;
+	input->dest.full_recout_width   = pipe->plane_res.scl_data.recout.width;
+	input->dest.full_recout_height  = pipe->plane_res.scl_data.recout.height;
 
 	input->dest.htotal         = pipe->stream->timing.h_total;
 	input->dest.hblank_start   = input->dest.htotal - pipe->stream->timing.h_front_porch;
@@ -885,38 +885,38 @@ bool dcn_validate_bandwidth(
 			v->source_scan[input_idx] = dcn_bw_hor;
 
 		} else {
-			v->viewport_height[input_idx] =  pipe->scl_data.viewport.height;
-			v->viewport_width[input_idx] = pipe->scl_data.viewport.width;
-			v->scaler_rec_out_width[input_idx] = pipe->scl_data.recout.width;
-			v->scaler_recout_height[input_idx] = pipe->scl_data.recout.height;
+			v->viewport_height[input_idx] =  pipe->plane_res.scl_data.viewport.height;
+			v->viewport_width[input_idx] = pipe->plane_res.scl_data.viewport.width;
+			v->scaler_rec_out_width[input_idx] = pipe->plane_res.scl_data.recout.width;
+			v->scaler_recout_height[input_idx] = pipe->plane_res.scl_data.recout.height;
 			if (pipe->bottom_pipe && pipe->bottom_pipe->plane_state == pipe->plane_state) {
 				if (pipe->plane_state->rotation % 2 == 0) {
-					int viewport_end = pipe->scl_data.viewport.width
-							+ pipe->scl_data.viewport.x;
-					int viewport_b_end = pipe->bottom_pipe->scl_data.viewport.width
-							+ pipe->bottom_pipe->scl_data.viewport.x;
+					int viewport_end = pipe->plane_res.scl_data.viewport.width
+							+ pipe->plane_res.scl_data.viewport.x;
+					int viewport_b_end = pipe->bottom_pipe->plane_res.scl_data.viewport.width
+							+ pipe->bottom_pipe->plane_res.scl_data.viewport.x;
 
 					if (viewport_end > viewport_b_end)
 						v->viewport_width[input_idx] = viewport_end
-							- pipe->bottom_pipe->scl_data.viewport.x;
+							- pipe->bottom_pipe->plane_res.scl_data.viewport.x;
 					else
 						v->viewport_width[input_idx] = viewport_b_end
-									- pipe->scl_data.viewport.x;
+									- pipe->plane_res.scl_data.viewport.x;
 				} else  {
-					int viewport_end = pipe->scl_data.viewport.height
-						+ pipe->scl_data.viewport.y;
-					int viewport_b_end = pipe->bottom_pipe->scl_data.viewport.height
-						+ pipe->bottom_pipe->scl_data.viewport.y;
+					int viewport_end = pipe->plane_res.scl_data.viewport.height
+						+ pipe->plane_res.scl_data.viewport.y;
+					int viewport_b_end = pipe->bottom_pipe->plane_res.scl_data.viewport.height
+						+ pipe->bottom_pipe->plane_res.scl_data.viewport.y;
 
 					if (viewport_end > viewport_b_end)
 						v->viewport_height[input_idx] = viewport_end
-							- pipe->bottom_pipe->scl_data.viewport.y;
+							- pipe->bottom_pipe->plane_res.scl_data.viewport.y;
 					else
 						v->viewport_height[input_idx] = viewport_b_end
-									- pipe->scl_data.viewport.y;
+									- pipe->plane_res.scl_data.viewport.y;
 				}
-				v->scaler_rec_out_width[input_idx] = pipe->scl_data.recout.width
-						+ pipe->bottom_pipe->scl_data.recout.width;
+				v->scaler_rec_out_width[input_idx] = pipe->plane_res.scl_data.recout.width
+						+ pipe->bottom_pipe->plane_res.scl_data.recout.width;
 			}
 
 			v->dcc_enable[input_idx] = pipe->plane_state->dcc.enable ? dcn_bw_yes : dcn_bw_no;
@@ -924,11 +924,11 @@ bool dcn_validate_bandwidth(
 					pipe->plane_state->format);
 			v->source_surface_mode[input_idx] = tl_sw_mode_to_bw_defs(
 					pipe->plane_state->tiling_info.gfx9.swizzle);
-			v->lb_bit_per_pixel[input_idx] = tl_lb_bpp_to_int(pipe->scl_data.lb_params.depth);
-			v->override_hta_ps[input_idx] = pipe->scl_data.taps.h_taps;
-			v->override_vta_ps[input_idx] = pipe->scl_data.taps.v_taps;
-			v->override_hta_pschroma[input_idx] = pipe->scl_data.taps.h_taps_c;
-			v->override_vta_pschroma[input_idx] = pipe->scl_data.taps.v_taps_c;
+			v->lb_bit_per_pixel[input_idx] = tl_lb_bpp_to_int(pipe->plane_res.scl_data.lb_params.depth);
+			v->override_hta_ps[input_idx] = pipe->plane_res.scl_data.taps.h_taps;
+			v->override_vta_ps[input_idx] = pipe->plane_res.scl_data.taps.v_taps;
+			v->override_hta_pschroma[input_idx] = pipe->plane_res.scl_data.taps.h_taps_c;
+			v->override_vta_pschroma[input_idx] = pipe->plane_res.scl_data.taps.v_taps_c;
 			v->source_scan[input_idx] = (pipe->plane_state->rotation % 2) ? dcn_bw_vert : dcn_bw_hor;
 		}
 		if (v->is_line_buffer_bpp_fixed == dcn_bw_yes)
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 7c30962..4917dbb 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_resource.c
@@ -432,7 +432,7 @@ static void calculate_viewport(struct pipe_ctx *pipe_ctx)
 {
 	const struct dc_plane_state *plane_state = pipe_ctx->plane_state;
 	const struct dc_stream_state *stream = pipe_ctx->stream;
-	struct scaler_data *data = &pipe_ctx->scl_data;
+	struct scaler_data *data = &pipe_ctx->plane_res.scl_data;
 	struct rect surf_src = plane_state->src_rect;
 	struct rect clip = { 0 };
 	int vpc_div = (data->format == PIXEL_FORMAT_420BPP8
@@ -539,53 +539,53 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx, struct view *recout_skip
 			pipe_ctx->plane_state->rotation == ROTATION_ANGLE_270)
 		rect_swap_helper(&surf_src);
 
-	pipe_ctx->scl_data.recout.x = stream->dst.x;
+	pipe_ctx->plane_res.scl_data.recout.x = stream->dst.x;
 	if (stream->src.x < surf_clip.x)
-		pipe_ctx->scl_data.recout.x += (surf_clip.x
+		pipe_ctx->plane_res.scl_data.recout.x += (surf_clip.x
 			- stream->src.x) * stream->dst.width
 						/ stream->src.width;
 
-	pipe_ctx->scl_data.recout.width = surf_clip.width *
+	pipe_ctx->plane_res.scl_data.recout.width = surf_clip.width *
 			stream->dst.width / stream->src.width;
-	if (pipe_ctx->scl_data.recout.width + pipe_ctx->scl_data.recout.x >
+	if (pipe_ctx->plane_res.scl_data.recout.width + pipe_ctx->plane_res.scl_data.recout.x >
 			stream->dst.x + stream->dst.width)
-		pipe_ctx->scl_data.recout.width =
+		pipe_ctx->plane_res.scl_data.recout.width =
 			stream->dst.x + stream->dst.width
-						- pipe_ctx->scl_data.recout.x;
+						- pipe_ctx->plane_res.scl_data.recout.x;
 
-	pipe_ctx->scl_data.recout.y = stream->dst.y;
+	pipe_ctx->plane_res.scl_data.recout.y = stream->dst.y;
 	if (stream->src.y < surf_clip.y)
-		pipe_ctx->scl_data.recout.y += (surf_clip.y
+		pipe_ctx->plane_res.scl_data.recout.y += (surf_clip.y
 			- stream->src.y) * stream->dst.height
 						/ stream->src.height;
 
-	pipe_ctx->scl_data.recout.height = surf_clip.height *
+	pipe_ctx->plane_res.scl_data.recout.height = surf_clip.height *
 			stream->dst.height / stream->src.height;
-	if (pipe_ctx->scl_data.recout.height + pipe_ctx->scl_data.recout.y >
+	if (pipe_ctx->plane_res.scl_data.recout.height + pipe_ctx->plane_res.scl_data.recout.y >
 			stream->dst.y + stream->dst.height)
-		pipe_ctx->scl_data.recout.height =
+		pipe_ctx->plane_res.scl_data.recout.height =
 			stream->dst.y + stream->dst.height
-						- pipe_ctx->scl_data.recout.y;
+						- pipe_ctx->plane_res.scl_data.recout.y;
 
 	/* Handle h & vsplit */
 	if (pipe_ctx->top_pipe && pipe_ctx->top_pipe->plane_state ==
 		pipe_ctx->plane_state) {
 		if (stream->view_format == VIEW_3D_FORMAT_TOP_AND_BOTTOM) {
-			pipe_ctx->scl_data.recout.height /= 2;
-			pipe_ctx->scl_data.recout.y += pipe_ctx->scl_data.recout.height;
+			pipe_ctx->plane_res.scl_data.recout.height /= 2;
+			pipe_ctx->plane_res.scl_data.recout.y += pipe_ctx->plane_res.scl_data.recout.height;
 			/* Floor primary pipe, ceil 2ndary pipe */
-			pipe_ctx->scl_data.recout.height += pipe_ctx->scl_data.recout.height % 2;
+			pipe_ctx->plane_res.scl_data.recout.height += pipe_ctx->plane_res.scl_data.recout.height % 2;
 		} else {
-			pipe_ctx->scl_data.recout.width /= 2;
-			pipe_ctx->scl_data.recout.x += pipe_ctx->scl_data.recout.width;
-			pipe_ctx->scl_data.recout.width += pipe_ctx->scl_data.recout.width % 2;
+			pipe_ctx->plane_res.scl_data.recout.width /= 2;
+			pipe_ctx->plane_res.scl_data.recout.x += pipe_ctx->plane_res.scl_data.recout.width;
+			pipe_ctx->plane_res.scl_data.recout.width += pipe_ctx->plane_res.scl_data.recout.width % 2;
 		}
 	} else if (pipe_ctx->bottom_pipe &&
 			pipe_ctx->bottom_pipe->plane_state == pipe_ctx->plane_state) {
 		if (stream->view_format == VIEW_3D_FORMAT_TOP_AND_BOTTOM)
-			pipe_ctx->scl_data.recout.height /= 2;
+			pipe_ctx->plane_res.scl_data.recout.height /= 2;
 		else
-			pipe_ctx->scl_data.recout.width /= 2;
+			pipe_ctx->plane_res.scl_data.recout.width /= 2;
 	}
 
 	/* Unclipped recout offset = stream dst offset + ((surf dst offset - stream surf_src offset)
@@ -601,8 +601,8 @@ static void calculate_recout(struct pipe_ctx *pipe_ctx, struct view *recout_skip
 			surf_src.y * plane_state->dst_rect.height / surf_src.height
 					* stream->dst.height / stream->src.height;
 
-	recout_skip->width = pipe_ctx->scl_data.recout.x - recout_full_x;
-	recout_skip->height = pipe_ctx->scl_data.recout.y - recout_full_y;
+	recout_skip->width = pipe_ctx->plane_res.scl_data.recout.x - recout_full_x;
+	recout_skip->height = pipe_ctx->plane_res.scl_data.recout.y - recout_full_y;
 }
 
 static void calculate_scaling_ratios(struct pipe_ctx *pipe_ctx)
@@ -619,36 +619,36 @@ static void calculate_scaling_ratios(struct pipe_ctx *pipe_ctx)
 			pipe_ctx->plane_state->rotation == ROTATION_ANGLE_270)
 		rect_swap_helper(&surf_src);
 
-	pipe_ctx->scl_data.ratios.horz = dal_fixed31_32_from_fraction(
+	pipe_ctx->plane_res.scl_data.ratios.horz = dal_fixed31_32_from_fraction(
 					surf_src.width,
 					plane_state->dst_rect.width);
-	pipe_ctx->scl_data.ratios.vert = dal_fixed31_32_from_fraction(
+	pipe_ctx->plane_res.scl_data.ratios.vert = dal_fixed31_32_from_fraction(
 					surf_src.height,
 					plane_state->dst_rect.height);
 
 	if (stream->view_format == VIEW_3D_FORMAT_SIDE_BY_SIDE)
-		pipe_ctx->scl_data.ratios.horz.value *= 2;
+		pipe_ctx->plane_res.scl_data.ratios.horz.value *= 2;
 	else if (stream->view_format == VIEW_3D_FORMAT_TOP_AND_BOTTOM)
-		pipe_ctx->scl_data.ratios.vert.value *= 2;
+		pipe_ctx->plane_res.scl_data.ratios.vert.value *= 2;
 
-	pipe_ctx->scl_data.ratios.vert.value = div64_s64(
-		pipe_ctx->scl_data.ratios.vert.value * in_h, out_h);
-	pipe_ctx->scl_data.ratios.horz.value = div64_s64(
-		pipe_ctx->scl_data.ratios.horz.value * in_w, out_w);
+	pipe_ctx->plane_res.scl_data.ratios.vert.value = div64_s64(
+		pipe_ctx->plane_res.scl_data.ratios.vert.value * in_h, out_h);
+	pipe_ctx->plane_res.scl_data.ratios.horz.value = div64_s64(
+		pipe_ctx->plane_res.scl_data.ratios.horz.value * in_w, out_w);
 
-	pipe_ctx->scl_data.ratios.horz_c = pipe_ctx->scl_data.ratios.horz;
-	pipe_ctx->scl_data.ratios.vert_c = pipe_ctx->scl_data.ratios.vert;
+	pipe_ctx->plane_res.scl_data.ratios.horz_c = pipe_ctx->plane_res.scl_data.ratios.horz;
+	pipe_ctx->plane_res.scl_data.ratios.vert_c = pipe_ctx->plane_res.scl_data.ratios.vert;
 
-	if (pipe_ctx->scl_data.format == PIXEL_FORMAT_420BPP8
-			|| pipe_ctx->scl_data.format == PIXEL_FORMAT_420BPP10) {
-		pipe_ctx->scl_data.ratios.horz_c.value /= 2;
-		pipe_ctx->scl_data.ratios.vert_c.value /= 2;
+	if (pipe_ctx->plane_res.scl_data.format == PIXEL_FORMAT_420BPP8
+			|| pipe_ctx->plane_res.scl_data.format == PIXEL_FORMAT_420BPP10) {
+		pipe_ctx->plane_res.scl_data.ratios.horz_c.value /= 2;
+		pipe_ctx->plane_res.scl_data.ratios.vert_c.value /= 2;
 	}
 }
 
 static void calculate_inits_and_adj_vp(struct pipe_ctx *pipe_ctx, struct view *recout_skip)
 {
-	struct scaler_data *data = &pipe_ctx->scl_data;
+	struct scaler_data *data = &pipe_ctx->plane_res.scl_data;
 	struct rect src = pipe_ctx->plane_state->src_rect;
 	int vpc_div = (data->format == PIXEL_FORMAT_420BPP8
 			|| data->format == PIXEL_FORMAT_420BPP10) ? 2 : 1;
@@ -823,14 +823,14 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
 	 * lb depth calculation requires recout and taps require scaling ratios.
 	 * Inits require viewport, taps, ratios and recout of split pipe
 	 */
-	pipe_ctx->scl_data.format = convert_pixel_format_to_dalsurface(
+	pipe_ctx->plane_res.scl_data.format = convert_pixel_format_to_dalsurface(
 			pipe_ctx->plane_state->format);
 
 	calculate_scaling_ratios(pipe_ctx);
 
 	calculate_viewport(pipe_ctx);
 
-	if (pipe_ctx->scl_data.viewport.height < 16 || pipe_ctx->scl_data.viewport.width < 16)
+	if (pipe_ctx->plane_res.scl_data.viewport.height < 16 || pipe_ctx->plane_res.scl_data.viewport.width < 16)
 		return false;
 
 	calculate_recout(pipe_ctx, &recout_skip);
@@ -839,21 +839,21 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
 	 * Setting line buffer pixel depth to 24bpp yields banding
 	 * on certain displays, such as the Sharp 4k
 	 */
-	pipe_ctx->scl_data.lb_params.depth = LB_PIXEL_DEPTH_30BPP;
+	pipe_ctx->plane_res.scl_data.lb_params.depth = LB_PIXEL_DEPTH_30BPP;
 
-	pipe_ctx->scl_data.h_active = timing->h_addressable;
-	pipe_ctx->scl_data.v_active = timing->v_addressable;
+	pipe_ctx->plane_res.scl_data.h_active = timing->h_addressable;
+	pipe_ctx->plane_res.scl_data.v_active = timing->v_addressable;
 
 	/* Taps calculations */
 	res = pipe_ctx->xfm->funcs->transform_get_optimal_number_of_taps(
-		pipe_ctx->xfm, &pipe_ctx->scl_data, &plane_state->scaling_quality);
+		pipe_ctx->xfm, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality);
 
 	if (!res) {
 		/* Try 24 bpp linebuffer */
-		pipe_ctx->scl_data.lb_params.depth = LB_PIXEL_DEPTH_24BPP;
+		pipe_ctx->plane_res.scl_data.lb_params.depth = LB_PIXEL_DEPTH_24BPP;
 
 		res = pipe_ctx->xfm->funcs->transform_get_optimal_number_of_taps(
-			pipe_ctx->xfm, &pipe_ctx->scl_data, &plane_state->scaling_quality);
+			pipe_ctx->xfm, &pipe_ctx->plane_res.scl_data, &plane_state->scaling_quality);
 	}
 
 	if (res)
@@ -865,10 +865,10 @@ bool resource_build_scaling_params(struct pipe_ctx *pipe_ctx)
 				"y:%d\n dst_rect:\nheight:%d width:%d x:%d "
 				"y:%d\n",
 				__func__,
-				pipe_ctx->scl_data.viewport.height,
-				pipe_ctx->scl_data.viewport.width,
-				pipe_ctx->scl_data.viewport.x,
-				pipe_ctx->scl_data.viewport.y,
+				pipe_ctx->plane_res.scl_data.viewport.height,
+				pipe_ctx->plane_res.scl_data.viewport.width,
+				pipe_ctx->plane_res.scl_data.viewport.x,
+				pipe_ctx->plane_res.scl_data.viewport.y,
 				plane_state->dst_rect.height,
 				plane_state->dst_rect.width,
 				plane_state->dst_rect.x,
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
index 2b65068..ef3a7b8 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_stream.c
@@ -223,9 +223,9 @@ bool dc_stream_set_cursor_position(
 		struct dc_cursor_mi_param param = {
 			.pixel_clk_khz = stream->timing.pix_clk_khz,
 			.ref_clk_khz = core_dc->res_pool->ref_clock_inKhz,
-			.viewport_x_start = pipe_ctx->scl_data.viewport.x,
-			.viewport_width = pipe_ctx->scl_data.viewport.width,
-			.h_scale_ratio = pipe_ctx->scl_data.ratios.horz
+			.viewport_x_start = pipe_ctx->plane_res.scl_data.viewport.x,
+			.viewport_width = pipe_ctx->plane_res.scl_data.viewport.width,
+			.h_scale_ratio = pipe_ctx->plane_res.scl_data.ratios.horz
 		};
 
 		if (pipe_ctx->stream != 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 ea9ce87..dee18c9 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
@@ -914,7 +914,7 @@ static void get_surface_visual_confirm_color(const struct pipe_ctx *pipe_ctx,
 {
 	uint32_t color_value = MAX_TG_COLOR_VALUE * (4 - pipe_ctx->pipe_idx) / 4;
 
-	switch (pipe_ctx->scl_data.format) {
+	switch (pipe_ctx->plane_res.scl_data.format) {
 	case PIXEL_FORMAT_ARGB8888:
 		/* set boarder color to red */
 		color->color_r_cr = color_value;
@@ -964,7 +964,7 @@ static void program_scaler(const struct core_dc *dc,
 
 	pipe_ctx->xfm->funcs->transform_set_pixel_storage_depth(
 		pipe_ctx->xfm,
-		pipe_ctx->scl_data.lb_params.depth,
+		pipe_ctx->plane_res.scl_data.lb_params.depth,
 		&pipe_ctx->stream->bit_depth_params);
 
 	if (pipe_ctx->tg->funcs->set_overscan_blank_color)
@@ -973,7 +973,7 @@ static void program_scaler(const struct core_dc *dc,
 				&color);
 
 	pipe_ctx->xfm->funcs->transform_set_scaler(pipe_ctx->xfm,
-		&pipe_ctx->scl_data);
+		&pipe_ctx->plane_res.scl_data);
 }
 
 static enum dc_status dce110_prog_pixclk_crtc_otg(
@@ -1114,10 +1114,10 @@ static enum dc_status apply_single_controller_ctx_to_hw(
 				&stream->sink->link->cur_link_settings);
 	}
 
-	pipe_ctx->scl_data.lb_params.alpha_en = pipe_ctx->bottom_pipe != 0;
+	pipe_ctx->plane_res.scl_data.lb_params.alpha_en = pipe_ctx->bottom_pipe != 0;
 	/* program_scaler and allocate_mem_input are not new asic */
 	if ((!pipe_ctx_old ||
-	     memcmp(&pipe_ctx_old->scl_data, &pipe_ctx->scl_data,
+	     memcmp(&pipe_ctx_old->plane_res.scl_data, &pipe_ctx->plane_res.scl_data,
 		    sizeof(struct scaler_data)) != 0) &&
 	     pipe_ctx->plane_state) {
 		program_scaler(dc, pipe_ctx);
@@ -1927,14 +1927,14 @@ static void set_default_colors(struct pipe_ctx *pipe_ctx)
 		default_adjust.out_color_space =
 				pipe_ctx->stream->output_color_space;
 	default_adjust.csc_adjust_type = GRAPHICS_CSC_ADJUST_TYPE_SW;
-	default_adjust.surface_pixel_format = pipe_ctx->scl_data.format;
+	default_adjust.surface_pixel_format = pipe_ctx->plane_res.scl_data.format;
 
 	/* display color depth */
 	default_adjust.color_depth =
 		pipe_ctx->stream->timing.display_color_depth;
 
 	/* Lb color depth */
-	default_adjust.lb_color_depth = pipe_ctx->scl_data.lb_params.depth;
+	default_adjust.lb_color_depth = pipe_ctx->plane_res.scl_data.lb_params.depth;
 
 	pipe_ctx->xfm->funcs->opp_set_csc_default(
 					pipe_ctx->xfm, &default_adjust);
@@ -2096,7 +2096,7 @@ static void set_plane_config(
 
 	pipe_ctx->xfm->funcs->transform_set_gamut_remap(pipe_ctx->xfm, &adjust);
 
-	pipe_ctx->scl_data.lb_params.alpha_en = pipe_ctx->bottom_pipe != 0;
+	pipe_ctx->plane_res.scl_data.lb_params.alpha_en = pipe_ctx->bottom_pipe != 0;
 	program_scaler(dc, pipe_ctx);
 
 	program_surface_visibility(dc, pipe_ctx);
@@ -2552,7 +2552,7 @@ static void dce110_program_front_end_for_pipe(
 
 	pipe_ctx->xfm->funcs->transform_set_gamut_remap(pipe_ctx->xfm, &adjust);
 
-	pipe_ctx->scl_data.lb_params.alpha_en = pipe_ctx->bottom_pipe != 0;
+	pipe_ctx->plane_res.scl_data.lb_params.alpha_en = pipe_ctx->bottom_pipe != 0;
 
 	program_scaler(dc, pipe_ctx);
 
@@ -2602,14 +2602,14 @@ static void dce110_program_front_end_for_pipe(
 			"viewport:%d, %d, %d, %d\n"
 			"recout:  %d, %d, %d, %d\n",
 			pipe_ctx->pipe_idx,
-			pipe_ctx->scl_data.viewport.width,
-			pipe_ctx->scl_data.viewport.height,
-			pipe_ctx->scl_data.viewport.x,
-			pipe_ctx->scl_data.viewport.y,
-			pipe_ctx->scl_data.recout.width,
-			pipe_ctx->scl_data.recout.height,
-			pipe_ctx->scl_data.recout.x,
-			pipe_ctx->scl_data.recout.y);
+			pipe_ctx->plane_res.scl_data.viewport.width,
+			pipe_ctx->plane_res.scl_data.viewport.height,
+			pipe_ctx->plane_res.scl_data.viewport.x,
+			pipe_ctx->plane_res.scl_data.viewport.y,
+			pipe_ctx->plane_res.scl_data.recout.width,
+			pipe_ctx->plane_res.scl_data.recout.height,
+			pipe_ctx->plane_res.scl_data.recout.x,
+			pipe_ctx->plane_res.scl_data.recout.y);
 }
 
 static void dce110_apply_ctx_for_surface(
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 5922cf8..314d764 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
@@ -1728,14 +1728,14 @@ static void dcn10_power_on_fe(
 				"viewport:%d, %d, %d, %d\n"
 				"recout:  %d, %d, %d, %d\n",
 				pipe_ctx->pipe_idx,
-				pipe_ctx->scl_data.viewport.width,
-				pipe_ctx->scl_data.viewport.height,
-				pipe_ctx->scl_data.viewport.x,
-				pipe_ctx->scl_data.viewport.y,
-				pipe_ctx->scl_data.recout.width,
-				pipe_ctx->scl_data.recout.height,
-				pipe_ctx->scl_data.recout.x,
-				pipe_ctx->scl_data.recout.y);
+				pipe_ctx->plane_res.scl_data.viewport.width,
+				pipe_ctx->plane_res.scl_data.viewport.height,
+				pipe_ctx->plane_res.scl_data.viewport.x,
+				pipe_ctx->plane_res.scl_data.viewport.y,
+				pipe_ctx->plane_res.scl_data.recout.width,
+				pipe_ctx->plane_res.scl_data.recout.height,
+				pipe_ctx->plane_res.scl_data.recout.x,
+				pipe_ctx->plane_res.scl_data.recout.y);
 		print_rq_dlg_ttu(dc, pipe_ctx);
 	}
 }
@@ -1860,7 +1860,7 @@ static void dcn10_get_surface_visual_confirm_color(
 {
 	uint32_t color_value = MAX_TG_COLOR_VALUE;
 
-	switch (pipe_ctx->scl_data.format) {
+	switch (pipe_ctx->plane_res.scl_data.format) {
 	case PIXEL_FORMAT_ARGB8888:
 		/* set boarder color to red */
 		color->color_r_cr = color_value;
@@ -1931,7 +1931,7 @@ static void update_dchubp_dpp(
 		&pipe_ctx->rq_regs,
 		&pipe_ctx->pipe_dlg_param);
 
-	size.grph.surface_size = pipe_ctx->scl_data.viewport;
+	size.grph.surface_size = pipe_ctx->plane_res.scl_data.viewport;
 
 	if (dc->public.config.gpu_vm_support)
 		mi->funcs->mem_input_program_pte_vm(
@@ -1965,13 +1965,13 @@ static void update_dchubp_dpp(
 					&& per_pixel_alpha;
 	dc->res_pool->mpc->funcs->add(dc->res_pool->mpc, &mpcc_cfg);
 
-	pipe_ctx->scl_data.lb_params.alpha_en = per_pixel_alpha;
-	pipe_ctx->scl_data.lb_params.depth = LB_PIXEL_DEPTH_30BPP;
+	pipe_ctx->plane_res.scl_data.lb_params.alpha_en = per_pixel_alpha;
+	pipe_ctx->plane_res.scl_data.lb_params.depth = LB_PIXEL_DEPTH_30BPP;
 	/* scaler configuration */
 	pipe_ctx->xfm->funcs->transform_set_scaler(
-			pipe_ctx->xfm, &pipe_ctx->scl_data);
+			pipe_ctx->xfm, &pipe_ctx->plane_res.scl_data);
 	mi->funcs->mem_program_viewport(mi,
-			&pipe_ctx->scl_data.viewport, &pipe_ctx->scl_data.viewport_c);
+			&pipe_ctx->plane_res.scl_data.viewport, &pipe_ctx->plane_res.scl_data.viewport_c);
 
 	/*gamut remap*/
 	program_gamut_remap(pipe_ctx);
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 6c93741..dbca1de 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/core_types.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
@@ -157,7 +157,7 @@ struct stream_resource {
 };
 
 struct plane_resource {
-	int stub;
+	struct scaler_data scl_data;
 };
 
 struct pipe_ctx {
@@ -173,8 +173,6 @@ struct pipe_ctx {
 	struct output_pixel_processor *opp;
 	struct timing_generator *tg;
 
-	struct scaler_data scl_data;
-
 	struct stream_encoder *stream_enc;
 	struct display_clock *dis_clk;
 	struct clock_source *clock_source;
-- 
2.7.4