aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0302-drm-amd-display-Rename-bandwidth_calcs.h-to-dce_calc.patch
blob: a10abbf3fb90f0eb2421c847e02baa8c463a2fc0 (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
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
From 7c6a80eea8b6e7036be626c2403d345e4ccf49dd Mon Sep 17 00:00:00 2001
From: Harry Wentland <harry.wentland@amd.com>
Date: Tue, 21 Mar 2017 18:17:12 -0400
Subject: [PATCH 0302/4131] drm/amd/display: Rename bandwidth_calcs.h to
 dce_calcs.h

Signed-off-by: Harry Wentland <harry.wentland@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c   |   2 +-
 drivers/gpu/drm/amd/display/dc/core/dc.c           |   2 +-
 .../drm/amd/display/dc/dce110/dce110_mem_input_v.c |   2 +-
 .../gpu/drm/amd/display/dc/dce80/dce80_mem_input.c |   2 +-
 .../gpu/drm/amd/display/dc/inc/bandwidth_calcs.h   | 504 --------------------
 drivers/gpu/drm/amd/display/dc/inc/core_types.h    |   2 +-
 drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h     | 506 +++++++++++++++++++++
 drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h  |   2 +-
 8 files changed, 512 insertions(+), 510 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/inc/bandwidth_calcs.h
 create mode 100644 drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h

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 4820660..5ac614f 100644
--- a/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
+++ b/drivers/gpu/drm/amd/display/dc/calcs/dce_calcs.c
@@ -24,7 +24,7 @@
  */
 
 #include "dm_services.h"
-#include "bandwidth_calcs.h"
+#include "dce_calcs.h"
 #include "dc.h"
 #include "core_types.h"
 #include "dal_asic_id.h"
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c b/drivers/gpu/drm/amd/display/dc/core/dc.c
index c0889ad..b389122 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -35,7 +35,7 @@
 #include "clock_source.h"
 #include "dc_bios_types.h"
 
-#include "bandwidth_calcs.h"
+#include "dce_calcs.h"
 #include "bios_parser_interface.h"
 #include "include/irq_service_interface.h"
 #include "transform.h"
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c
index aac4795..9c32b5b 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_mem_input_v.c
@@ -31,7 +31,7 @@
 #include "gmc/gmc_8_2_sh_mask.h"
 
 #include "include/logger_interface.h"
-#include "inc/bandwidth_calcs.h"
+#include "inc/dce_calcs.h"
 
 #include "dce110_mem_input.h"
 
diff --git a/drivers/gpu/drm/amd/display/dc/dce80/dce80_mem_input.c b/drivers/gpu/drm/amd/display/dc/dce80/dce80_mem_input.c
index ebb8df3..933e3d8 100644
--- a/drivers/gpu/drm/amd/display/dc/dce80/dce80_mem_input.c
+++ b/drivers/gpu/drm/amd/display/dc/dce80/dce80_mem_input.c
@@ -31,7 +31,7 @@
 #include "gmc/gmc_7_1_sh_mask.h"
 
 #include "include/logger_interface.h"
-#include "inc/bandwidth_calcs.h"
+#include "inc/dce_calcs.h"
 
 #include "../dce110/dce110_mem_input.h"
 #include "dce80_mem_input.h"
diff --git a/drivers/gpu/drm/amd/display/dc/inc/bandwidth_calcs.h b/drivers/gpu/drm/amd/display/dc/inc/bandwidth_calcs.h
deleted file mode 100644
index 81fab9e..0000000
--- a/drivers/gpu/drm/amd/display/dc/inc/bandwidth_calcs.h
+++ /dev/null
@@ -1,504 +0,0 @@
-/*
- * Copyright 2015 Advanced Micro Devices, Inc.
- *
- * Permission is hereby granted, free of charge, to any person obtaining a
- * copy of this software and associated documentation files (the "Software"),
- * to deal in the Software without restriction, including without limitation
- * the rights to use, copy, modify, merge, publish, distribute, sublicense,
- * and/or sell copies of the Software, and to permit persons to whom the
- * Software is furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
- * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
- * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
- * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
- * OTHER DEALINGS IN THE SOFTWARE.
- *
- * Authors: AMD
- *
- */
-
-/**
- * Bandwidth and Watermark calculations interface.
- * (Refer to "DCEx_mode_support.xlsm" from Perforce.)
- */
-#ifndef __BANDWIDTH_CALCS_H__
-#define __BANDWIDTH_CALCS_H__
-
-#include "bw_fixed.h"
-
-struct pipe_ctx;
-
-enum bw_calcs_version {
-	BW_CALCS_VERSION_INVALID,
-	BW_CALCS_VERSION_CARRIZO,
-	BW_CALCS_VERSION_POLARIS10,
-	BW_CALCS_VERSION_POLARIS11,
-	BW_CALCS_VERSION_STONEY,
-	BW_CALCS_VERSION_VEGA10
-};
-
-/*******************************************************************************
- * There are three types of input into Calculations:
- * 1. per-DCE static values - these are "hardcoded" properties of the DCEIP
- * 2. board-level values - these are generally coming from VBIOS parser
- * 3. mode/configuration values - depending Mode, Scaling number of Displays etc.
- ******************************************************************************/
-
-enum bw_defines {
-	//Common
-	bw_def_no = 0,
-	bw_def_none = 0,
-	bw_def_yes = 1,
-	bw_def_ok = 1,
-	bw_def_high = 2,
-	bw_def_mid = 1,
-	bw_def_low = 0,
-
-	//Internal
-	bw_defs_start = 255,
-	bw_def_underlay422,
-	bw_def_underlay420_luma,
-	bw_def_underlay420_chroma,
-	bw_def_underlay444,
-	bw_def_graphics,
-	bw_def_display_write_back420_luma,
-	bw_def_display_write_back420_chroma,
-	bw_def_portrait,
-	bw_def_hsr_mtn_4,
-	bw_def_hsr_mtn_h_taps,
-	bw_def_ceiling__h_taps_div_4___meq_hsr,
-	bw_def_invalid_linear_or_stereo_mode,
-	bw_def_invalid_rotation_or_bpp_or_stereo,
-	bw_def_vsr_mtn_v_taps,
-	bw_def_vsr_mtn_4,
-	bw_def_auto,
-	bw_def_manual,
-	bw_def_exceeded_allowed_maximum_sclk,
-	bw_def_exceeded_allowed_page_close_open,
-	bw_def_exceeded_allowed_outstanding_pte_req_queue_size,
-	bw_def_exceeded_allowed_maximum_bw,
-	bw_def_landscape,
-
-	//Panning and bezel
-	bw_def_any_lines,
-
-	//Underlay mode
-	bw_def_underlay_only,
-	bw_def_blended,
-	bw_def_blend,
-
-	//Stereo mode
-	bw_def_mono,
-	bw_def_side_by_side,
-	bw_def_top_bottom,
-
-	//Underlay surface type
-	bw_def_420,
-	bw_def_422,
-	bw_def_444,
-
-	//Tiling mode
-	bw_def_linear,
-	bw_def_tiled,
-	bw_def_array_linear_general,
-	bw_def_array_linear_aligned,
-	bw_def_rotated_micro_tiling,
-	bw_def_display_micro_tiling,
-
-	//Memory type
-	bw_def_gddr5,
-	bw_def_hbm,
-
-	//Voltage
-	bw_def_high_no_nbp_state_change,
-	bw_def_0_72,
-	bw_def_0_8,
-	bw_def_0_9,
-
-	bw_def_notok = -1,
-	bw_def_na = -1
-};
-
-struct bw_calcs_dceip {
-	enum bw_calcs_version version;
-	bool large_cursor;
-	uint32_t cursor_max_outstanding_group_num;
-	bool dmif_pipe_en_fbc_chunk_tracker;
-	struct bw_fixed dmif_request_buffer_size;
-	uint32_t lines_interleaved_into_lb;
-	uint32_t low_power_tiling_mode;
-	uint32_t chunk_width;
-	uint32_t number_of_graphics_pipes;
-	uint32_t number_of_underlay_pipes;
-	bool display_write_back_supported;
-	bool argb_compression_support;
-	struct bw_fixed underlay_vscaler_efficiency6_bit_per_component;
-	struct bw_fixed underlay_vscaler_efficiency8_bit_per_component;
-	struct bw_fixed underlay_vscaler_efficiency10_bit_per_component;
-	struct bw_fixed underlay_vscaler_efficiency12_bit_per_component;
-	struct bw_fixed graphics_vscaler_efficiency6_bit_per_component;
-	struct bw_fixed graphics_vscaler_efficiency8_bit_per_component;
-	struct bw_fixed graphics_vscaler_efficiency10_bit_per_component;
-	struct bw_fixed graphics_vscaler_efficiency12_bit_per_component;
-	struct bw_fixed alpha_vscaler_efficiency;
-	uint32_t max_dmif_buffer_allocated;
-	uint32_t graphics_dmif_size;
-	uint32_t underlay_luma_dmif_size;
-	uint32_t underlay_chroma_dmif_size;
-	bool pre_downscaler_enabled;
-	bool underlay_downscale_prefetch_enabled;
-	struct bw_fixed lb_write_pixels_per_dispclk;
-	struct bw_fixed lb_size_per_component444;
-	bool graphics_lb_nodownscaling_multi_line_prefetching;
-	struct bw_fixed stutter_and_dram_clock_state_change_gated_before_cursor;
-	struct bw_fixed underlay420_luma_lb_size_per_component;
-	struct bw_fixed underlay420_chroma_lb_size_per_component;
-	struct bw_fixed underlay422_lb_size_per_component;
-	struct bw_fixed cursor_chunk_width;
-	struct bw_fixed cursor_dcp_buffer_lines;
-	struct bw_fixed underlay_maximum_width_efficient_for_tiling;
-	struct bw_fixed underlay_maximum_height_efficient_for_tiling;
-	struct bw_fixed peak_pte_request_to_eviction_ratio_limiting_multiple_displays_or_single_rotated_display;
-	struct bw_fixed peak_pte_request_to_eviction_ratio_limiting_single_display_no_rotation;
-	struct bw_fixed minimum_outstanding_pte_request_limit;
-	struct bw_fixed maximum_total_outstanding_pte_requests_allowed_by_saw;
-	bool limit_excessive_outstanding_dmif_requests;
-	struct bw_fixed linear_mode_line_request_alternation_slice;
-	uint32_t scatter_gather_lines_of_pte_prefetching_in_linear_mode;
-	uint32_t display_write_back420_luma_mcifwr_buffer_size;
-	uint32_t display_write_back420_chroma_mcifwr_buffer_size;
-	struct bw_fixed request_efficiency;
-	struct bw_fixed dispclk_per_request;
-	struct bw_fixed dispclk_ramping_factor;
-	struct bw_fixed display_pipe_throughput_factor;
-	uint32_t scatter_gather_pte_request_rows_in_tiling_mode;
-	struct bw_fixed mcifwr_all_surfaces_burst_time;
-};
-
-struct bw_calcs_vbios {
-	enum bw_defines memory_type;
-	uint32_t dram_channel_width_in_bits;
-	uint32_t number_of_dram_channels;
-	uint32_t number_of_dram_banks;
-	struct bw_fixed low_yclk; /*m_hz*/
-	struct bw_fixed mid_yclk; /*m_hz*/
-	struct bw_fixed high_yclk; /*m_hz*/
-	struct bw_fixed low_sclk; /*m_hz*/
-	struct bw_fixed mid1_sclk; /*m_hz*/
-	struct bw_fixed mid2_sclk; /*m_hz*/
-	struct bw_fixed mid3_sclk; /*m_hz*/
-	struct bw_fixed mid4_sclk; /*m_hz*/
-	struct bw_fixed mid5_sclk; /*m_hz*/
-	struct bw_fixed mid6_sclk; /*m_hz*/
-	struct bw_fixed high_sclk; /*m_hz*/
-	struct bw_fixed low_voltage_max_dispclk; /*m_hz*/
-	struct bw_fixed mid_voltage_max_dispclk; /*m_hz*/
-	struct bw_fixed high_voltage_max_dispclk; /*m_hz*/
-	struct bw_fixed low_voltage_max_phyclk;
-	struct bw_fixed mid_voltage_max_phyclk;
-	struct bw_fixed high_voltage_max_phyclk;
-	struct bw_fixed data_return_bus_width;
-	struct bw_fixed trc;
-	struct bw_fixed dmifmc_urgent_latency;
-	struct bw_fixed stutter_self_refresh_exit_latency;
-	struct bw_fixed stutter_self_refresh_entry_latency;
-	struct bw_fixed nbp_state_change_latency;
-	struct bw_fixed mcifwrmc_urgent_latency;
-	bool scatter_gather_enable;
-	struct bw_fixed down_spread_percentage;
-	uint32_t cursor_width;
-	uint32_t average_compression_rate;
-	uint32_t number_of_request_slots_gmc_reserves_for_dmif_per_channel;
-	struct bw_fixed blackout_duration;
-	struct bw_fixed maximum_blackout_recovery_time;
-};
-
-/*******************************************************************************
- * Temporary data structure(s).
- ******************************************************************************/
-#define maximum_number_of_surfaces 12
-/*Units : MHz, us */
-
-struct bw_calcs_data {
-	/* data for all displays */
-	uint32_t number_of_displays;
-	enum bw_defines underlay_surface_type;
-	enum bw_defines panning_and_bezel_adjustment;
-	enum bw_defines graphics_tiling_mode;
-	uint32_t graphics_lb_bpc;
-	uint32_t underlay_lb_bpc;
-	enum bw_defines underlay_tiling_mode;
-	enum bw_defines d0_underlay_mode;
-	bool d1_display_write_back_dwb_enable;
-	enum bw_defines d1_underlay_mode;
-
-	bool cpup_state_change_enable;
-	bool cpuc_state_change_enable;
-	bool nbp_state_change_enable;
-	bool stutter_mode_enable;
-	uint32_t y_clk_level;
-	uint32_t sclk_level;
-	uint32_t number_of_underlay_surfaces;
-	uint32_t number_of_dram_wrchannels;
-	uint32_t chunk_request_delay;
-	uint32_t number_of_dram_channels;
-	enum bw_defines underlay_micro_tile_mode;
-	enum bw_defines graphics_micro_tile_mode;
-	struct bw_fixed max_phyclk;
-	struct bw_fixed dram_efficiency;
-	struct bw_fixed src_width_after_surface_type;
-	struct bw_fixed src_height_after_surface_type;
-	struct bw_fixed hsr_after_surface_type;
-	struct bw_fixed vsr_after_surface_type;
-	struct bw_fixed src_width_after_rotation;
-	struct bw_fixed src_height_after_rotation;
-	struct bw_fixed hsr_after_rotation;
-	struct bw_fixed vsr_after_rotation;
-	struct bw_fixed source_height_pixels;
-	struct bw_fixed hsr_after_stereo;
-	struct bw_fixed vsr_after_stereo;
-	struct bw_fixed source_width_in_lb;
-	struct bw_fixed lb_line_pitch;
-	struct bw_fixed underlay_maximum_source_efficient_for_tiling;
-	struct bw_fixed num_lines_at_frame_start;
-	struct bw_fixed min_dmif_size_in_time;
-	struct bw_fixed min_mcifwr_size_in_time;
-	struct bw_fixed total_requests_for_dmif_size;
-	struct bw_fixed peak_pte_request_to_eviction_ratio_limiting;
-	struct bw_fixed useful_pte_per_pte_request;
-	struct bw_fixed scatter_gather_pte_request_rows;
-	struct bw_fixed scatter_gather_row_height;
-	struct bw_fixed scatter_gather_pte_requests_in_vblank;
-	struct bw_fixed inefficient_linear_pitch_in_bytes;
-	struct bw_fixed cursor_total_data;
-	struct bw_fixed cursor_total_request_groups;
-	struct bw_fixed scatter_gather_total_pte_requests;
-	struct bw_fixed scatter_gather_total_pte_request_groups;
-	struct bw_fixed tile_width_in_pixels;
-	struct bw_fixed dmif_total_number_of_data_request_page_close_open;
-	struct bw_fixed mcifwr_total_number_of_data_request_page_close_open;
-	struct bw_fixed bytes_per_page_close_open;
-	struct bw_fixed mcifwr_total_page_close_open_time;
-	struct bw_fixed total_requests_for_adjusted_dmif_size;
-	struct bw_fixed total_dmifmc_urgent_trips;
-	struct bw_fixed total_dmifmc_urgent_latency;
-	struct bw_fixed total_display_reads_required_data;
-	struct bw_fixed total_display_reads_required_dram_access_data;
-	struct bw_fixed total_display_writes_required_data;
-	struct bw_fixed total_display_writes_required_dram_access_data;
-	struct bw_fixed display_reads_required_data;
-	struct bw_fixed display_reads_required_dram_access_data;
-	struct bw_fixed dmif_total_page_close_open_time;
-	struct bw_fixed min_cursor_memory_interface_buffer_size_in_time;
-	struct bw_fixed min_read_buffer_size_in_time;
-	struct bw_fixed display_reads_time_for_data_transfer;
-	struct bw_fixed display_writes_time_for_data_transfer;
-	struct bw_fixed dmif_required_dram_bandwidth;
-	struct bw_fixed mcifwr_required_dram_bandwidth;
-	struct bw_fixed required_dmifmc_urgent_latency_for_page_close_open;
-	struct bw_fixed required_mcifmcwr_urgent_latency;
-	struct bw_fixed required_dram_bandwidth_gbyte_per_second;
-	struct bw_fixed dram_bandwidth;
-	struct bw_fixed dmif_required_sclk;
-	struct bw_fixed mcifwr_required_sclk;
-	struct bw_fixed required_sclk;
-	struct bw_fixed downspread_factor;
-	struct bw_fixed v_scaler_efficiency;
-	struct bw_fixed scaler_limits_factor;
-	struct bw_fixed display_pipe_pixel_throughput;
-	struct bw_fixed total_dispclk_required_with_ramping;
-	struct bw_fixed total_dispclk_required_without_ramping;
-	struct bw_fixed total_read_request_bandwidth;
-	struct bw_fixed total_write_request_bandwidth;
-	struct bw_fixed dispclk_required_for_total_read_request_bandwidth;
-	struct bw_fixed total_dispclk_required_with_ramping_with_request_bandwidth;
-	struct bw_fixed total_dispclk_required_without_ramping_with_request_bandwidth;
-	struct bw_fixed dispclk;
-	struct bw_fixed blackout_recovery_time;
-	struct bw_fixed min_pixels_per_data_fifo_entry;
-	struct bw_fixed sclk_deep_sleep;
-	struct bw_fixed chunk_request_time;
-	struct bw_fixed cursor_request_time;
-	struct bw_fixed line_source_pixels_transfer_time;
-	struct bw_fixed dmifdram_access_efficiency;
-	struct bw_fixed mcifwrdram_access_efficiency;
-	struct bw_fixed total_average_bandwidth_no_compression;
-	struct bw_fixed total_average_bandwidth;
-	struct bw_fixed total_stutter_cycle_duration;
-	struct bw_fixed stutter_burst_time;
-	struct bw_fixed time_in_self_refresh;
-	struct bw_fixed stutter_efficiency;
-	struct bw_fixed worst_number_of_trips_to_memory;
-	struct bw_fixed immediate_flip_time;
-	struct bw_fixed latency_for_non_dmif_clients;
-	struct bw_fixed latency_for_non_mcifwr_clients;
-	struct bw_fixed dmifmc_urgent_latency_supported_in_high_sclk_and_yclk;
-	struct bw_fixed nbp_state_dram_speed_change_margin;
-	struct bw_fixed display_reads_time_for_data_transfer_and_urgent_latency;
-	struct bw_fixed dram_speed_change_margin;
-	struct bw_fixed min_vblank_dram_speed_change_margin;
-	struct bw_fixed min_stutter_refresh_duration;
-	uint32_t total_stutter_dmif_buffer_size;
-	uint32_t total_bytes_requested;
-	uint32_t min_stutter_dmif_buffer_size;
-	uint32_t num_stutter_bursts;
-	struct bw_fixed v_blank_nbp_state_dram_speed_change_latency_supported;
-	struct bw_fixed nbp_state_dram_speed_change_latency_supported;
-	bool fbc_en[maximum_number_of_surfaces];
-	bool lpt_en[maximum_number_of_surfaces];
-	bool displays_match_flag[maximum_number_of_surfaces];
-	bool use_alpha[maximum_number_of_surfaces];
-	bool orthogonal_rotation[maximum_number_of_surfaces];
-	bool enable[maximum_number_of_surfaces];
-	bool access_one_channel_only[maximum_number_of_surfaces];
-	bool scatter_gather_enable_for_pipe[maximum_number_of_surfaces];
-	bool interlace_mode[maximum_number_of_surfaces];
-	bool display_pstate_change_enable[maximum_number_of_surfaces];
-	bool line_buffer_prefetch[maximum_number_of_surfaces];
-	uint32_t bytes_per_pixel[maximum_number_of_surfaces];
-	uint32_t max_chunks_non_fbc_mode[maximum_number_of_surfaces];
-	uint32_t lb_bpc[maximum_number_of_surfaces];
-	uint32_t output_bpphdmi[maximum_number_of_surfaces];
-	uint32_t output_bppdp4_lane_hbr[maximum_number_of_surfaces];
-	uint32_t output_bppdp4_lane_hbr2[maximum_number_of_surfaces];
-	uint32_t output_bppdp4_lane_hbr3[maximum_number_of_surfaces];
-	enum bw_defines stereo_mode[maximum_number_of_surfaces];
-	struct bw_fixed dmif_buffer_transfer_time[maximum_number_of_surfaces];
-	struct bw_fixed displays_with_same_mode[maximum_number_of_surfaces];
-	struct bw_fixed stutter_dmif_buffer_size[maximum_number_of_surfaces];
-	struct bw_fixed stutter_refresh_duration[maximum_number_of_surfaces];
-	struct bw_fixed stutter_exit_watermark[maximum_number_of_surfaces];
-	struct bw_fixed stutter_entry_watermark[maximum_number_of_surfaces];
-	struct bw_fixed h_total[maximum_number_of_surfaces];
-	struct bw_fixed v_total[maximum_number_of_surfaces];
-	struct bw_fixed pixel_rate[maximum_number_of_surfaces];
-	struct bw_fixed src_width[maximum_number_of_surfaces];
-	struct bw_fixed pitch_in_pixels[maximum_number_of_surfaces];
-	struct bw_fixed pitch_in_pixels_after_surface_type[maximum_number_of_surfaces];
-	struct bw_fixed src_height[maximum_number_of_surfaces];
-	struct bw_fixed scale_ratio[maximum_number_of_surfaces];
-	struct bw_fixed h_taps[maximum_number_of_surfaces];
-	struct bw_fixed v_taps[maximum_number_of_surfaces];
-	struct bw_fixed h_scale_ratio[maximum_number_of_surfaces];
-	struct bw_fixed v_scale_ratio[maximum_number_of_surfaces];
-	struct bw_fixed rotation_angle[maximum_number_of_surfaces];
-	struct bw_fixed compression_rate[maximum_number_of_surfaces];
-	struct bw_fixed hsr[maximum_number_of_surfaces];
-	struct bw_fixed vsr[maximum_number_of_surfaces];
-	struct bw_fixed source_width_rounded_up_to_chunks[maximum_number_of_surfaces];
-	struct bw_fixed source_width_pixels[maximum_number_of_surfaces];
-	struct bw_fixed source_height_rounded_up_to_chunks[maximum_number_of_surfaces];
-	struct bw_fixed display_bandwidth[maximum_number_of_surfaces];
-	struct bw_fixed request_bandwidth[maximum_number_of_surfaces];
-	struct bw_fixed bytes_per_request[maximum_number_of_surfaces];
-	struct bw_fixed useful_bytes_per_request[maximum_number_of_surfaces];
-	struct bw_fixed lines_interleaved_in_mem_access[maximum_number_of_surfaces];
-	struct bw_fixed latency_hiding_lines[maximum_number_of_surfaces];
-	struct bw_fixed lb_partitions[maximum_number_of_surfaces];
-	struct bw_fixed lb_partitions_max[maximum_number_of_surfaces];
-	struct bw_fixed dispclk_required_with_ramping[maximum_number_of_surfaces];
-	struct bw_fixed dispclk_required_without_ramping[maximum_number_of_surfaces];
-	struct bw_fixed data_buffer_size[maximum_number_of_surfaces];
-	struct bw_fixed outstanding_chunk_request_limit[maximum_number_of_surfaces];
-	struct bw_fixed urgent_watermark[maximum_number_of_surfaces];
-	struct bw_fixed nbp_state_change_watermark[maximum_number_of_surfaces];
-	struct bw_fixed v_filter_init[maximum_number_of_surfaces];
-	struct bw_fixed stutter_cycle_duration[maximum_number_of_surfaces];
-	struct bw_fixed average_bandwidth[maximum_number_of_surfaces];
-	struct bw_fixed average_bandwidth_no_compression[maximum_number_of_surfaces];
-	struct bw_fixed scatter_gather_pte_request_limit[maximum_number_of_surfaces];
-	struct bw_fixed lb_size_per_component[maximum_number_of_surfaces];
-	struct bw_fixed memory_chunk_size_in_bytes[maximum_number_of_surfaces];
-	struct bw_fixed pipe_chunk_size_in_bytes[maximum_number_of_surfaces];
-	struct bw_fixed number_of_trips_to_memory_for_getting_apte_row[maximum_number_of_surfaces];
-	struct bw_fixed adjusted_data_buffer_size[maximum_number_of_surfaces];
-	struct bw_fixed adjusted_data_buffer_size_in_memory[maximum_number_of_surfaces];
-	struct bw_fixed pixels_per_data_fifo_entry[maximum_number_of_surfaces];
-	struct bw_fixed scatter_gather_pte_requests_in_row[maximum_number_of_surfaces];
-	struct bw_fixed pte_request_per_chunk[maximum_number_of_surfaces];
-	struct bw_fixed scatter_gather_page_width[maximum_number_of_surfaces];
-	struct bw_fixed scatter_gather_page_height[maximum_number_of_surfaces];
-	struct bw_fixed lb_lines_in_per_line_out_in_beginning_of_frame[maximum_number_of_surfaces];
-	struct bw_fixed lb_lines_in_per_line_out_in_middle_of_frame[maximum_number_of_surfaces];
-	struct bw_fixed cursor_width_pixels[maximum_number_of_surfaces];
-	struct bw_fixed minimum_latency_hiding[maximum_number_of_surfaces];
-	struct bw_fixed maximum_latency_hiding[maximum_number_of_surfaces];
-	struct bw_fixed minimum_latency_hiding_with_cursor[maximum_number_of_surfaces];
-	struct bw_fixed maximum_latency_hiding_with_cursor[maximum_number_of_surfaces];
-	struct bw_fixed src_pixels_for_first_output_pixel[maximum_number_of_surfaces];
-	struct bw_fixed src_pixels_for_last_output_pixel[maximum_number_of_surfaces];
-	struct bw_fixed src_data_for_first_output_pixel[maximum_number_of_surfaces];
-	struct bw_fixed src_data_for_last_output_pixel[maximum_number_of_surfaces];
-	struct bw_fixed active_time[maximum_number_of_surfaces];
-	struct bw_fixed horizontal_blank_and_chunk_granularity_factor[maximum_number_of_surfaces];
-	struct bw_fixed cursor_latency_hiding[maximum_number_of_surfaces];
-	struct bw_fixed v_blank_dram_speed_change_margin[maximum_number_of_surfaces];
-	uint32_t num_displays_with_margin[3][8];
-	struct bw_fixed dmif_burst_time[3][8];
-	struct bw_fixed mcifwr_burst_time[3][8];
-	struct bw_fixed line_source_transfer_time[maximum_number_of_surfaces][3][8];
-	struct bw_fixed dram_speed_change_line_source_transfer_time[maximum_number_of_surfaces][3][8];
-	struct bw_fixed min_dram_speed_change_margin[3][8];
-	struct bw_fixed dispclk_required_for_dram_speed_change[3][8];
-	struct bw_fixed blackout_duration_margin[3][8];
-	struct bw_fixed dispclk_required_for_blackout_duration[3][8];
-	struct bw_fixed dispclk_required_for_blackout_recovery[3][8];
-	struct bw_fixed dmif_required_sclk_for_urgent_latency[6];
-};
-
-/*******************************************************************************
- * Output data structures.
- ******************************************************************************/
-struct bw_watermarks {
-	uint32_t a_mark;
-	uint32_t b_mark;
-	uint32_t c_mark;
-	uint32_t d_mark;
-};
-
-struct bw_calcs_output {
-	bool cpuc_state_change_enable;
-	bool cpup_state_change_enable;
-	bool stutter_mode_enable;
-	bool nbp_state_change_enable;
-	bool all_displays_in_sync;
-	struct bw_watermarks urgent_wm_ns[6];
-	struct bw_watermarks stutter_exit_wm_ns[6];
-	struct bw_watermarks nbp_state_change_wm_ns[6];
-	uint32_t required_sclk;
-	uint32_t required_sclk_deep_sleep;
-	uint32_t required_yclk;
-	uint32_t dispclk_khz;
-	int blackout_recovery_time_us;
-};
-
-/**
- * Initialize structures with data which will NOT change at runtime.
- */
-void bw_calcs_init(
-	struct bw_calcs_dceip *bw_dceip,
-	struct bw_calcs_vbios *bw_vbios,
-	struct hw_asic_id asic_id);
-
-/**
- * Return:
- *	true -	Display(s) configuration supported.
- *		In this case 'calcs_output' contains data for HW programming
- *	false - Display(s) configuration not supported (not enough bandwidth).
- */
-bool bw_calcs(
-	struct dc_context *ctx,
-	const struct bw_calcs_dceip *dceip,
-	const struct bw_calcs_vbios *vbios,
-	const struct pipe_ctx *pipe,
-	int pipe_count,
-	struct bw_calcs_output *calcs_output);
-
-#endif /* __BANDWIDTH_CALCS_H__ */
-
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 7f3c6da..4056083 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/core_types.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/core_types.h
@@ -27,7 +27,7 @@
 #define _CORE_TYPES_H_
 
 #include "dc.h"
-#include "bandwidth_calcs.h"
+#include "dce_calcs.h"
 #include "ddc_service_types.h"
 #include "dc_bios_types.h"
 
diff --git a/drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h b/drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h
new file mode 100644
index 0000000..580dee95
--- /dev/null
+++ b/drivers/gpu/drm/amd/display/dc/inc/dce_calcs.h
@@ -0,0 +1,506 @@
+/*
+ * Copyright 2015-2017 Advanced Micro Devices, Inc.
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice shall be included in
+ * all copies or substantial portions of the Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE COPYRIGHT HOLDER(S) OR AUTHOR(S) BE LIABLE FOR ANY CLAIM, DAMAGES OR
+ * OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
+ * ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
+ * OTHER DEALINGS IN THE SOFTWARE.
+ *
+ * Authors: AMD
+ *
+ */
+
+/**
+ * Bandwidth and Watermark calculations interface.
+ * (Refer to "DCEx_mode_support.xlsm" from Perforce.)
+ */
+#ifndef __DCE_CALCS_H__
+#define __DCE_CALCS_H__
+
+#include "bw_fixed.h"
+
+struct pipe_ctx;
+struct core_dc;
+struct validate_context;
+
+enum bw_calcs_version {
+	BW_CALCS_VERSION_INVALID,
+	BW_CALCS_VERSION_CARRIZO,
+	BW_CALCS_VERSION_POLARIS10,
+	BW_CALCS_VERSION_POLARIS11,
+	BW_CALCS_VERSION_STONEY,
+	BW_CALCS_VERSION_VEGA10
+};
+
+/*******************************************************************************
+ * There are three types of input into Calculations:
+ * 1. per-DCE static values - these are "hardcoded" properties of the DCEIP
+ * 2. board-level values - these are generally coming from VBIOS parser
+ * 3. mode/configuration values - depending Mode, Scaling number of Displays etc.
+ ******************************************************************************/
+
+enum bw_defines {
+	//Common
+	bw_def_no = 0,
+	bw_def_none = 0,
+	bw_def_yes = 1,
+	bw_def_ok = 1,
+	bw_def_high = 2,
+	bw_def_mid = 1,
+	bw_def_low = 0,
+
+	//Internal
+	bw_defs_start = 255,
+	bw_def_underlay422,
+	bw_def_underlay420_luma,
+	bw_def_underlay420_chroma,
+	bw_def_underlay444,
+	bw_def_graphics,
+	bw_def_display_write_back420_luma,
+	bw_def_display_write_back420_chroma,
+	bw_def_portrait,
+	bw_def_hsr_mtn_4,
+	bw_def_hsr_mtn_h_taps,
+	bw_def_ceiling__h_taps_div_4___meq_hsr,
+	bw_def_invalid_linear_or_stereo_mode,
+	bw_def_invalid_rotation_or_bpp_or_stereo,
+	bw_def_vsr_mtn_v_taps,
+	bw_def_vsr_mtn_4,
+	bw_def_auto,
+	bw_def_manual,
+	bw_def_exceeded_allowed_maximum_sclk,
+	bw_def_exceeded_allowed_page_close_open,
+	bw_def_exceeded_allowed_outstanding_pte_req_queue_size,
+	bw_def_exceeded_allowed_maximum_bw,
+	bw_def_landscape,
+
+	//Panning and bezel
+	bw_def_any_lines,
+
+	//Underlay mode
+	bw_def_underlay_only,
+	bw_def_blended,
+	bw_def_blend,
+
+	//Stereo mode
+	bw_def_mono,
+	bw_def_side_by_side,
+	bw_def_top_bottom,
+
+	//Underlay surface type
+	bw_def_420,
+	bw_def_422,
+	bw_def_444,
+
+	//Tiling mode
+	bw_def_linear,
+	bw_def_tiled,
+	bw_def_array_linear_general,
+	bw_def_array_linear_aligned,
+	bw_def_rotated_micro_tiling,
+	bw_def_display_micro_tiling,
+
+	//Memory type
+	bw_def_gddr5,
+	bw_def_hbm,
+
+	//Voltage
+	bw_def_high_no_nbp_state_change,
+	bw_def_0_72,
+	bw_def_0_8,
+	bw_def_0_9,
+
+	bw_def_notok = -1,
+	bw_def_na = -1
+};
+
+struct bw_calcs_dceip {
+	enum bw_calcs_version version;
+	bool large_cursor;
+	uint32_t cursor_max_outstanding_group_num;
+	bool dmif_pipe_en_fbc_chunk_tracker;
+	struct bw_fixed dmif_request_buffer_size;
+	uint32_t lines_interleaved_into_lb;
+	uint32_t low_power_tiling_mode;
+	uint32_t chunk_width;
+	uint32_t number_of_graphics_pipes;
+	uint32_t number_of_underlay_pipes;
+	bool display_write_back_supported;
+	bool argb_compression_support;
+	struct bw_fixed underlay_vscaler_efficiency6_bit_per_component;
+	struct bw_fixed underlay_vscaler_efficiency8_bit_per_component;
+	struct bw_fixed underlay_vscaler_efficiency10_bit_per_component;
+	struct bw_fixed underlay_vscaler_efficiency12_bit_per_component;
+	struct bw_fixed graphics_vscaler_efficiency6_bit_per_component;
+	struct bw_fixed graphics_vscaler_efficiency8_bit_per_component;
+	struct bw_fixed graphics_vscaler_efficiency10_bit_per_component;
+	struct bw_fixed graphics_vscaler_efficiency12_bit_per_component;
+	struct bw_fixed alpha_vscaler_efficiency;
+	uint32_t max_dmif_buffer_allocated;
+	uint32_t graphics_dmif_size;
+	uint32_t underlay_luma_dmif_size;
+	uint32_t underlay_chroma_dmif_size;
+	bool pre_downscaler_enabled;
+	bool underlay_downscale_prefetch_enabled;
+	struct bw_fixed lb_write_pixels_per_dispclk;
+	struct bw_fixed lb_size_per_component444;
+	bool graphics_lb_nodownscaling_multi_line_prefetching;
+	struct bw_fixed stutter_and_dram_clock_state_change_gated_before_cursor;
+	struct bw_fixed underlay420_luma_lb_size_per_component;
+	struct bw_fixed underlay420_chroma_lb_size_per_component;
+	struct bw_fixed underlay422_lb_size_per_component;
+	struct bw_fixed cursor_chunk_width;
+	struct bw_fixed cursor_dcp_buffer_lines;
+	struct bw_fixed underlay_maximum_width_efficient_for_tiling;
+	struct bw_fixed underlay_maximum_height_efficient_for_tiling;
+	struct bw_fixed peak_pte_request_to_eviction_ratio_limiting_multiple_displays_or_single_rotated_display;
+	struct bw_fixed peak_pte_request_to_eviction_ratio_limiting_single_display_no_rotation;
+	struct bw_fixed minimum_outstanding_pte_request_limit;
+	struct bw_fixed maximum_total_outstanding_pte_requests_allowed_by_saw;
+	bool limit_excessive_outstanding_dmif_requests;
+	struct bw_fixed linear_mode_line_request_alternation_slice;
+	uint32_t scatter_gather_lines_of_pte_prefetching_in_linear_mode;
+	uint32_t display_write_back420_luma_mcifwr_buffer_size;
+	uint32_t display_write_back420_chroma_mcifwr_buffer_size;
+	struct bw_fixed request_efficiency;
+	struct bw_fixed dispclk_per_request;
+	struct bw_fixed dispclk_ramping_factor;
+	struct bw_fixed display_pipe_throughput_factor;
+	uint32_t scatter_gather_pte_request_rows_in_tiling_mode;
+	struct bw_fixed mcifwr_all_surfaces_burst_time;
+};
+
+struct bw_calcs_vbios {
+	enum bw_defines memory_type;
+	uint32_t dram_channel_width_in_bits;
+	uint32_t number_of_dram_channels;
+	uint32_t number_of_dram_banks;
+	struct bw_fixed low_yclk; /*m_hz*/
+	struct bw_fixed mid_yclk; /*m_hz*/
+	struct bw_fixed high_yclk; /*m_hz*/
+	struct bw_fixed low_sclk; /*m_hz*/
+	struct bw_fixed mid1_sclk; /*m_hz*/
+	struct bw_fixed mid2_sclk; /*m_hz*/
+	struct bw_fixed mid3_sclk; /*m_hz*/
+	struct bw_fixed mid4_sclk; /*m_hz*/
+	struct bw_fixed mid5_sclk; /*m_hz*/
+	struct bw_fixed mid6_sclk; /*m_hz*/
+	struct bw_fixed high_sclk; /*m_hz*/
+	struct bw_fixed low_voltage_max_dispclk; /*m_hz*/
+	struct bw_fixed mid_voltage_max_dispclk; /*m_hz*/
+	struct bw_fixed high_voltage_max_dispclk; /*m_hz*/
+	struct bw_fixed low_voltage_max_phyclk;
+	struct bw_fixed mid_voltage_max_phyclk;
+	struct bw_fixed high_voltage_max_phyclk;
+	struct bw_fixed data_return_bus_width;
+	struct bw_fixed trc;
+	struct bw_fixed dmifmc_urgent_latency;
+	struct bw_fixed stutter_self_refresh_exit_latency;
+	struct bw_fixed stutter_self_refresh_entry_latency;
+	struct bw_fixed nbp_state_change_latency;
+	struct bw_fixed mcifwrmc_urgent_latency;
+	bool scatter_gather_enable;
+	struct bw_fixed down_spread_percentage;
+	uint32_t cursor_width;
+	uint32_t average_compression_rate;
+	uint32_t number_of_request_slots_gmc_reserves_for_dmif_per_channel;
+	struct bw_fixed blackout_duration;
+	struct bw_fixed maximum_blackout_recovery_time;
+};
+
+/*******************************************************************************
+ * Temporary data structure(s).
+ ******************************************************************************/
+#define maximum_number_of_surfaces 12
+/*Units : MHz, us */
+
+struct bw_calcs_data {
+	/* data for all displays */
+	uint32_t number_of_displays;
+	enum bw_defines underlay_surface_type;
+	enum bw_defines panning_and_bezel_adjustment;
+	enum bw_defines graphics_tiling_mode;
+	uint32_t graphics_lb_bpc;
+	uint32_t underlay_lb_bpc;
+	enum bw_defines underlay_tiling_mode;
+	enum bw_defines d0_underlay_mode;
+	bool d1_display_write_back_dwb_enable;
+	enum bw_defines d1_underlay_mode;
+
+	bool cpup_state_change_enable;
+	bool cpuc_state_change_enable;
+	bool nbp_state_change_enable;
+	bool stutter_mode_enable;
+	uint32_t y_clk_level;
+	uint32_t sclk_level;
+	uint32_t number_of_underlay_surfaces;
+	uint32_t number_of_dram_wrchannels;
+	uint32_t chunk_request_delay;
+	uint32_t number_of_dram_channels;
+	enum bw_defines underlay_micro_tile_mode;
+	enum bw_defines graphics_micro_tile_mode;
+	struct bw_fixed max_phyclk;
+	struct bw_fixed dram_efficiency;
+	struct bw_fixed src_width_after_surface_type;
+	struct bw_fixed src_height_after_surface_type;
+	struct bw_fixed hsr_after_surface_type;
+	struct bw_fixed vsr_after_surface_type;
+	struct bw_fixed src_width_after_rotation;
+	struct bw_fixed src_height_after_rotation;
+	struct bw_fixed hsr_after_rotation;
+	struct bw_fixed vsr_after_rotation;
+	struct bw_fixed source_height_pixels;
+	struct bw_fixed hsr_after_stereo;
+	struct bw_fixed vsr_after_stereo;
+	struct bw_fixed source_width_in_lb;
+	struct bw_fixed lb_line_pitch;
+	struct bw_fixed underlay_maximum_source_efficient_for_tiling;
+	struct bw_fixed num_lines_at_frame_start;
+	struct bw_fixed min_dmif_size_in_time;
+	struct bw_fixed min_mcifwr_size_in_time;
+	struct bw_fixed total_requests_for_dmif_size;
+	struct bw_fixed peak_pte_request_to_eviction_ratio_limiting;
+	struct bw_fixed useful_pte_per_pte_request;
+	struct bw_fixed scatter_gather_pte_request_rows;
+	struct bw_fixed scatter_gather_row_height;
+	struct bw_fixed scatter_gather_pte_requests_in_vblank;
+	struct bw_fixed inefficient_linear_pitch_in_bytes;
+	struct bw_fixed cursor_total_data;
+	struct bw_fixed cursor_total_request_groups;
+	struct bw_fixed scatter_gather_total_pte_requests;
+	struct bw_fixed scatter_gather_total_pte_request_groups;
+	struct bw_fixed tile_width_in_pixels;
+	struct bw_fixed dmif_total_number_of_data_request_page_close_open;
+	struct bw_fixed mcifwr_total_number_of_data_request_page_close_open;
+	struct bw_fixed bytes_per_page_close_open;
+	struct bw_fixed mcifwr_total_page_close_open_time;
+	struct bw_fixed total_requests_for_adjusted_dmif_size;
+	struct bw_fixed total_dmifmc_urgent_trips;
+	struct bw_fixed total_dmifmc_urgent_latency;
+	struct bw_fixed total_display_reads_required_data;
+	struct bw_fixed total_display_reads_required_dram_access_data;
+	struct bw_fixed total_display_writes_required_data;
+	struct bw_fixed total_display_writes_required_dram_access_data;
+	struct bw_fixed display_reads_required_data;
+	struct bw_fixed display_reads_required_dram_access_data;
+	struct bw_fixed dmif_total_page_close_open_time;
+	struct bw_fixed min_cursor_memory_interface_buffer_size_in_time;
+	struct bw_fixed min_read_buffer_size_in_time;
+	struct bw_fixed display_reads_time_for_data_transfer;
+	struct bw_fixed display_writes_time_for_data_transfer;
+	struct bw_fixed dmif_required_dram_bandwidth;
+	struct bw_fixed mcifwr_required_dram_bandwidth;
+	struct bw_fixed required_dmifmc_urgent_latency_for_page_close_open;
+	struct bw_fixed required_mcifmcwr_urgent_latency;
+	struct bw_fixed required_dram_bandwidth_gbyte_per_second;
+	struct bw_fixed dram_bandwidth;
+	struct bw_fixed dmif_required_sclk;
+	struct bw_fixed mcifwr_required_sclk;
+	struct bw_fixed required_sclk;
+	struct bw_fixed downspread_factor;
+	struct bw_fixed v_scaler_efficiency;
+	struct bw_fixed scaler_limits_factor;
+	struct bw_fixed display_pipe_pixel_throughput;
+	struct bw_fixed total_dispclk_required_with_ramping;
+	struct bw_fixed total_dispclk_required_without_ramping;
+	struct bw_fixed total_read_request_bandwidth;
+	struct bw_fixed total_write_request_bandwidth;
+	struct bw_fixed dispclk_required_for_total_read_request_bandwidth;
+	struct bw_fixed total_dispclk_required_with_ramping_with_request_bandwidth;
+	struct bw_fixed total_dispclk_required_without_ramping_with_request_bandwidth;
+	struct bw_fixed dispclk;
+	struct bw_fixed blackout_recovery_time;
+	struct bw_fixed min_pixels_per_data_fifo_entry;
+	struct bw_fixed sclk_deep_sleep;
+	struct bw_fixed chunk_request_time;
+	struct bw_fixed cursor_request_time;
+	struct bw_fixed line_source_pixels_transfer_time;
+	struct bw_fixed dmifdram_access_efficiency;
+	struct bw_fixed mcifwrdram_access_efficiency;
+	struct bw_fixed total_average_bandwidth_no_compression;
+	struct bw_fixed total_average_bandwidth;
+	struct bw_fixed total_stutter_cycle_duration;
+	struct bw_fixed stutter_burst_time;
+	struct bw_fixed time_in_self_refresh;
+	struct bw_fixed stutter_efficiency;
+	struct bw_fixed worst_number_of_trips_to_memory;
+	struct bw_fixed immediate_flip_time;
+	struct bw_fixed latency_for_non_dmif_clients;
+	struct bw_fixed latency_for_non_mcifwr_clients;
+	struct bw_fixed dmifmc_urgent_latency_supported_in_high_sclk_and_yclk;
+	struct bw_fixed nbp_state_dram_speed_change_margin;
+	struct bw_fixed display_reads_time_for_data_transfer_and_urgent_latency;
+	struct bw_fixed dram_speed_change_margin;
+	struct bw_fixed min_vblank_dram_speed_change_margin;
+	struct bw_fixed min_stutter_refresh_duration;
+	uint32_t total_stutter_dmif_buffer_size;
+	uint32_t total_bytes_requested;
+	uint32_t min_stutter_dmif_buffer_size;
+	uint32_t num_stutter_bursts;
+	struct bw_fixed v_blank_nbp_state_dram_speed_change_latency_supported;
+	struct bw_fixed nbp_state_dram_speed_change_latency_supported;
+	bool fbc_en[maximum_number_of_surfaces];
+	bool lpt_en[maximum_number_of_surfaces];
+	bool displays_match_flag[maximum_number_of_surfaces];
+	bool use_alpha[maximum_number_of_surfaces];
+	bool orthogonal_rotation[maximum_number_of_surfaces];
+	bool enable[maximum_number_of_surfaces];
+	bool access_one_channel_only[maximum_number_of_surfaces];
+	bool scatter_gather_enable_for_pipe[maximum_number_of_surfaces];
+	bool interlace_mode[maximum_number_of_surfaces];
+	bool display_pstate_change_enable[maximum_number_of_surfaces];
+	bool line_buffer_prefetch[maximum_number_of_surfaces];
+	uint32_t bytes_per_pixel[maximum_number_of_surfaces];
+	uint32_t max_chunks_non_fbc_mode[maximum_number_of_surfaces];
+	uint32_t lb_bpc[maximum_number_of_surfaces];
+	uint32_t output_bpphdmi[maximum_number_of_surfaces];
+	uint32_t output_bppdp4_lane_hbr[maximum_number_of_surfaces];
+	uint32_t output_bppdp4_lane_hbr2[maximum_number_of_surfaces];
+	uint32_t output_bppdp4_lane_hbr3[maximum_number_of_surfaces];
+	enum bw_defines stereo_mode[maximum_number_of_surfaces];
+	struct bw_fixed dmif_buffer_transfer_time[maximum_number_of_surfaces];
+	struct bw_fixed displays_with_same_mode[maximum_number_of_surfaces];
+	struct bw_fixed stutter_dmif_buffer_size[maximum_number_of_surfaces];
+	struct bw_fixed stutter_refresh_duration[maximum_number_of_surfaces];
+	struct bw_fixed stutter_exit_watermark[maximum_number_of_surfaces];
+	struct bw_fixed stutter_entry_watermark[maximum_number_of_surfaces];
+	struct bw_fixed h_total[maximum_number_of_surfaces];
+	struct bw_fixed v_total[maximum_number_of_surfaces];
+	struct bw_fixed pixel_rate[maximum_number_of_surfaces];
+	struct bw_fixed src_width[maximum_number_of_surfaces];
+	struct bw_fixed pitch_in_pixels[maximum_number_of_surfaces];
+	struct bw_fixed pitch_in_pixels_after_surface_type[maximum_number_of_surfaces];
+	struct bw_fixed src_height[maximum_number_of_surfaces];
+	struct bw_fixed scale_ratio[maximum_number_of_surfaces];
+	struct bw_fixed h_taps[maximum_number_of_surfaces];
+	struct bw_fixed v_taps[maximum_number_of_surfaces];
+	struct bw_fixed h_scale_ratio[maximum_number_of_surfaces];
+	struct bw_fixed v_scale_ratio[maximum_number_of_surfaces];
+	struct bw_fixed rotation_angle[maximum_number_of_surfaces];
+	struct bw_fixed compression_rate[maximum_number_of_surfaces];
+	struct bw_fixed hsr[maximum_number_of_surfaces];
+	struct bw_fixed vsr[maximum_number_of_surfaces];
+	struct bw_fixed source_width_rounded_up_to_chunks[maximum_number_of_surfaces];
+	struct bw_fixed source_width_pixels[maximum_number_of_surfaces];
+	struct bw_fixed source_height_rounded_up_to_chunks[maximum_number_of_surfaces];
+	struct bw_fixed display_bandwidth[maximum_number_of_surfaces];
+	struct bw_fixed request_bandwidth[maximum_number_of_surfaces];
+	struct bw_fixed bytes_per_request[maximum_number_of_surfaces];
+	struct bw_fixed useful_bytes_per_request[maximum_number_of_surfaces];
+	struct bw_fixed lines_interleaved_in_mem_access[maximum_number_of_surfaces];
+	struct bw_fixed latency_hiding_lines[maximum_number_of_surfaces];
+	struct bw_fixed lb_partitions[maximum_number_of_surfaces];
+	struct bw_fixed lb_partitions_max[maximum_number_of_surfaces];
+	struct bw_fixed dispclk_required_with_ramping[maximum_number_of_surfaces];
+	struct bw_fixed dispclk_required_without_ramping[maximum_number_of_surfaces];
+	struct bw_fixed data_buffer_size[maximum_number_of_surfaces];
+	struct bw_fixed outstanding_chunk_request_limit[maximum_number_of_surfaces];
+	struct bw_fixed urgent_watermark[maximum_number_of_surfaces];
+	struct bw_fixed nbp_state_change_watermark[maximum_number_of_surfaces];
+	struct bw_fixed v_filter_init[maximum_number_of_surfaces];
+	struct bw_fixed stutter_cycle_duration[maximum_number_of_surfaces];
+	struct bw_fixed average_bandwidth[maximum_number_of_surfaces];
+	struct bw_fixed average_bandwidth_no_compression[maximum_number_of_surfaces];
+	struct bw_fixed scatter_gather_pte_request_limit[maximum_number_of_surfaces];
+	struct bw_fixed lb_size_per_component[maximum_number_of_surfaces];
+	struct bw_fixed memory_chunk_size_in_bytes[maximum_number_of_surfaces];
+	struct bw_fixed pipe_chunk_size_in_bytes[maximum_number_of_surfaces];
+	struct bw_fixed number_of_trips_to_memory_for_getting_apte_row[maximum_number_of_surfaces];
+	struct bw_fixed adjusted_data_buffer_size[maximum_number_of_surfaces];
+	struct bw_fixed adjusted_data_buffer_size_in_memory[maximum_number_of_surfaces];
+	struct bw_fixed pixels_per_data_fifo_entry[maximum_number_of_surfaces];
+	struct bw_fixed scatter_gather_pte_requests_in_row[maximum_number_of_surfaces];
+	struct bw_fixed pte_request_per_chunk[maximum_number_of_surfaces];
+	struct bw_fixed scatter_gather_page_width[maximum_number_of_surfaces];
+	struct bw_fixed scatter_gather_page_height[maximum_number_of_surfaces];
+	struct bw_fixed lb_lines_in_per_line_out_in_beginning_of_frame[maximum_number_of_surfaces];
+	struct bw_fixed lb_lines_in_per_line_out_in_middle_of_frame[maximum_number_of_surfaces];
+	struct bw_fixed cursor_width_pixels[maximum_number_of_surfaces];
+	struct bw_fixed minimum_latency_hiding[maximum_number_of_surfaces];
+	struct bw_fixed maximum_latency_hiding[maximum_number_of_surfaces];
+	struct bw_fixed minimum_latency_hiding_with_cursor[maximum_number_of_surfaces];
+	struct bw_fixed maximum_latency_hiding_with_cursor[maximum_number_of_surfaces];
+	struct bw_fixed src_pixels_for_first_output_pixel[maximum_number_of_surfaces];
+	struct bw_fixed src_pixels_for_last_output_pixel[maximum_number_of_surfaces];
+	struct bw_fixed src_data_for_first_output_pixel[maximum_number_of_surfaces];
+	struct bw_fixed src_data_for_last_output_pixel[maximum_number_of_surfaces];
+	struct bw_fixed active_time[maximum_number_of_surfaces];
+	struct bw_fixed horizontal_blank_and_chunk_granularity_factor[maximum_number_of_surfaces];
+	struct bw_fixed cursor_latency_hiding[maximum_number_of_surfaces];
+	struct bw_fixed v_blank_dram_speed_change_margin[maximum_number_of_surfaces];
+	uint32_t num_displays_with_margin[3][8];
+	struct bw_fixed dmif_burst_time[3][8];
+	struct bw_fixed mcifwr_burst_time[3][8];
+	struct bw_fixed line_source_transfer_time[maximum_number_of_surfaces][3][8];
+	struct bw_fixed dram_speed_change_line_source_transfer_time[maximum_number_of_surfaces][3][8];
+	struct bw_fixed min_dram_speed_change_margin[3][8];
+	struct bw_fixed dispclk_required_for_dram_speed_change[3][8];
+	struct bw_fixed blackout_duration_margin[3][8];
+	struct bw_fixed dispclk_required_for_blackout_duration[3][8];
+	struct bw_fixed dispclk_required_for_blackout_recovery[3][8];
+	struct bw_fixed dmif_required_sclk_for_urgent_latency[6];
+};
+
+/*******************************************************************************
+ * Output data structures.
+ ******************************************************************************/
+struct bw_watermarks {
+	uint32_t a_mark;
+	uint32_t b_mark;
+	uint32_t c_mark;
+	uint32_t d_mark;
+};
+
+struct bw_calcs_output {
+	bool cpuc_state_change_enable;
+	bool cpup_state_change_enable;
+	bool stutter_mode_enable;
+	bool nbp_state_change_enable;
+	bool all_displays_in_sync;
+	struct bw_watermarks urgent_wm_ns[6];
+	struct bw_watermarks stutter_exit_wm_ns[6];
+	struct bw_watermarks nbp_state_change_wm_ns[6];
+	uint32_t required_sclk;
+	uint32_t required_sclk_deep_sleep;
+	uint32_t required_yclk;
+	uint32_t dispclk_khz;
+	int blackout_recovery_time_us;
+};
+
+/**
+ * Initialize structures with data which will NOT change at runtime.
+ */
+void bw_calcs_init(
+	struct bw_calcs_dceip *bw_dceip,
+	struct bw_calcs_vbios *bw_vbios,
+	struct hw_asic_id asic_id);
+
+/**
+ * Return:
+ *	true -	Display(s) configuration supported.
+ *		In this case 'calcs_output' contains data for HW programming
+ *	false - Display(s) configuration not supported (not enough bandwidth).
+ */
+bool bw_calcs(
+	struct dc_context *ctx,
+	const struct bw_calcs_dceip *dceip,
+	const struct bw_calcs_vbios *vbios,
+	const struct pipe_ctx *pipe,
+	int pipe_count,
+	struct bw_calcs_output *calcs_output);
+
+#endif /* __BANDWIDTH_CALCS_H__ */
+
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h b/drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h
index 7ec4027..179f5ad 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/mem_input.h
@@ -27,7 +27,7 @@
 
 #include "dc.h"
 #include "include/grph_object_id.h"
-#include "inc/bandwidth_calcs.h"
+#include "inc/dce_calcs.h"
 
 #include "dce/dce_mem_input.h" /* temporary */
 
-- 
2.7.4