aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0739-drm-amd-dal-Clean-up-dc_temp.h.patch
blob: c19661c45532b4ba3080e274bc7a64be0bc7dcf0 (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
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
From 7aaf1d3c2261a553a0d07b48afd1666475344727 Mon Sep 17 00:00:00 2001
From: Jordan Lazare <Jordan.Lazare@amd.com>
Date: Mon, 25 Jan 2016 17:55:30 -0500
Subject: [PATCH 0739/1110] drm/amd/dal: Clean up dc_temp.h

Signed-off-by: Jordan Lazare <Jordan.Lazare@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 .../gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c    |  10 +-
 drivers/gpu/drm/amd/dal/dc/core/dc.c               |  45 --
 drivers/gpu/drm/amd/dal/dc/dc.h                    |  12 +-
 drivers/gpu/drm/amd/dal/dc/dc_temp.h               | 507 ---------------------
 drivers/gpu/drm/amd/dal/dc/dc_types.h              | 257 ++++++++++-
 .../drm/amd/dal/dc/dce110/dce110_hw_sequencer.c    |   1 +
 drivers/gpu/drm/amd/dal/dc/dce110/dce110_ipp.h     |   4 +
 .../gpu/drm/amd/dal/dc/dce110/dce110_ipp_gamma.c   |   1 +
 .../gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c   |   4 +-
 .../gpu/drm/amd/dal/dc/dce110/dce110_mem_input.h   |   2 +-
 drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.c     |   1 +
 drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.h     |   2 +
 .../gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma.c |   1 +
 .../amd/dal/dc/dce110/dce110_transform_bit_depth.c |   2 +-
 drivers/gpu/drm/amd/dal/dc/inc/core_types.h        |   1 +
 drivers/gpu/drm/amd/dal/dc/inc/gamma_types.h       | 117 +++++
 drivers/gpu/drm/amd/dal/dc/inc/hw_sequencer.h      |   9 +
 drivers/gpu/drm/amd/dal/dc/inc/ipp.h               |   1 +
 drivers/gpu/drm/amd/dal/dc/inc/mem_input.h         |   2 +-
 drivers/gpu/drm/amd/dal/dc/inc/opp.h               |  62 ++-
 drivers/gpu/drm/amd/dal/dc/inc/transform.h         |   2 +
 drivers/gpu/drm/amd/dal/include/fixed32_32.h       |   2 +
 .../gpu/drm/amd/dal/include/video_gamma_types.h    |   1 +
 23 files changed, 474 insertions(+), 572 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/dal/dc/dc_temp.h
 create mode 100644 drivers/gpu/drm/amd/dal/dc/inc/gamma_types.h

diff --git a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c
index 5fe5ca4..70d5dae 100644
--- a/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c
+++ b/drivers/gpu/drm/amd/dal/amdgpu_dm/amdgpu_dm_types.c
@@ -59,6 +59,7 @@ struct dm_connector_state {
 	container_of((x), struct dm_connector_state, base)
 
 #define AMDGPU_CRTC_MODE_PRIVATE_FLAGS_GAMMASET 1
+#define MAX_TARGET_NUM 6
 
 void amdgpu_dm_encoder_destroy(struct drm_encoder *encoder)
 {
@@ -314,15 +315,6 @@ static int dm_crtc_cursor_move(struct drm_crtc *crtc,
 		return -EINVAL;
 	}
 
-#if BUILD_FEATURE_TIMING_SYNC
-	{
-		struct drm_device *dev = crtc->dev;
-		struct amdgpu_device *adev = dev->dev_private;
-		struct amdgpu_display_manager *dm = &adev->dm;
-
-		dc_print_sync_report(dm->dc);
-	}
-#endif
 	return 0;
 }
 
diff --git a/drivers/gpu/drm/amd/dal/dc/core/dc.c b/drivers/gpu/drm/amd/dal/dc/core/dc.c
index 51a8589..1a17090 100644
--- a/drivers/gpu/drm/amd/dal/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/dal/dc/core/dc.c
@@ -55,11 +55,6 @@ struct dc_target_sync_report {
 	uint32_t v_count;
 };
 
-struct dc_sync_report {
-	uint32_t targets_num;
-	struct dc_target_sync_report trg_reports[MAX_TARGET_NUM];
-};
-
 /*******************************************************************************
  * Private functions
  ******************************************************************************/
@@ -794,46 +789,6 @@ void dc_resume(const struct dc *dc)
 		core_link_resume(dc->links[i]);
 }
 
-void dc_print_sync_report(
-	const struct dc *dc)
-{
-	uint32_t i;
-	const struct core_target *core_target;
-	const struct core_stream *core_stream;
-	struct dc_context *dc_ctx = dc->ctx;
-	struct dc_target_sync_report *target_sync_report;
-	struct dc_sync_report sync_report = { 0 };
-
-	if (dc->current_context.target_count > MAX_TARGET_NUM) {
-		DC_ERROR("Target count: %d > %d!\n",
-			dc->current_context.target_count,
-			MAX_TARGET_NUM);
-		return;
-	}
-
-	sync_report.targets_num = dc->current_context.target_count;
-
-	/* Step 1: get data for sync validation */
-	for (i = 0; i < dc->current_context.target_count; i++) {
-
-		core_target = dc->current_context.targets[i];
-		target_sync_report = &sync_report.trg_reports[i];
-		core_stream = DC_STREAM_TO_CORE(core_target->public.streams[0]);
-
-		dc->hwss.get_crtc_positions(
-			core_stream->tg,
-			&target_sync_report->h_count,
-			&target_sync_report->v_count);
-
-		DC_SYNC_INFO("GSL:target[%d]: h: %d\t v: %d\n",
-				i,
-				target_sync_report->h_count,
-				target_sync_report->v_count);
-	}
-
-	/* Step 2: validate that display pipes are synchronized (based on
-	 * data from Step 1). */
-}
 
 bool dc_read_dpcd(
 		struct dc *dc,
diff --git a/drivers/gpu/drm/amd/dal/dc/dc.h b/drivers/gpu/drm/amd/dal/dc/dc.h
index a06a8a7..fcc79ed 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc.h
@@ -68,7 +68,7 @@ struct dc_surface {
 	struct rect clip_rect;
 
 	union plane_size plane_size;
-	union plane_tiling_info tiling_info;
+	union dc_tiling_info tiling_info;
 	struct plane_colorimetry colorimetry;
 
 	enum surface_pixel_format format;
@@ -351,6 +351,16 @@ struct dc_sink *dc_sink_create(const struct dc_sink_init_data *init_params);
 /*******************************************************************************
  * Cursor interfaces - To manages the cursor within a target
  ******************************************************************************/
+/* TODO: Deprecated once we switch to dc_set_cursor_position */
+bool dc_target_set_cursor_attributes(
+	struct dc_target *dc_target,
+	const struct dc_cursor_attributes *attributes);
+
+bool dc_target_set_cursor_position(
+	struct dc_target *dc_target,
+	const struct dc_cursor_position *position);
+
+/* Newer interfaces  */
 struct dc_cursor {
 	struct dc_plane_address address;
 	struct dc_cursor_attributes attributes;
diff --git a/drivers/gpu/drm/amd/dal/dc/dc_temp.h b/drivers/gpu/drm/amd/dal/dc/dc_temp.h
deleted file mode 100644
index fc5b810..0000000
--- a/drivers/gpu/drm/amd/dal/dc/dc_temp.h
+++ /dev/null
@@ -1,507 +0,0 @@
-/*
- * Copyright 2012-15 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
- *
- */
-#ifndef DC_TEMP_H_
-#define DC_TEMP_H_
-
-#include "dc_types.h"
-
-#define MAX_SURFACE_NUM 2
-
-enum clamping_range {
-	CLAMPING_FULL_RANGE = 0,	   /* No Clamping */
-	CLAMPING_LIMITED_RANGE_8BPC,   /* 8  bpc: Clamping 1  to FE */
-	CLAMPING_LIMITED_RANGE_10BPC, /* 10 bpc: Clamping 4  to 3FB */
-	CLAMPING_LIMITED_RANGE_12BPC, /* 12 bpc: Clamping 10 to FEF */
-	/* Use programmable clampping value on FMT_CLAMP_COMPONENT_R/G/B. */
-	CLAMPING_LIMITED_RANGE_PROGRAMMABLE
-};
-
-struct clamping_and_pixel_encoding_params {
-	enum dc_pixel_encoding pixel_encoding; /* Pixel Encoding */
-	enum clamping_range clamping_level; /* Clamping identifier */
-	enum dc_color_depth c_depth; /* Deep color use. */
-};
-
-struct bit_depth_reduction_params {
-	struct {
-		/* truncate/round */
-		/* trunc/round enabled*/
-		uint32_t TRUNCATE_ENABLED:1;
-		/* 2 bits: 0=6 bpc, 1=8 bpc, 2 = 10bpc*/
-		uint32_t TRUNCATE_DEPTH:2;
-		/* truncate or round*/
-		uint32_t TRUNCATE_MODE:1;
-
-		/* spatial dither */
-		/* Spatial Bit Depth Reduction enabled*/
-		uint32_t SPATIAL_DITHER_ENABLED:1;
-		/* 2 bits: 0=6 bpc, 1 = 8 bpc, 2 = 10bpc*/
-		uint32_t SPATIAL_DITHER_DEPTH:2;
-		/* 0-3 to select patterns*/
-		uint32_t SPATIAL_DITHER_MODE:2;
-		/* Enable RGB random dithering*/
-		uint32_t RGB_RANDOM:1;
-		/* Enable Frame random dithering*/
-		uint32_t FRAME_RANDOM:1;
-		/* Enable HighPass random dithering*/
-		uint32_t HIGHPASS_RANDOM:1;
-
-		/* temporal dither*/
-		 /* frame modulation enabled*/
-		uint32_t FRAME_MODULATION_ENABLED:1;
-		/* same as for trunc/spatial*/
-		uint32_t FRAME_MODULATION_DEPTH:2;
-		/* 2/4 gray levels*/
-		uint32_t TEMPORAL_LEVEL:1;
-		uint32_t FRC25:2;
-		uint32_t FRC50:2;
-		uint32_t FRC75:2;
-	} flags;
-
-	uint32_t r_seed_value;
-	uint32_t b_seed_value;
-	uint32_t g_seed_value;
-};
-
-enum pipe_gating_control {
-	PIPE_GATING_CONTROL_DISABLE = 0,
-	PIPE_GATING_CONTROL_ENABLE,
-	PIPE_GATING_CONTROL_INIT
-};
-
-enum surface_color_space {
-	SURFACE_COLOR_SPACE_SRGB = 0x0000,
-	SURFACE_COLOR_SPACE_BT601 = 0x0001,
-	SURFACE_COLOR_SPACE_BT709 = 0x0002,
-	SURFACE_COLOR_SPACE_XVYCC_BT601 = 0x0004,
-	SURFACE_COLOR_SPACE_XVYCC_BT709 = 0x0008,
-	SURFACE_COLOR_SPACE_XRRGB = 0x0010
-};
-
-enum {
-    MAX_LANES = 2,
-    MAX_COFUNC_PATH = 6,
-    LAYER_INDEX_PRIMARY = -1,
-};
-
-/* Scaling format */
-enum scaling_transformation {
-    SCALING_TRANSFORMATION_UNINITIALIZED,
-    SCALING_TRANSFORMATION_IDENTITY = 0x0001,
-    SCALING_TRANSFORMATION_CENTER_TIMING = 0x0002,
-    SCALING_TRANSFORMATION_FULL_SCREEN_SCALE = 0x0004,
-    SCALING_TRANSFORMATION_PRESERVE_ASPECT_RATIO_SCALE = 0x0008,
-    SCALING_TRANSFORMATION_DAL_DECIDE = 0x0010,
-    SCALING_TRANSFORMATION_INVALID = 0x80000000,
-
-    /* Flag the first and last */
-    SCALING_TRANSFORMATION_BEGING = SCALING_TRANSFORMATION_IDENTITY,
-    SCALING_TRANSFORMATION_END =
-            SCALING_TRANSFORMATION_PRESERVE_ASPECT_RATIO_SCALE
-};
-
-struct view_stereo_3d_support {
-    enum view_3d_format format;
-    struct {
-        uint32_t CLONE_MODE:1;
-        uint32_t SCALING:1;
-        uint32_t SINGLE_FRAME_SW_PACKED:1;
-    } features;
-};
-
-struct plane_colorimetry {
-	enum surface_color_space color_space;
-	bool limited_range;
-};
-
-enum tiling_mode {
-    TILING_MODE_INVALID,
-    TILING_MODE_LINEAR,
-    TILING_MODE_TILED,
-    TILING_MODE_COUNT
-};
-
-struct view_position {
-    uint32_t x;
-    uint32_t y;
-};
-
-union plane_tiling_info {
-
-	struct {
-		/* Specifies the number of memory banks for tiling
-		 *	purposes.
-		 * Only applies to 2D and 3D tiling modes.
-		 *	POSSIBLE VALUES: 2,4,8,16
-		 */
-		uint32_t NUM_BANKS:5;
-		/* Specifies the number of tiles in the x direction
-		 *	to be incorporated into the same bank.
-		 * Only applies to 2D and 3D tiling modes.
-		 *	POSSIBLE VALUES: 1,2,4,8
-		 */
-		uint32_t BANK_WIDTH:4;
-		/* Specifies the number of tiles in the y direction to
-		 *	be incorporated into the same bank.
-		 * Only applies to 2D and 3D tiling modes.
-		 *	POSSIBLE VALUES: 1,2,4,8
-		 */
-		uint32_t BANK_HEIGHT:4;
-		/* Specifies the macro tile aspect ratio. Only applies
-		 * to 2D and 3D tiling modes.
-		 */
-		uint32_t TILE_ASPECT:3;
-		/* Specifies the number of bytes that will be stored
-		 *	contiguously for each tile.
-		 * If the tile data requires more storage than this
-		 *	amount, it is split into multiple slices.
-		 * This field must not be larger than
-		 *	GB_ADDR_CONFIG.DRAM_ROW_SIZE.
-		 * Only applies to 2D and 3D tiling modes.
-		 * For color render targets, TILE_SPLIT >= 256B.
-		 */
-		uint32_t TILE_SPLIT:3;
-		/* Specifies the addressing within a tile.
-		 *	0x0 - DISPLAY_MICRO_TILING
-		 *	0x1 - THIN_MICRO_TILING
-		 *	0x2 - DEPTH_MICRO_TILING
-		 *	0x3 - ROTATED_MICRO_TILING
-		 */
-		uint32_t TILE_MODE:2;
-		/* Specifies the number of pipes and how they are
-		 *	interleaved in the surface.
-		 * Refer to memory addressing document for complete
-		 *	details and constraints.
-		 */
-		uint32_t PIPE_CONFIG:5;
-		/* Specifies the tiling mode of the surface.
-		 * THIN tiles use an 8x8x1 tile size.
-		 * THICK tiles use an 8x8x4 tile size.
-		 * 2D tiling modes rotate banks for successive Z slices
-		 * 3D tiling modes rotate pipes and banks for Z slices
-		 * Refer to memory addressing document for complete
-		 *	details and constraints.
-		 */
-		uint32_t ARRAY_MODE:4;
-	} grph;
-
-
-	struct {
-		/*possible values: 2,4,8,16*/
-		uint32_t NUM_BANKS:5;
-		/*must use enum video_array_mode*/
-		uint32_t ARRAY_MODE:4;
-		/*must use enum addr_pipe_config*/
-		uint32_t PIPE_CONFIG:5;
-		/*possible values 1,2,4,8 */
-		uint32_t BANK_WIDTH_LUMA:4;
-		/*possible values 1,2,4,8 */
-		uint32_t BANK_HEIGHT_LUMA:4;
-		/*must use enum macro_tile_aspect*/
-		uint32_t TILE_ASPECT_LUMA:3;
-		/*must use enum tile_split*/
-		uint32_t TILE_SPLIT_LUMA:3;
-		/*must use micro_tile_mode */
-		uint32_t TILE_MODE_LUMA:2;
-		/*possible values: 1,2,4,8*/
-		uint32_t BANK_WIDTH_CHROMA:4;
-		/*possible values: 1,2,4,8*/
-		uint32_t BANK_HEIGHT_CHROMA:4;
-		/*must use enum macro_tile_aspect*/
-		uint32_t TILE_ASPECT_CHROMA:3;
-		/*must use enum tile_split*/
-		uint32_t TILE_SPLIT_CHROMA:3;
-		/*must use enum micro_tile_mode*/
-		uint32_t TILE_MODE_CHROMA:2;
-
-	} video;
-
-	uint64_t value;
-};
-
-union plane_size {
-	/* Grph or Video will be selected
-	 * based on format above:
-	 * Use Video structure if
-	 * format >= DalPixelFormat_VideoBegin
-	 * else use Grph structure
-	 */
-	struct {
-		struct rect surface_size;
-		/* Graphic surface pitch in pixels.
-		 * In LINEAR_GENERAL mode, pitch
-		 * is 32 pixel aligned.
-		 */
-		uint32_t surface_pitch;
-	} grph;
-
-	struct {
-		struct rect luma_size;
-		/* Graphic surface pitch in pixels.
-		 * In LINEAR_GENERAL mode, pitch is
-		 * 32 pixel aligned.
-		 */
-		uint32_t luma_pitch;
-
-		struct rect chroma_size;
-		/* Graphic surface pitch in pixels.
-		 * In LINEAR_GENERAL mode, pitch is
-		 * 32 pixel aligned.
-		 */
-		uint32_t chroma_pitch;
-	} video;
-};
-
-enum dc_scaling_transform {
-	SCL_TRANS_CENTERED = 0,
-	SCL_TRANS_ASPECT_RATIO,
-	SCL_TRANS_FULL
-};
-
-struct dev_c_lut {
-	uint8_t red;
-	uint8_t green;
-	uint8_t blue;
-};
-
-struct dev_c_lut16 {
-	uint16_t red;
-	uint16_t green;
-	uint16_t blue;
-};
-
-enum gamma_ramp_type {
-	GAMMA_RAMP_UNINITIALIZED = 0,
-	GAMMA_RAMP_DEFAULT,
-	GAMMA_RAMP_RBG256X3X16,
-	GAMMA_RAMP_DXGI_1,
-};
-
-enum surface_type {
-	OVERLAY_SURFACE = 1, GRAPHIC_SURFACE
-};
-
-#define CONST_RGB_GAMMA_VALUE 2400
-
-enum {
-	RGB_256X3X16 = 256, DX_GAMMA_RAMP_MAX = 1025
-};
-
-struct gamma_ramp_rgb256x3x16 {
-	uint16_t red[RGB_256X3X16];
-	uint16_t green[RGB_256X3X16];
-	uint16_t blue[RGB_256X3X16];
-};
-
-struct dxgi_rgb {
-	struct fixed32_32 red;
-	struct fixed32_32 green;
-	struct fixed32_32 blue;
-};
-
-struct gamma_ramp_dxgi_1 {
-	struct dxgi_rgb scale;
-	struct dxgi_rgb offset;
-	struct dxgi_rgb gamma_curve[DX_GAMMA_RAMP_MAX];
-};
-
-struct gamma_ramp {
-	enum gamma_ramp_type type;
-	union {
-		struct gamma_ramp_rgb256x3x16 gamma_ramp_rgb256x3x16;
-		struct gamma_ramp_dxgi_1 gamma_ramp_dxgi1;
-	};
-	uint32_t size;
-};
-
-struct regamma_ramp {
-	uint16_t gamma[RGB_256X3X16 * 3];
-};
-
-/* used by Graphics and Overlay gamma */
-struct gamma_coeff {
-	int32_t gamma[3];
-	int32_t a0[3]; /* index 0 for red, 1 for green, 2 for blue */
-	int32_t a1[3];
-	int32_t a2[3];
-	int32_t a3[3];
-};
-
-struct regamma_lut {
-	union {
-		struct {
-			uint32_t GRAPHICS_DEGAMMA_SRGB :1;
-			uint32_t OVERLAY_DEGAMMA_SRGB :1;
-			uint32_t GAMMA_RAMP_ARRAY :1;
-			uint32_t APPLY_DEGAMMA :1;
-			uint32_t RESERVED :28;
-		} bits;
-		uint32_t value;
-	} features;
-
-	union {
-		struct regamma_ramp regamma_ramp;
-		struct gamma_coeff gamma_coeff;
-	};
-};
-
-union gamma_flag {
-	struct {
-		uint32_t config_is_changed :1;
-		uint32_t both_pipe_req :1;
-		uint32_t regamma_update :1;
-		uint32_t gamma_update :1;
-		uint32_t reserved :28;
-	} bits;
-	uint32_t u_all;
-};
-
-enum graphics_regamma_adjust {
-	GRAPHICS_REGAMMA_ADJUST_BYPASS = 0, GRAPHICS_REGAMMA_ADJUST_HW, /* without adjustments */
-	GRAPHICS_REGAMMA_ADJUST_SW /* use adjustments */
-};
-
-enum graphics_gamma_lut {
-	GRAPHICS_GAMMA_LUT_LEGACY = 0, /* use only legacy LUT */
-	GRAPHICS_GAMMA_LUT_REGAMMA, /* use only regamma LUT */
-	GRAPHICS_GAMMA_LUT_LEGACY_AND_REGAMMA /* use legacy & regamma LUT's */
-};
-
-enum graphics_degamma_adjust {
-	GRAPHICS_DEGAMMA_ADJUST_BYPASS = 0, GRAPHICS_DEGAMMA_ADJUST_HW, /*without adjustments */
-	GRAPHICS_DEGAMMA_ADJUST_SW /* use adjustments */
-};
-
-struct gamma_parameters {
-	union gamma_flag flag;
-	enum pixel_format surface_pixel_format; /*OS surface pixel format*/
-	struct regamma_lut regamma;
-
-	enum graphics_regamma_adjust regamma_adjust_type;
-	enum graphics_degamma_adjust degamma_adjust_type;
-
-	enum graphics_gamma_lut selected_gamma_lut;
-
-	bool disable_adjustments;
-
-	/* here we grow with parameters if necessary */
-};
-
-struct pixel_format_support {
-	bool INDEX8 :1;
-	bool RGB565 :1;
-	bool ARGB8888 :1;
-	bool ARGB2101010 :1;
-	bool ARGB2101010_XRBIAS :1;
-	bool FP16 :1;
-};
-
-struct render_mode {
-	struct view view;
-	enum pixel_format pixel_format;
-};
-
-struct refresh_rate {
-	uint32_t field_rate;
-	bool INTERLACED :1;
-	bool VIDEO_OPTIMIZED_RATE :1;
-};
-
-struct stereo_3d_view {
-	enum view_3d_format view_3d_format;
-	union {
-		uint32_t raw;
-		struct /*stereo_3d_view_flags*/
-		{
-			bool SINGLE_FRAME_SW_PACKED :1;
-			bool EXCLUSIVE_3D :1;
-		} bits;
-	} flags;
-};
-
-enum solution_importance {
-	SOLUTION_IMPORTANCE_PREFERRED = 1,
-	/* Means we want to use this solution
-	 * even in wide topology configurations*/
-	SOLUTION_IMPORTANCE_SAFE,
-	SOLUTION_IMPORTANCE_UNSAFE,
-	SOLUTION_IMPORTANCE_DEFAULT
-/* Temporary state , means Solution object
- * should define importance by itself
- */
-};
-
-struct solution {
-	const struct dc_mode_timing *dc_mode_timing;
-	enum solution_importance importance;
-	bool is_custom_mode;
-	uint32_t scl_support[NUM_PIXEL_FORMATS];
-	/* bit vector of the scaling that can be supported on the timing */
-	uint32_t scl_support_guaranteed[NUM_PIXEL_FORMATS];
-	/* subset of m_sclSupport that can be guaranteed supported */
-};
-
-enum timing_select {
-	TIMING_SELECT_DEFAULT,
-	TIMING_SELECT_NATIVE_ONLY,
-	TIMING_SELECT_PRESERVE_ASPECT
-};
-
-enum downscale_state {
-	DOWNSCALESTATE_DEFAULT,     // Disabled, but not user selected
-	DOWNSCALESTATE_DISABLED,    // User disabled through CCC
-	DOWNSCALESTATE_ENABLED      // User enabled through CCC
-};
-struct scaling_support {
-	bool IDENTITY :1;
-	bool FULL_SCREEN_SCALE :1;
-	bool PRESERVE_ASPECT_RATIO_SCALE :1;
-	bool CENTER_TIMING :1;
-};
-
-
-/* TODO: combine the two cursor functions into one to make cursor
- * programming resistant to changes in OS call sequence. */
-bool dc_target_set_cursor_attributes(
-	struct dc_target *dc_target,
-	const struct dc_cursor_attributes *attributes);
-
-bool dc_target_set_cursor_position(
-	struct dc_target *dc_target,
-	const struct dc_cursor_position *position);
-
-/******************************************************************************
- * TODO: these definitions only for Timing Sync feature bring-up. Remove
- * when the feature is complete.
- *****************************************************************************/
-
-#define MAX_TARGET_NUM 6
-
-void dc_print_sync_report(
-	const struct dc *dc);
-
-/******************************************************************************/
-
-#endif /* DC_TEMP_H_ */
diff --git a/drivers/gpu/drm/amd/dal/dc/dc_types.h b/drivers/gpu/drm/amd/dal/dc/dc_types.h
index 60e5603..fe7046f 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc_types.h
@@ -63,6 +63,17 @@ enum dce_environment {
 /********************************/
 
 #define MAX_EDID_BUFFER_SIZE 512
+#define MAX_SURFACE_NUM 2
+#define NUM_PIXEL_FORMATS 10
+
+enum surface_color_space {
+	SURFACE_COLOR_SPACE_SRGB = 0x0000,
+	SURFACE_COLOR_SPACE_BT601 = 0x0001,
+	SURFACE_COLOR_SPACE_BT709 = 0x0002,
+	SURFACE_COLOR_SPACE_XVYCC_BT601 = 0x0004,
+	SURFACE_COLOR_SPACE_XVYCC_BT709 = 0x0008,
+	SURFACE_COLOR_SPACE_XRRGB = 0x0010
+};
 
 /*Displayable pixel format in fb*/
 enum surface_pixel_format {
@@ -174,9 +185,6 @@ enum dc_pixel_encoding {
  *  Please increase if pixel_format enum increases
  * num  from  PIXEL_FORMAT_INDEX8 to PIXEL_FORMAT_444BPP32
  */
-#define NUM_PIXEL_FORMATS 10
-
-
 
 union large_integer {
 	struct {
@@ -211,6 +219,11 @@ enum dc_edid_status {
 	EDID_BAD_CHECKSUM,
 };
 
+struct plane_colorimetry {
+	enum surface_color_space color_space;
+	bool limited_range;
+};
+
 /* audio capability from EDID*/
 struct dc_cea_audio_mode {
 	uint8_t format_code; /* ucData[0] [6:3]*/
@@ -710,6 +723,47 @@ enum dc_connection_type {
  * returns 0.
  *
  */
+/* TODO: Deprecated */
+enum {
+	RGB_256X3X16 = 256,
+	DX_GAMMA_RAMP_MAX = 1025
+};
+
+enum gamma_ramp_type {
+	GAMMA_RAMP_UNINITIALIZED = 0,
+	GAMMA_RAMP_DEFAULT,
+	GAMMA_RAMP_RBG256X3X16,
+	GAMMA_RAMP_DXGI_1,
+};
+
+struct dxgi_rgb {
+	struct fixed32_32 red;
+	struct fixed32_32 green;
+	struct fixed32_32 blue;
+};
+
+struct gamma_ramp_dxgi_1 {
+	struct dxgi_rgb scale;
+	struct dxgi_rgb offset;
+	struct dxgi_rgb gamma_curve[DX_GAMMA_RAMP_MAX];
+};
+
+struct gamma_ramp_rgb256x3x16 {
+	uint16_t red[RGB_256X3X16];
+	uint16_t green[RGB_256X3X16];
+	uint16_t blue[RGB_256X3X16];
+};
+
+struct gamma_ramp {
+	enum gamma_ramp_type type;
+	union {
+		struct gamma_ramp_rgb256x3x16 gamma_ramp_rgb256x3x16;
+		struct gamma_ramp_dxgi_1 gamma_ramp_dxgi1;
+	};
+	uint32_t size;
+};
+
+
 struct dc_gamma_ramp {
 	uint32_t (*get_gamma_value) (
 			void *context,
@@ -728,6 +782,201 @@ struct dc_csc_adjustments {
 	struct fixed31_32 hue;
 };
 
-#include "dc_temp.h"
+
+enum {
+	MAX_LANES = 2,
+	MAX_COFUNC_PATH = 6,
+	LAYER_INDEX_PRIMARY = -1,
+};
+
+/* Scaling format */
+enum scaling_transformation {
+	SCALING_TRANSFORMATION_UNINITIALIZED,
+	SCALING_TRANSFORMATION_IDENTITY = 0x0001,
+	SCALING_TRANSFORMATION_CENTER_TIMING = 0x0002,
+	SCALING_TRANSFORMATION_FULL_SCREEN_SCALE = 0x0004,
+	SCALING_TRANSFORMATION_PRESERVE_ASPECT_RATIO_SCALE = 0x0008,
+	SCALING_TRANSFORMATION_DAL_DECIDE = 0x0010,
+	SCALING_TRANSFORMATION_INVALID = 0x80000000,
+
+	/* Flag the first and last */
+	SCALING_TRANSFORMATION_BEGING = SCALING_TRANSFORMATION_IDENTITY,
+	SCALING_TRANSFORMATION_END =
+		SCALING_TRANSFORMATION_PRESERVE_ASPECT_RATIO_SCALE
+};
+
+struct view_stereo_3d_support {
+	enum view_3d_format format;
+	struct {
+		uint32_t CLONE_MODE:1;
+		uint32_t SCALING:1;
+		uint32_t SINGLE_FRAME_SW_PACKED:1;
+	} features;
+};
+
+enum tiling_mode {
+	TILING_MODE_INVALID,
+	TILING_MODE_LINEAR,
+	TILING_MODE_TILED,
+	TILING_MODE_COUNT
+};
+
+struct view_position {
+	uint32_t x;
+	uint32_t y;
+};
+
+struct render_mode {
+	struct view view;
+	enum pixel_format pixel_format;
+};
+
+struct pixel_format_support {
+	bool INDEX8 :1;
+	bool RGB565 :1;
+	bool ARGB8888 :1;
+	bool ARGB2101010 :1;
+	bool ARGB2101010_XRBIAS :1;
+	bool FP16 :1;
+};
+
+struct stereo_3d_view {
+	enum view_3d_format view_3d_format;
+	union {
+		uint32_t raw;
+		struct /*stereo_3d_view_flags*/
+		{
+			bool SINGLE_FRAME_SW_PACKED :1;
+			bool EXCLUSIVE_3D :1;
+		} bits;
+	} flags;
+};
+
+/* TODO: Rename to dc_tiling_info */
+union dc_tiling_info {
+
+	struct {
+		/* Specifies the number of memory banks for tiling
+		 *	purposes.
+		 * Only applies to 2D and 3D tiling modes.
+		 *	POSSIBLE VALUES: 2,4,8,16
+		 */
+		uint32_t NUM_BANKS:5;
+		/* Specifies the number of tiles in the x direction
+		 *	to be incorporated into the same bank.
+		 * Only applies to 2D and 3D tiling modes.
+		 *	POSSIBLE VALUES: 1,2,4,8
+		 */
+		uint32_t BANK_WIDTH:4;
+		/* Specifies the number of tiles in the y direction to
+		 *	be incorporated into the same bank.
+		 * Only applies to 2D and 3D tiling modes.
+		 *	POSSIBLE VALUES: 1,2,4,8
+		 */
+		uint32_t BANK_HEIGHT:4;
+		/* Specifies the macro tile aspect ratio. Only applies
+		 * to 2D and 3D tiling modes.
+		 */
+		uint32_t TILE_ASPECT:3;
+		/* Specifies the number of bytes that will be stored
+		 *	contiguously for each tile.
+		 * If the tile data requires more storage than this
+		 *	amount, it is split into multiple slices.
+		 * This field must not be larger than
+		 *	GB_ADDR_CONFIG.DRAM_ROW_SIZE.
+		 * Only applies to 2D and 3D tiling modes.
+		 * For color render targets, TILE_SPLIT >= 256B.
+		 */
+		uint32_t TILE_SPLIT:3;
+		/* Specifies the addressing within a tile.
+		 *	0x0 - DISPLAY_MICRO_TILING
+		 *	0x1 - THIN_MICRO_TILING
+		 *	0x2 - DEPTH_MICRO_TILING
+		 *	0x3 - ROTATED_MICRO_TILING
+		 */
+		uint32_t TILE_MODE:2;
+		/* Specifies the number of pipes and how they are
+		 *	interleaved in the surface.
+		 * Refer to memory addressing document for complete
+		 *	details and constraints.
+		 */
+		uint32_t PIPE_CONFIG:5;
+		/* Specifies the tiling mode of the surface.
+		 * THIN tiles use an 8x8x1 tile size.
+		 * THICK tiles use an 8x8x4 tile size.
+		 * 2D tiling modes rotate banks for successive Z slices
+		 * 3D tiling modes rotate pipes and banks for Z slices
+		 * Refer to memory addressing document for complete
+		 *	details and constraints.
+		 */
+		uint32_t ARRAY_MODE:4;
+	} grph;
+
+
+	struct {
+		/*possible values: 2,4,8,16*/
+		uint32_t NUM_BANKS:5;
+		/*must use enum video_array_mode*/
+		uint32_t ARRAY_MODE:4;
+		/*must use enum addr_pipe_config*/
+		uint32_t PIPE_CONFIG:5;
+		/*possible values 1,2,4,8 */
+		uint32_t BANK_WIDTH_LUMA:4;
+		/*possible values 1,2,4,8 */
+		uint32_t BANK_HEIGHT_LUMA:4;
+		/*must use enum macro_tile_aspect*/
+		uint32_t TILE_ASPECT_LUMA:3;
+		/*must use enum tile_split*/
+		uint32_t TILE_SPLIT_LUMA:3;
+		/*must use micro_tile_mode */
+		uint32_t TILE_MODE_LUMA:2;
+		/*possible values: 1,2,4,8*/
+		uint32_t BANK_WIDTH_CHROMA:4;
+		/*possible values: 1,2,4,8*/
+		uint32_t BANK_HEIGHT_CHROMA:4;
+		/*must use enum macro_tile_aspect*/
+		uint32_t TILE_ASPECT_CHROMA:3;
+		/*must use enum tile_split*/
+		uint32_t TILE_SPLIT_CHROMA:3;
+		/*must use enum micro_tile_mode*/
+		uint32_t TILE_MODE_CHROMA:2;
+
+	} video;
+
+	uint64_t value;
+};
+
+union plane_size {
+	/* Grph or Video will be selected
+	 * based on format above:
+	 * Use Video structure if
+	 * format >= DalPixelFormat_VideoBegin
+	 * else use Grph structure
+	 */
+	struct {
+		struct rect surface_size;
+		/* Graphic surface pitch in pixels.
+		 * In LINEAR_GENERAL mode, pitch
+		 * is 32 pixel aligned.
+		 */
+		uint32_t surface_pitch;
+	} grph;
+
+	struct {
+		struct rect luma_size;
+		/* Graphic surface pitch in pixels.
+		 * In LINEAR_GENERAL mode, pitch is
+		 * 32 pixel aligned.
+		 */
+		uint32_t luma_pitch;
+
+		struct rect chroma_size;
+		/* Graphic surface pitch in pixels.
+		 * In LINEAR_GENERAL mode, pitch is
+		 * 32 pixel aligned.
+		 */
+		uint32_t chroma_pitch;
+	} video;
+};
 
 #endif /* DC_TYPES_H_ */
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c
index af7cf0d..046a9a5 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_hw_sequencer.c
@@ -30,6 +30,7 @@
 #include "resource.h"
 #include "hw_sequencer.h"
 #include "dc_helpers.h"
+#include "gamma_types.h"
 
 #include "dce110/dce110_resource.h"
 #include "dce110/dce110_timing_generator.h"
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_ipp.h b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_ipp.h
index f0e9e7d..709906f 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_ipp.h
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_ipp.h
@@ -28,6 +28,10 @@
 
 #include "inc/ipp.h"
 
+
+struct gamma_parameters;
+struct dev_c_lut;
+
 #define TO_DCE110_IPP(input_pixel_processor)\
 	container_of(input_pixel_processor, struct dce110_ipp, base)
 
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_ipp_gamma.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_ipp_gamma.c
index 2aa432a..a30c0da 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_ipp_gamma.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_ipp_gamma.c
@@ -32,6 +32,7 @@
 #include "dce/dce_11_0_sh_mask.h"
 
 #include "dce110_ipp.h"
+#include "gamma_types.h"
 
 #define DCP_REG(reg)\
 	(reg + ipp110->offsets.dcp_offset)
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c
index 4e809b6..b70c8e1 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.c
@@ -179,7 +179,7 @@ static void enable(struct dce110_mem_input *mem_input110)
 
 static void program_tiling(
 	struct dce110_mem_input *mem_input110,
-	const union plane_tiling_info *info,
+	const union dc_tiling_info *info,
 	const enum surface_pixel_format pixel_format)
 {
 	uint32_t value = 0;
@@ -458,7 +458,7 @@ bool dce110_mem_input_program_surface_flip_and_addr(
 bool dce110_mem_input_program_surface_config(
 	struct mem_input *mem_input,
 	enum surface_pixel_format format,
-	union plane_tiling_info *tiling_info,
+	union dc_tiling_info *tiling_info,
 	union plane_size *plane_size,
 	enum dc_rotation_angle rotation)
 {
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.h b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.h
index 997070b..cd19169 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.h
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_mem_input.h
@@ -109,7 +109,7 @@ bool dce110_mem_input_program_surface_flip_and_addr(
 bool  dce110_mem_input_program_surface_config(
 	struct mem_input *mem_input,
 	enum surface_pixel_format format,
-	union plane_tiling_info *tiling_info,
+	union dc_tiling_info *tiling_info,
 	union plane_size *plane_size,
 	enum dc_rotation_angle rotation);
 
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.c
index 99163ee..7dcfd2e 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.c
@@ -30,6 +30,7 @@
 #include "dce/dce_11_0_sh_mask.h"
 
 #include "dce110_opp.h"
+#include "gamma_types.h"
 
 enum {
 	MAX_LUT_ENTRY = 256,
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.h b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.h
index f9b828c..e53eb74 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.h
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.h
@@ -27,7 +27,9 @@
 
 #include "dc_types.h"
 #include "inc/opp.h"
+#include "gamma_types.h"
 
+struct gamma_parameters;
 
 #define FROM_DCE11_OPP(opp)\
 	container_of(opp, struct dce110_opp, base)
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma.c
index dceba7d..f589025 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma.c
@@ -30,6 +30,7 @@
 #include "dce/dce_11_0_sh_mask.h"
 
 #include "dce110_opp.h"
+#include "gamma_types.h"
 
 #define DCP_REG(reg)\
 	(reg + opp110->offsets.dcp_offset)
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c
index d0e4b98..a64a507 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_bit_depth.c
@@ -30,7 +30,7 @@
 #include "dce/dce_11_0_sh_mask.h"
 
 #include "dce110_transform.h"
-
+#include "opp.h"
 #include "include/logger_interface.h"
 #include "include/fixed32_32.h"
 
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/core_types.h b/drivers/gpu/drm/amd/dal/dc/inc/core_types.h
index d075de1..e3b5918 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/core_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/core_types.h
@@ -70,6 +70,7 @@ void enable_surface_flip_reporting(struct dc_surface *dc_surface,
 #include "audio_interface.h"
 #include "scaler_types.h"
 #include "hw_sequencer_types.h"
+#include "opp.h"
 
 #define DC_STREAM_TO_CORE(dc_stream) container_of( \
 	dc_stream, struct core_stream, public)
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/gamma_types.h b/drivers/gpu/drm/amd/dal/dc/inc/gamma_types.h
new file mode 100644
index 0000000..048303e
--- /dev/null
+++ b/drivers/gpu/drm/amd/dal/dc/inc/gamma_types.h
@@ -0,0 +1,117 @@
+/*
+ * Copyright 2012-15 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
+ *
+ */
+#ifndef GAMMA_TYPES_H_
+#define GAMMA_TYPES_H_
+
+#include "dc_types.h"
+#include "dc_services_types.h"
+
+/* TODO: Used in IPP and OPP */
+struct dev_c_lut {
+	uint8_t red;
+	uint8_t green;
+	uint8_t blue;
+};
+
+struct dev_c_lut16 {
+	uint16_t red;
+	uint16_t green;
+	uint16_t blue;
+};
+
+struct regamma_ramp {
+	uint16_t gamma[RGB_256X3X16 * 3];
+};
+
+/* used by Graphics and Overlay gamma */
+struct gamma_coeff {
+	int32_t gamma[3];
+	int32_t a0[3]; /* index 0 for red, 1 for green, 2 for blue */
+	int32_t a1[3];
+	int32_t a2[3];
+	int32_t a3[3];
+};
+
+struct regamma_lut {
+	union {
+		struct {
+			uint32_t GRAPHICS_DEGAMMA_SRGB :1;
+			uint32_t OVERLAY_DEGAMMA_SRGB :1;
+			uint32_t GAMMA_RAMP_ARRAY :1;
+			uint32_t APPLY_DEGAMMA :1;
+			uint32_t RESERVED :28;
+		} bits;
+		uint32_t value;
+	} features;
+
+	union {
+		struct regamma_ramp regamma_ramp;
+		struct gamma_coeff gamma_coeff;
+	};
+};
+
+union gamma_flag {
+	struct {
+		uint32_t config_is_changed :1;
+		uint32_t both_pipe_req :1;
+		uint32_t regamma_update :1;
+		uint32_t gamma_update :1;
+		uint32_t reserved :28;
+	} bits;
+	uint32_t u_all;
+};
+
+enum graphics_regamma_adjust {
+	GRAPHICS_REGAMMA_ADJUST_BYPASS = 0, GRAPHICS_REGAMMA_ADJUST_HW, /* without adjustments */
+	GRAPHICS_REGAMMA_ADJUST_SW /* use adjustments */
+};
+
+enum graphics_gamma_lut {
+	GRAPHICS_GAMMA_LUT_LEGACY = 0, /* use only legacy LUT */
+	GRAPHICS_GAMMA_LUT_REGAMMA, /* use only regamma LUT */
+	GRAPHICS_GAMMA_LUT_LEGACY_AND_REGAMMA /* use legacy & regamma LUT's */
+};
+
+enum graphics_degamma_adjust {
+	GRAPHICS_DEGAMMA_ADJUST_BYPASS = 0, GRAPHICS_DEGAMMA_ADJUST_HW, /*without adjustments */
+	GRAPHICS_DEGAMMA_ADJUST_SW /* use adjustments */
+};
+
+struct gamma_parameters {
+	union gamma_flag flag;
+	enum pixel_format surface_pixel_format; /*OS surface pixel format*/
+	struct regamma_lut regamma;
+
+	enum graphics_regamma_adjust regamma_adjust_type;
+	enum graphics_degamma_adjust degamma_adjust_type;
+
+	enum graphics_gamma_lut selected_gamma_lut;
+
+	bool disable_adjustments;
+
+	/* here we grow with parameters if necessary */
+};
+
+#endif
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/hw_sequencer.h b/drivers/gpu/drm/amd/dal/dc/inc/hw_sequencer.h
index 0bbf9b5..1dedf7c 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/hw_sequencer.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/hw_sequencer.h
@@ -27,6 +27,15 @@
 #define __DC_HW_SEQUENCER_H__
 #include "core_types.h"
 
+struct gamma_parameters;
+
+enum pipe_gating_control {
+	PIPE_GATING_CONTROL_DISABLE = 0,
+	PIPE_GATING_CONTROL_ENABLE,
+	PIPE_GATING_CONTROL_INIT
+};
+
+
 struct hw_sequencer_funcs {
 
 	enum dc_status (*apply_ctx_to_hw)(
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/ipp.h b/drivers/gpu/drm/amd/dal/dc/inc/ipp.h
index e7151cd..8e7cc31 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/ipp.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/ipp.h
@@ -32,6 +32,7 @@
 #include "include/video_csc_types.h"
 #include "include/hw_sequencer_types.h"
 
+struct dev_c_lut;
 
 #define MAXTRIX_COEFFICIENTS_NUMBER 12
 #define MAXTRIX_COEFFICIENTS_WRAP_NUMBER (MAXTRIX_COEFFICIENTS_NUMBER + 4)
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/mem_input.h b/drivers/gpu/drm/amd/dal/dc/inc/mem_input.h
index 2647f84..4d653ab 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/mem_input.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/mem_input.h
@@ -57,7 +57,7 @@ struct mem_input_funcs {
 	bool (*mem_input_program_surface_config)(
 		struct mem_input *mem_input,
 		enum surface_pixel_format format,
-		union plane_tiling_info *tiling_info,
+		union dc_tiling_info *tiling_info,
 		union plane_size *plane_size,
 		enum dc_rotation_angle rotation);
 };
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/opp.h b/drivers/gpu/drm/amd/dal/dc/inc/opp.h
index 543848a..f2171de 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/opp.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/opp.h
@@ -26,14 +26,74 @@
 #ifndef __DAL_OPP_H__
 #define __DAL_OPP_H__
 
-#include "dc_temp.h"
+#include "dc_types.h"
 #include "grph_object_id.h"
 #include "grph_csc_types.h"
+#include "dc_services_types.h"
 
 struct fixed31_32;
+struct gamma_parameters;
 
 /* TODO: Need cleanup */
 
+enum clamping_range {
+	CLAMPING_FULL_RANGE = 0,	   /* No Clamping */
+	CLAMPING_LIMITED_RANGE_8BPC,   /* 8  bpc: Clamping 1  to FE */
+	CLAMPING_LIMITED_RANGE_10BPC, /* 10 bpc: Clamping 4  to 3FB */
+	CLAMPING_LIMITED_RANGE_12BPC, /* 12 bpc: Clamping 10 to FEF */
+	/* Use programmable clampping value on FMT_CLAMP_COMPONENT_R/G/B. */
+	CLAMPING_LIMITED_RANGE_PROGRAMMABLE
+};
+
+struct clamping_and_pixel_encoding_params {
+	enum dc_pixel_encoding pixel_encoding; /* Pixel Encoding */
+	enum clamping_range clamping_level; /* Clamping identifier */
+	enum dc_color_depth c_depth; /* Deep color use. */
+};
+
+struct bit_depth_reduction_params {
+	struct {
+		/* truncate/round */
+		/* trunc/round enabled*/
+		uint32_t TRUNCATE_ENABLED:1;
+		/* 2 bits: 0=6 bpc, 1=8 bpc, 2 = 10bpc*/
+		uint32_t TRUNCATE_DEPTH:2;
+		/* truncate or round*/
+		uint32_t TRUNCATE_MODE:1;
+
+		/* spatial dither */
+		/* Spatial Bit Depth Reduction enabled*/
+		uint32_t SPATIAL_DITHER_ENABLED:1;
+		/* 2 bits: 0=6 bpc, 1 = 8 bpc, 2 = 10bpc*/
+		uint32_t SPATIAL_DITHER_DEPTH:2;
+		/* 0-3 to select patterns*/
+		uint32_t SPATIAL_DITHER_MODE:2;
+		/* Enable RGB random dithering*/
+		uint32_t RGB_RANDOM:1;
+		/* Enable Frame random dithering*/
+		uint32_t FRAME_RANDOM:1;
+		/* Enable HighPass random dithering*/
+		uint32_t HIGHPASS_RANDOM:1;
+
+		/* temporal dither*/
+		 /* frame modulation enabled*/
+		uint32_t FRAME_MODULATION_ENABLED:1;
+		/* same as for trunc/spatial*/
+		uint32_t FRAME_MODULATION_DEPTH:2;
+		/* 2/4 gray levels*/
+		uint32_t TEMPORAL_LEVEL:1;
+		uint32_t FRC25:2;
+		uint32_t FRC50:2;
+		uint32_t FRC75:2;
+	} flags;
+
+	uint32_t r_seed_value;
+	uint32_t b_seed_value;
+	uint32_t g_seed_value;
+};
+
+
+
 enum wide_gamut_regamma_mode {
 	/*  0x0  - BITS2:0 Bypass */
 	WIDE_GAMUT_REGAMMA_MODE_GRAPHICS_BYPASS,
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/transform.h b/drivers/gpu/drm/amd/dal/dc/inc/transform.h
index d453aac..2280357 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/transform.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/transform.h
@@ -31,6 +31,8 @@
 #include "calcs/scaler_filter.h"
 #include "grph_object_id.h"
 
+struct bit_depth_reduction_params;
+
 enum scaling_type {
 	SCALING_TYPE_NO_SCALING = 0,
 	SCALING_TYPE_UPSCALING,
diff --git a/drivers/gpu/drm/amd/dal/include/fixed32_32.h b/drivers/gpu/drm/amd/dal/include/fixed32_32.h
index 5fca957..1a26eea 100644
--- a/drivers/gpu/drm/amd/dal/include/fixed32_32.h
+++ b/drivers/gpu/drm/amd/dal/include/fixed32_32.h
@@ -26,6 +26,8 @@
 #ifndef __DAL_FIXED32_32_H__
 #define __DAL_FIXED32_32_H__
 
+#include "dc_services_types.h"
+
 struct fixed32_32 {
 	uint64_t value;
 };
diff --git a/drivers/gpu/drm/amd/dal/include/video_gamma_types.h b/drivers/gpu/drm/amd/dal/include/video_gamma_types.h
index dc294b6..6f9cd3f 100644
--- a/drivers/gpu/drm/amd/dal/include/video_gamma_types.h
+++ b/drivers/gpu/drm/amd/dal/include/video_gamma_types.h
@@ -27,6 +27,7 @@
 #define __DAL_VIDEO_GAMMA_TYPES_H__
 
 #include "set_mode_types.h"
+#include "gamma_types.h"
 
 enum overlay_gamma_adjust {
 	OVERLAY_GAMMA_ADJUST_BYPASS,
-- 
2.7.4