aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0816-drm-amd-dal-Refactor-opp-xfm-ipp-headers-incremental.patch
blob: 8cd821f08f015f3363d90763b982f6556be3cfc0 (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
From 5dfa96c7b0d63e7d154224fa86e5f43b2bab0e65 Mon Sep 17 00:00:00 2001
From: Eric Yang <eric.yang2@amd.com>
Date: Thu, 18 Feb 2016 15:40:51 -0500
Subject: [PATCH 0816/1110] drm/amd/dal: Refactor opp xfm ipp headers
 incremental

Incremental commit, this one mainly deal with opp. There is one
change in ipp to move ovl_color_space out of dc_hw_types And
minor change in transform to untangle dependencies between
transform and opp.

Goal of this changeis to make opp header files self-contained.
i.e. all types used in opp.h, are either in the header itself or
in dc_hw_types.h. This is to allow the header files to be shared
with HW team to write pseudo code

2 structures that are still not contained are signal_type and
fix_point fixed31_32

Signed-off-by: Eric Yang <eric.yang2@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/dal/dc/dc_hw_types.h           | 41 +++++++++--
 drivers/gpu/drm/amd/dal/dc/dc_types.h              | 33 ---------
 drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.h     |  2 +-
 drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_csc.c | 18 ++---
 .../gpu/drm/amd/dal/dc/dce110/dce110_opp_csc_v.c   | 14 ++--
 drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_v.h   |  2 +-
 .../gpu/drm/amd/dal/dc/dce110/dce110_transform.h   |  3 +-
 .../drm/amd/dal/dc/dce110/dce110_transform_gamut.c |  4 +-
 .../gpu/drm/amd/dal/dc/dce110/dce110_transform_v.h |  1 -
 drivers/gpu/drm/amd/dal/dc/dce80/dce80_opp.h       |  2 +-
 drivers/gpu/drm/amd/dal/dc/dce80/dce80_opp_csc.c   | 18 ++---
 drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform.h |  3 +-
 .../drm/amd/dal/dc/dce80/dce80_transform_gamut.c   |  4 +-
 drivers/gpu/drm/amd/dal/dc/inc/ipp.h               |  9 ++-
 drivers/gpu/drm/amd/dal/dc/inc/opp.h               | 39 ++++++++--
 drivers/gpu/drm/amd/dal/dc/inc/timing_generator.h  |  2 -
 drivers/gpu/drm/amd/dal/dc/inc/transform.h         | 17 ++++-
 drivers/gpu/drm/amd/dal/include/grph_csc_types.h   | 85 ----------------------
 drivers/gpu/drm/amd/dal/include/video_csc_types.h  |  1 -
 19 files changed, 125 insertions(+), 173 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/dal/include/grph_csc_types.h

diff --git a/drivers/gpu/drm/amd/dal/dc/dc_hw_types.h b/drivers/gpu/drm/amd/dal/dc/dc_hw_types.h
index 2a9ec19..61939f7 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc_hw_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc_hw_types.h
@@ -282,12 +282,6 @@ struct dc_cursor_position {
 
 /* Used by both ipp amd opp functions*/
 /* TODO: to be consolidated with enum color_space */
-enum ovl_color_space {
-	OVL_COLOR_SPACE_UNKNOWN = 0,
-	OVL_COLOR_SPACE_RGB,
-	OVL_COLOR_SPACE_YUV601,
-	OVL_COLOR_SPACE_YUV709
-};
 
 /*
  * This enum is for programming CURSOR_MODE register field. What this register
@@ -365,5 +359,40 @@ struct dev_c_lut {
 	uint8_t green;
 	uint8_t blue;
 };
+
+/* OPP */
+enum dc_pixel_encoding {
+	PIXEL_ENCODING_UNDEFINED,
+	PIXEL_ENCODING_RGB,
+	PIXEL_ENCODING_YCBCR422,
+	PIXEL_ENCODING_YCBCR444,
+	PIXEL_ENCODING_YCBCR420,
+	PIXEL_ENCODING_COUNT
+};
+
+enum color_space {
+	COLOR_SPACE_UNKNOWN,
+	COLOR_SPACE_SRGB_FULL_RANGE,
+	COLOR_SPACE_SRGB_LIMITED_RANGE,
+	COLOR_SPACE_YPBPR601,
+	COLOR_SPACE_YPBPR709,
+	COLOR_SPACE_YCBCR601,
+	COLOR_SPACE_YCBCR709,
+	COLOR_SPACE_YCBCR601_YONLY,
+	COLOR_SPACE_YCBCR709_YONLY,
+	COLOR_SPACE_N_MVPU_SUPER_AA,
+};
+
+enum dc_color_depth {
+	COLOR_DEPTH_UNDEFINED,
+	COLOR_DEPTH_666,
+	COLOR_DEPTH_888,
+	COLOR_DEPTH_101010,
+	COLOR_DEPTH_121212,
+	COLOR_DEPTH_141414,
+	COLOR_DEPTH_161616,
+	COLOR_DEPTH_COUNT
+};
+
 #endif /* DC_HW_TYPES_H */
 
diff --git a/drivers/gpu/drm/amd/dal/dc/dc_types.h b/drivers/gpu/drm/amd/dal/dc/dc_types.h
index 4e36b85..bcbb911 100644
--- a/drivers/gpu/drm/amd/dal/dc/dc_types.h
+++ b/drivers/gpu/drm/amd/dal/dc/dc_types.h
@@ -67,19 +67,6 @@ enum dce_environment {
 #define MAX_SURFACE_NUM 2
 #define NUM_PIXEL_FORMATS 10
 
-enum color_space {
-	COLOR_SPACE_UNKNOWN,
-	COLOR_SPACE_SRGB_FULL_RANGE,
-	COLOR_SPACE_SRGB_LIMITED_RANGE,
-	COLOR_SPACE_YPBPR601,
-	COLOR_SPACE_YPBPR709,
-	COLOR_SPACE_YCBCR601,
-	COLOR_SPACE_YCBCR709,
-	COLOR_SPACE_YCBCR601_YONLY,
-	COLOR_SPACE_YCBCR709_YONLY,
-	COLOR_SPACE_N_MVPU_SUPER_AA,
-};
-
 enum tiling_mode {
 	TILING_MODE_INVALID,
 	TILING_MODE_LINEAR,
@@ -115,15 +102,6 @@ enum plane_stereo_format {
 	PLANE_STEREO_FORMAT_CHECKER_BOARD = 7
 };
 
-enum dc_pixel_encoding {
-	PIXEL_ENCODING_UNDEFINED,
-	PIXEL_ENCODING_RGB,
-	PIXEL_ENCODING_YCBCR422,
-	PIXEL_ENCODING_YCBCR444,
-	PIXEL_ENCODING_YCBCR420,
-	PIXEL_ENCODING_COUNT
-};
-
 /* TODO: Find way to calculate number of bits
  *  Please increase if pixel_format enum increases
  * num  from  PIXEL_FORMAT_INDEX8 to PIXEL_FORMAT_444BPP32
@@ -307,17 +285,6 @@ enum dc_aspect_ratio {
 	ASPECT_RATIO_FUTURE
 };
 
-enum dc_color_depth {
-	COLOR_DEPTH_UNDEFINED,
-	COLOR_DEPTH_666,
-	COLOR_DEPTH_888,
-	COLOR_DEPTH_101010,
-	COLOR_DEPTH_121212,
-	COLOR_DEPTH_141414,
-	COLOR_DEPTH_161616,
-	COLOR_DEPTH_COUNT
-};
-
 enum dc_timing_3d_format {
 	TIMING_3D_FORMAT_NONE,
 	TIMING_3D_FORMAT_FRAME_ALTERNATE, /* No stereosync at all*/
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 a19e744..e6dcaf8 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.h
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.h
@@ -116,7 +116,7 @@ void dce110_opp_set_regamma_mode(struct output_pixel_processor *opp,
 
 void dce110_opp_set_csc_adjustment(
 	struct output_pixel_processor *opp,
-	const struct grph_csc_adjustment *adjust);
+	const struct opp_grph_csc_adjustment *adjust);
 
 void dce110_opp_set_csc_default(
 	struct output_pixel_processor *opp,
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_csc.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_csc.c
index 8f651e9..b1db0cc 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_csc.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_csc.c
@@ -193,7 +193,7 @@ static void program_color_matrix(
  * @return None
  */
 static void initialize_color_float_adj_reference_values(
-	const struct grph_csc_adjustment *adjust,
+	const struct opp_grph_csc_adjustment *adjust,
 	struct fixed31_32 *grph_cont,
 	struct fixed31_32 *grph_sat,
 	struct fixed31_32 *grph_bright,
@@ -291,7 +291,7 @@ static void setup_reg_format(
  *
  *****************************************************************************
  */
-static void setup_adjustments(const struct grph_csc_adjustment *adjust,
+static void setup_adjustments(const struct opp_grph_csc_adjustment *adjust,
 	struct dc_csc_adjustments *adjustments)
 {
 	if (adjust->adjust_divider != 0) {
@@ -343,7 +343,7 @@ static void prepare_tv_rgb_ideal(
  *****************************************************************************
  *  Function: dal_transform_wide_gamut_set_rgb_adjustment_legacy
  *
- *  @param [in] const struct grph_csc_adjustment *adjust
+ *  @param [in] const struct opp_grph_csc_adjustment *adjust
  *
  *  @return
  *     void
@@ -356,7 +356,7 @@ static void prepare_tv_rgb_ideal(
  */
 static void set_rgb_adjustment_legacy(
 	struct dce110_opp *opp110,
-	const struct grph_csc_adjustment *adjust)
+	const struct opp_grph_csc_adjustment *adjust)
 {
 	const struct fixed31_32 k1 =
 		dal_fixed31_32_from_fraction(701000, 1000000);
@@ -571,7 +571,7 @@ static void set_rgb_adjustment_legacy(
  *****************************************************************************
  *  Function: dal_transform_wide_gamut_set_rgb_limited_range_adjustment
  *
- *  @param [in] const struct grph_csc_adjustment *adjust
+ *  @param [in] const struct opp_grph_csc_adjustment *adjust
  *
  *  @return
  *     void
@@ -584,7 +584,7 @@ static void set_rgb_adjustment_legacy(
  */
 static void set_rgb_limited_range_adjustment(
 	struct dce110_opp *opp110,
-	const struct grph_csc_adjustment *adjust)
+	const struct opp_grph_csc_adjustment *adjust)
 {
 	struct out_csc_color_matrix reg_matrix;
 	struct fixed31_32 change_matrix[OUTPUT_CSC_MATRIX_SIZE];
@@ -657,7 +657,7 @@ static void prepare_yuv_ideal(
  *****************************************************************************
  *  Function: dal_transform_wide_gamut_set_yuv_adjustment
  *
- *  @param [in] const struct grph_csc_adjustment *adjust
+ *  @param [in] const struct opp_grph_csc_adjustment *adjust
  *
  *  @return
  *     void
@@ -670,7 +670,7 @@ static void prepare_yuv_ideal(
  */
 static void set_yuv_adjustment(
 	struct dce110_opp *opp110,
-	const struct grph_csc_adjustment *adjust)
+	const struct opp_grph_csc_adjustment *adjust)
 {
 	bool b601 = (adjust->c_space == COLOR_SPACE_YPBPR601) ||
 		(adjust->c_space == COLOR_SPACE_YCBCR601) ||
@@ -823,7 +823,7 @@ static bool configure_graphics_mode(
 
 void dce110_opp_set_csc_adjustment(
 	struct output_pixel_processor *opp,
-	const struct grph_csc_adjustment *adjust)
+	const struct opp_grph_csc_adjustment *adjust)
 {
 	struct dce110_opp *opp110 = TO_DCE110_OPP(opp);
 	enum csc_color_mode config =
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_csc_v.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_csc_v.c
index 6ca749e..a786b98 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_csc_v.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_csc_v.c
@@ -364,7 +364,7 @@ static void program_color_matrix_v(
  * @return None
  */
 static void initialize_color_float_adj_reference_values(
-	const struct grph_csc_adjustment *adjust,
+	const struct opp_grph_csc_adjustment *adjust,
 	struct fixed31_32 *grph_cont,
 	struct fixed31_32 *grph_sat,
 	struct fixed31_32 *grph_bright,
@@ -462,7 +462,7 @@ static void setup_reg_format(
  *
  *****************************************************************************
  */
-static void setup_adjustments(const struct grph_csc_adjustment *adjust,
+static void setup_adjustments(const struct opp_grph_csc_adjustment *adjust,
 	struct dc_csc_adjustments *adjustments)
 {
 	if (adjust->adjust_divider != 0) {
@@ -495,7 +495,7 @@ static void setup_adjustments(const struct grph_csc_adjustment *adjust,
  *****************************************************************************
  *  Function: dal_transform_wide_gamut_set_rgb_adjustment_legacy
  *
- *  @param [in] const struct grph_csc_adjustment *adjust
+ *  @param [in] const struct opp_grph_csc_adjustment *adjust
  *
  *  @return
  *     void
@@ -508,7 +508,7 @@ static void setup_adjustments(const struct grph_csc_adjustment *adjust,
  */
 static void set_rgb_adjustment_legacy(
 	struct dce110_opp *opp110,
-	const struct grph_csc_adjustment *adjust)
+	const struct opp_grph_csc_adjustment *adjust)
 {
 	const struct fixed31_32 k1 =
 		dal_fixed31_32_from_fraction(701000, 1000000);
@@ -769,7 +769,7 @@ static void prepare_yuv_ideal(
  *****************************************************************************
  *  Function: dal_transform_wide_gamut_set_yuv_adjustment
  *
- *  @param [in] const struct grph_csc_adjustment *adjust
+ *  @param [in] const struct opp_grph_csc_adjustment *adjust
  *
  *  @return
  *     void
@@ -782,7 +782,7 @@ static void prepare_yuv_ideal(
  */
 static void set_yuv_adjustment(
 	struct dce110_opp *opp110,
-	const struct grph_csc_adjustment *adjust)
+	const struct opp_grph_csc_adjustment *adjust)
 {
 	bool b601 = (adjust->c_space == COLOR_SPACE_YPBPR601) ||
 		(adjust->c_space == COLOR_SPACE_YCBCR601) ||
@@ -1014,7 +1014,7 @@ void dce110_opp_v_set_csc_default(
 
 void dce110_opp_v_set_csc_adjustment(
 	struct output_pixel_processor *opp,
-	const struct grph_csc_adjustment *adjust)
+	const struct opp_grph_csc_adjustment *adjust)
 {
 	struct dce110_opp *opp110 = TO_DCE110_OPP(opp);
 	enum csc_color_mode config =
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_v.h b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_v.h
index 1936ba4..d78395a 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_v.h
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_v.h
@@ -43,7 +43,7 @@ void dce110_opp_v_set_csc_default(
 
 void dce110_opp_v_set_csc_adjustment(
 	struct output_pixel_processor *opp,
-	const struct grph_csc_adjustment *adjust);
+	const struct opp_grph_csc_adjustment *adjust);
 
 bool dce110_opp_program_regamma_pwl_v(
 	struct output_pixel_processor *opp,
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform.h b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform.h
index 117aca3..f7c5565 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform.h
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform.h
@@ -26,7 +26,6 @@
 #define __DAL_TRANSFORM_DCE110_H__
 
 #include "inc/transform.h"
-#include "include/grph_csc_types.h"
 
 #define TO_DCE110_TRANSFORM(transform)\
 	container_of(transform, struct dce110_transform, base)
@@ -71,7 +70,7 @@ void dce110_transform_set_scaler_filter(
 /* GAMUT RELATED */
 void dce110_transform_set_gamut_remap(
 	struct transform *xfm,
-	const struct grph_csc_adjustment *adjust);
+	const struct xfm_grph_csc_adjustment *adjust);
 
 /* BIT DEPTH RELATED */
 bool dce110_transform_set_pixel_storage_depth(
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_gamut.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_gamut.c
index 05309c9..fe5be62 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_gamut.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_gamut.c
@@ -221,7 +221,7 @@ static void program_gamut_remap(
  *****************************************************************************
  *  Function: dal_transform_wide_gamut_set_gamut_remap
  *
- *  @param [in] const struct grph_csc_adjustment *adjust
+ *  @param [in] const struct xfm_grph_csc_adjustment *adjust
  *
  *  @return
  *     void
@@ -234,7 +234,7 @@ static void program_gamut_remap(
  */
 void dce110_transform_set_gamut_remap(
 	struct transform *xfm,
-	const struct grph_csc_adjustment *adjust)
+	const struct xfm_grph_csc_adjustment *adjust)
 {
 	struct dce110_transform *xfm110 = TO_DCE110_TRANSFORM(xfm);
 
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_v.h b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_v.h
index b51bd78..eec3872 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_v.h
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_transform_v.h
@@ -26,7 +26,6 @@
 #define __DAL_TRANSFORM_V_DCE110_H__
 
 #include "inc/transform.h"
-#include "include/grph_csc_types.h"
 
 bool dce110_transform_v_construct(
 	struct dce110_transform *xfm110,
diff --git a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_opp.h b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_opp.h
index d414f50..db5e0eb 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_opp.h
+++ b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_opp.h
@@ -105,7 +105,7 @@ void dce80_opp_set_regamma_mode(struct output_pixel_processor *opp,
 
 void dce80_opp_set_csc_adjustment(
 	struct output_pixel_processor *opp,
-	const struct grph_csc_adjustment *adjust);
+	const struct opp_grph_csc_adjustment *adjust);
 
 void dce80_opp_set_csc_default(
 	struct output_pixel_processor *opp,
diff --git a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_opp_csc.c b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_opp_csc.c
index 90662ae..2ea6628 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_opp_csc.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_opp_csc.c
@@ -194,7 +194,7 @@ static void program_color_matrix(
  * @return None
  */
 static void initialize_color_float_adj_reference_values(
-	const struct grph_csc_adjustment *adjust,
+	const struct opp_grph_csc_adjustment *adjust,
 	struct fixed31_32 *grph_cont,
 	struct fixed31_32 *grph_sat,
 	struct fixed31_32 *grph_bright,
@@ -292,7 +292,7 @@ static void setup_reg_format(
  *
  *****************************************************************************
  */
-static void setup_adjustments(const struct grph_csc_adjustment *adjust,
+static void setup_adjustments(const struct opp_grph_csc_adjustment *adjust,
 	struct dc_csc_adjustments *adjustments)
 {
 	if (adjust->adjust_divider != 0) {
@@ -344,7 +344,7 @@ static void prepare_tv_rgb_ideal(
  *****************************************************************************
  *  Function: dal_transform_wide_gamut_set_rgb_adjustment_legacy
  *
- *  @param [in] const struct grph_csc_adjustment *adjust
+ *  @param [in] const struct opp_grph_csc_adjustment *adjust
  *
  *  @return
  *     void
@@ -357,7 +357,7 @@ static void prepare_tv_rgb_ideal(
  */
 static void set_rgb_adjustment_legacy(
 	struct dce80_opp *opp80,
-	const struct grph_csc_adjustment *adjust)
+	const struct opp_grph_csc_adjustment *adjust)
 {
 	const struct fixed31_32 k1 =
 		dal_fixed31_32_from_fraction(701000, 1000000);
@@ -572,7 +572,7 @@ static void set_rgb_adjustment_legacy(
  *****************************************************************************
  *  Function: dal_transform_wide_gamut_set_rgb_limited_range_adjustment
  *
- *  @param [in] const struct grph_csc_adjustment *adjust
+ *  @param [in] const struct opp_grph_csc_adjustment *adjust
  *
  *  @return
  *     void
@@ -585,7 +585,7 @@ static void set_rgb_adjustment_legacy(
  */
 static void set_rgb_limited_range_adjustment(
 	struct dce80_opp *opp80,
-	const struct grph_csc_adjustment *adjust)
+	const struct opp_grph_csc_adjustment *adjust)
 {
 	struct out_csc_color_matrix reg_matrix;
 	struct fixed31_32 change_matrix[OUTPUT_CSC_MATRIX_SIZE];
@@ -658,7 +658,7 @@ static void prepare_yuv_ideal(
  *****************************************************************************
  *  Function: dal_transform_wide_gamut_set_yuv_adjustment
  *
- *  @param [in] const struct grph_csc_adjustment *adjust
+ *  @param [in] const struct opp_grph_csc_adjustment *adjust
  *
  *  @return
  *     void
@@ -671,7 +671,7 @@ static void prepare_yuv_ideal(
  */
 static void set_yuv_adjustment(
 	struct dce80_opp *opp80,
-	const struct grph_csc_adjustment *adjust)
+	const struct opp_grph_csc_adjustment *adjust)
 {
 	bool b601 = (adjust->c_space == COLOR_SPACE_YPBPR601) ||
 		(adjust->c_space == COLOR_SPACE_YCBCR601) ||
@@ -824,7 +824,7 @@ static bool configure_graphics_mode(
 
 void dce80_opp_set_csc_adjustment(
 	struct output_pixel_processor *opp,
-	const struct grph_csc_adjustment *adjust)
+	const struct opp_grph_csc_adjustment *adjust)
 {
 	struct dce80_opp *opp80 = TO_DCE80_OPP(opp);
 	enum csc_color_mode config =
diff --git a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform.h b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform.h
index adcc54b..ac8e5c9 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform.h
+++ b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform.h
@@ -26,7 +26,6 @@
 #define __DAL_TRANSFORM_DCE80_H__
 
 #include "inc/transform.h"
-#include "include/grph_csc_types.h"
 
 #define TO_DCE80_TRANSFORM(transform)\
 	container_of(transform, struct dce80_transform, base)
@@ -71,7 +70,7 @@ void dce80_transform_set_scaler_filter(
 /* GAMUT RELATED */
 void dce80_transform_set_gamut_remap(
 	struct transform *xfm,
-	const struct grph_csc_adjustment *adjust);
+	const struct xfm_grph_csc_adjustment *adjust);
 
 /* BIT DEPTH RELATED */
 bool dce80_transform_set_pixel_storage_depth(
diff --git a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_gamut.c b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_gamut.c
index df5db67..4c54f3d 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_gamut.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce80/dce80_transform_gamut.c
@@ -222,7 +222,7 @@ static void program_gamut_remap(
  *****************************************************************************
  *  Function: dal_transform_wide_gamut_set_gamut_remap
  *
- *  @param [in] const struct grph_csc_adjustment *adjust
+ *  @param [in] const struct xfm_grph_csc_adjustment *adjust
  *
  *  @return
  *     void
@@ -235,7 +235,7 @@ static void program_gamut_remap(
  */
 void dce80_transform_set_gamut_remap(
 	struct transform *xfm,
-	const struct grph_csc_adjustment *adjust)
+	const struct xfm_grph_csc_adjustment *adjust)
 {
 	struct dce80_transform *xfm80 = TO_DCE80_TRANSFORM(xfm);
 
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/ipp.h b/drivers/gpu/drm/amd/dal/dc/inc/ipp.h
index c98102f..e231ce1 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/ipp.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/ipp.h
@@ -28,7 +28,6 @@
 #define __DAL_IPP_H__
 
 #include "include/grph_object_id.h"
-#include "include/grph_csc_types.h"
 #include "include/video_csc_types.h"
 #include "include/hw_sequencer_types.h"
 
@@ -79,6 +78,14 @@ enum wide_gamut_degamma_mode {
 	WIDE_GAMUT_DEGAMMA_MODE_OVL_PWL_ROM_B,
 };
 
+
+enum ovl_color_space {
+	OVL_COLOR_SPACE_UNKNOWN = 0,
+	OVL_COLOR_SPACE_RGB,
+	OVL_COLOR_SPACE_YUV601,
+	OVL_COLOR_SPACE_YUV709
+};
+
 struct dcp_video_matrix {
 	enum ovl_color_space color_space;
 	int32_t value[MAXTRIX_COEFFICIENTS_NUMBER];
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/opp.h b/drivers/gpu/drm/amd/dal/dc/inc/opp.h
index 4924874..3d8fe0d 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/opp.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/opp.h
@@ -28,7 +28,6 @@
 
 #include "dc_types.h"
 #include "grph_object_id.h"
-#include "grph_csc_types.h"
 #include "video_csc_types.h"
 #include "hw_sequencer_types.h"
 
@@ -269,6 +268,38 @@ struct regamma_params {
 	uint32_t hw_points_num;
 };
 
+enum graphics_csc_adjust_type {
+	GRAPHICS_CSC_ADJUST_TYPE_BYPASS = 0,
+	GRAPHICS_CSC_ADJUST_TYPE_HW, /* without adjustments */
+	GRAPHICS_CSC_ADJUST_TYPE_SW  /*use adjustments */
+};
+
+struct default_adjustment {
+	uint32_t lb_color_depth;
+	enum color_space color_space;
+	enum dc_color_depth color_depth;
+	enum pixel_format surface_pixel_format;
+	enum graphics_csc_adjust_type csc_adjust_type;
+	bool force_hw_default;
+};
+
+enum grph_color_adjust_option {
+	GRPH_COLOR_MATRIX_HW_DEFAULT = 1,
+	GRPH_COLOR_MATRIX_SW
+};
+
+struct opp_grph_csc_adjustment {
+	enum grph_color_adjust_option color_adjust_option;
+	enum color_space c_space;
+	enum dc_color_depth color_depth; /* clean up to uint32_t */
+	enum graphics_csc_adjust_type   csc_adjust_type;
+	int32_t adjust_divider;
+	int32_t grph_cont;
+	int32_t grph_sat;
+	int32_t grph_bright;
+	int32_t grph_hue;
+};
+
 struct opp_funcs {
 	void (*opp_power_on_regamma_lut)(
 		struct output_pixel_processor *opp,
@@ -283,7 +314,7 @@ struct opp_funcs {
 
 	void (*opp_set_csc_adjustment)(
 		struct output_pixel_processor *opp,
-		const struct grph_csc_adjustment *adjust);
+		const struct opp_grph_csc_adjustment *adjust);
 
 	void (*opp_set_csc_default)(
 		struct output_pixel_processor *opp,
@@ -310,10 +341,6 @@ struct opp_funcs {
 			enum ovl_csc_adjust_item overlay_adjust_item,
 			struct hw_adjustment_range *range);
 
-	void (*opp_set_ovl_csc_adjustment)(
-			struct output_pixel_processor *opp,
-			const struct ovl_csc_adjustment *adjust,
-			enum color_space c_space);
 
 	void (*opp_destroy)(struct output_pixel_processor **opp);
 };
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/timing_generator.h b/drivers/gpu/drm/amd/dal/dc/inc/timing_generator.h
index e9ca169..7ef22ad 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/timing_generator.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/timing_generator.h
@@ -26,8 +26,6 @@
 #ifndef __DAL_TIMING_GENERATOR_TYPES_H__
 #define __DAL_TIMING_GENERATOR_TYPES_H__
 
-#include "include/grph_csc_types.h"
-
 struct dc_bios;
 
 /**
diff --git a/drivers/gpu/drm/amd/dal/dc/inc/transform.h b/drivers/gpu/drm/amd/dal/dc/inc/transform.h
index efefedb..47adc1d 100644
--- a/drivers/gpu/drm/amd/dal/dc/inc/transform.h
+++ b/drivers/gpu/drm/amd/dal/dc/inc/transform.h
@@ -27,7 +27,6 @@
 #define __DAL_TRANSFORM_H__
 
 #include "include/scaler_types.h"
-#include "include/grph_csc_types.h"
 #include "calcs/scaler_filter.h"
 #include "grph_object_id.h"
 
@@ -122,6 +121,20 @@ enum yyc_quantization_range {
        YYC_QUANTIZATION_RESERVED3 = 3
 };
 
+enum graphics_gamut_adjust_type {
+	GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS = 0,
+	GRAPHICS_GAMUT_ADJUST_TYPE_HW, /* without adjustments */
+	GRAPHICS_GAMUT_ADJUST_TYPE_SW  /* use adjustments */
+};
+
+#define CSC_TEMPERATURE_MATRIX_SIZE 9
+
+struct xfm_grph_csc_adjustment {
+	int32_t temperature_matrix[CSC_TEMPERATURE_MATRIX_SIZE];
+	int32_t temperature_divider;
+	enum graphics_gamut_adjust_type gamut_adjust_type;
+};
+
 struct transform_funcs {
 	bool (*transform_power_up)(
 		struct transform *xfm);
@@ -139,7 +152,7 @@ struct transform_funcs {
 
 	void (*transform_set_gamut_remap)(
 		struct transform *xfm,
-		const struct grph_csc_adjustment *adjust);
+		const struct xfm_grph_csc_adjustment *adjust);
 
 	bool (*transform_set_pixel_storage_depth)(
 		struct transform *xfm,
diff --git a/drivers/gpu/drm/amd/dal/include/grph_csc_types.h b/drivers/gpu/drm/amd/dal/include/grph_csc_types.h
deleted file mode 100644
index 5927dd0..0000000
--- a/drivers/gpu/drm/amd/dal/include/grph_csc_types.h
+++ /dev/null
@@ -1,85 +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 __DAL_GRPH_CSC_TYPES_H__
-#define __DAL_GRPH_CSC_TYPES_H__
-
-#include "set_mode_types.h"
-
-enum grph_color_adjust_option {
-	GRPH_COLOR_MATRIX_HW_DEFAULT = 1,
-	GRPH_COLOR_MATRIX_SW
-};
-
-enum grph_csc_adjust_item {
-	GRPH_ADJUSTMENT_CONTRAST = 1,
-	GRPH_ADJUSTMENT_SATURATION,
-	GRPH_ADJUSTMENT_BRIGHTNESS,
-	GRPH_ADJUSTMENT_HUE,
-	GRPH_ADJUSTMENT_COLOR_TEMPERATURE
-};
-
-#define CSC_TEMPERATURE_MATRIX_SIZE 9
-
-enum graphics_csc_adjust_type {
-	GRAPHICS_CSC_ADJUST_TYPE_BYPASS = 0,
-	GRAPHICS_CSC_ADJUST_TYPE_HW, /* without adjustments */
-	GRAPHICS_CSC_ADJUST_TYPE_SW  /*use adjustments */
-};
-
-enum graphics_gamut_adjust_type {
-	GRAPHICS_GAMUT_ADJUST_TYPE_BYPASS = 0,
-	GRAPHICS_GAMUT_ADJUST_TYPE_HW, /* without adjustments */
-	GRAPHICS_GAMUT_ADJUST_TYPE_SW  /* use adjustments */
-};
-
-struct grph_csc_adjustment {
-	enum grph_color_adjust_option color_adjust_option;
-	enum color_space c_space;
-	int32_t grph_cont;
-	int32_t grph_sat;
-	int32_t grph_bright;
-	int32_t grph_hue;
-	int32_t adjust_divider;
-	int32_t temperature_matrix[CSC_TEMPERATURE_MATRIX_SIZE];
-	int32_t temperature_divider;
-	uint32_t lb_color_depth;
-	uint8_t gamma; /* gamma from Edid */
-	enum dc_color_depth color_depth; /* clean up to uint32_t */
-	enum pixel_format surface_pixel_format;
-	enum graphics_csc_adjust_type   csc_adjust_type;
-	enum graphics_gamut_adjust_type gamut_adjust_type;
-};
-
-struct default_adjustment {
-	uint32_t lb_color_depth;
-	enum color_space color_space;
-	enum dc_color_depth color_depth;
-	enum pixel_format surface_pixel_format;
-	enum graphics_csc_adjust_type csc_adjust_type;
-	bool force_hw_default;
-};
-
-#endif
diff --git a/drivers/gpu/drm/amd/dal/include/video_csc_types.h b/drivers/gpu/drm/amd/dal/include/video_csc_types.h
index 354a01b..515f75b 100644
--- a/drivers/gpu/drm/amd/dal/include/video_csc_types.h
+++ b/drivers/gpu/drm/amd/dal/include/video_csc_types.h
@@ -82,7 +82,6 @@ union ovl_csc_flag {
 };
 
 struct ovl_csc_adjustment {
-	enum ovl_color_space ovl_cs;
 	struct ovl_color_adjust_option ovl_option;
 	enum dc_color_depth display_color_depth;
 	uint32_t lb_color_depth;
-- 
2.7.4