aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71/0093-drm-amd-display-Implement-gamma-correction-using-inp.patch
blob: bb10fe4642d851c6ee5729aca4bdd1d34b10f1db (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
From 734ab62e914908b443ba53c107d9cc5cc18e78f0 Mon Sep 17 00:00:00 2001
From: Aric Cyr <aric.cyr@amd.com>
Date: Tue, 20 Dec 2016 20:24:24 -0500
Subject: [PATCH 0093/4131] drm/amd/display: Implement gamma correction using
 input LUT

The dc_gamma in dc_surface will be programmed to the input
LUT if provided.  If dc_gamma is not provided in dc_surface
regamma may be used to emulate gamma.

Some refactor and cleanup included as well.

Signed-off-by: Aric Cyr <aric.cyr@amd.com>
Reviewed-by: Tony Cheng <Tony.Cheng@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 .../drm/amd/display/amdgpu_dm/amdgpu_dm_types.c    |  25 +-
 drivers/gpu/drm/amd/display/dc/calcs/gamma_calcs.c |  29 +-
 drivers/gpu/drm/amd/display/dc/core/dc_surface.c   |   6 +-
 drivers/gpu/drm/amd/display/dc/dc.h                |  40 +--
 drivers/gpu/drm/amd/display/dc/dc_hw_types.h       |  10 +
 drivers/gpu/drm/amd/display/dc/dce/dce_opp.c       |   2 -
 drivers/gpu/drm/amd/display/dc/dce/dce_opp.h       |   4 -
 .../amd/display/dc/dce110/dce110_hw_sequencer.c    |  17 +-
 drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp.c |   1 +
 drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp.h |  11 +-
 .../drm/amd/display/dc/dce110/dce110_ipp_gamma.c   | 304 ++++++---------------
 .../amd/display/dc/dce110/dce110_opp_regamma_v.c   |   1 -
 .../gpu/drm/amd/display/dc/dce110/dce110_opp_v.c   |   2 -
 .../gpu/drm/amd/display/dc/dce110/dce110_opp_v.h   |   4 -
 drivers/gpu/drm/amd/display/dc/dce80/dce80_ipp.c   |   1 +
 drivers/gpu/drm/amd/display/dc/dce80/dce80_ipp.h   |   2 -
 .../gpu/drm/amd/display/dc/dce80/dce80_ipp_gamma.c |   5 -
 drivers/gpu/drm/amd/display/dc/inc/gamma_types.h   |  38 ---
 drivers/gpu/drm/amd/display/dc/inc/hw/ipp.h        |   4 +
 drivers/gpu/drm/amd/display/dc/inc/hw/opp.h        |   1 -
 drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h  |   2 -
 drivers/gpu/drm/amd/display/modules/color/color.c  |   6 +-
 22 files changed, 144 insertions(+), 371 deletions(-)
 delete mode 100644 drivers/gpu/drm/amd/display/dc/inc/gamma_types.h

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
index 6aede70..e7ada89 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_types.c
@@ -516,32 +516,25 @@ static void fill_gamma_from_crtc(
 	uint16_t *red, *green, *blue;
 	int end = (crtc->gamma_size > NUM_OF_RAW_GAMMA_RAMP_RGB_256) ?
 			NUM_OF_RAW_GAMMA_RAMP_RGB_256 : crtc->gamma_size;
-	struct amdgpu_device *adev = crtc->dev->dev_private;
 
 	red = crtc->gamma_store;
 	green = red + crtc->gamma_size;
 	blue = green + crtc->gamma_size;
 
-	gamma = dc_create_gamma(adev->dm.dc);
+	gamma = dc_create_gamma();
 
 	if (gamma == NULL)
 		return;
 
 	for (i = 0; i < end; i++) {
-		gamma->gamma_ramp_rgb256x3x16.red[i] =
-				(unsigned short) red[i];
-		gamma->gamma_ramp_rgb256x3x16.green[i] =
-				(unsigned short) green[i];
-		gamma->gamma_ramp_rgb256x3x16.blue[i] =
-				(unsigned short) blue[i];
+		gamma->red[i] = (unsigned short) red[i];
+		gamma->green[i] = (unsigned short) green[i];
+		gamma->blue[i] = (unsigned short) blue[i];
 	}
 
-	gamma->type = GAMMA_RAMP_RBG256X3X16;
-	gamma->size = sizeof(gamma->gamma_ramp_rgb256x3x16);
-
 	dc_surface->gamma_correction = gamma;
 
-	input_tf = dc_create_transfer_func(adev->dm.dc);
+	input_tf = dc_create_transfer_func();
 
 	if (input_tf == NULL)
 		return;
@@ -839,6 +832,12 @@ static void fill_stream_properties_from_drm_display_mode(
 
 	stream->output_color_space = get_output_color_space(timing_out);
 
+	{
+		struct dc_transfer_func *tf = dc_create_transfer_func();
+		tf->type = TF_TYPE_PREDEFINED;
+		tf->tf = TRANSFER_FUNCTION_SRGB;
+		stream->out_transfer_func = tf;
+	}
 }
 
 static void fill_audio_info(
@@ -3212,7 +3211,7 @@ static bool is_dp_capable_without_timing_msa(
 	    dc_read_dpcd(dc, amdgpu_connector->dc_link->link_index,
 			 DP_DOWN_STREAM_PORT_COUNT,
 			 &dpcd_data, sizeof(dpcd_data)) )
-		capable = dpcd_data & DP_MSA_TIMING_PAR_IGNORED? true:false;
+		capable = (dpcd_data & DP_MSA_TIMING_PAR_IGNORED) ? true:false;
 
 	return capable;
 }
diff --git a/drivers/gpu/drm/amd/display/dc/calcs/gamma_calcs.c b/drivers/gpu/drm/amd/display/dc/calcs/gamma_calcs.c
index f33135b..ca2234e 100644
--- a/drivers/gpu/drm/amd/display/dc/calcs/gamma_calcs.c
+++ b/drivers/gpu/drm/amd/display/dc/calcs/gamma_calcs.c
@@ -573,7 +573,7 @@ static bool find_software_points(
 	uint32_t *index_right,
 	enum hw_point_position *pos)
 {
-	const uint32_t max_number = RGB_256X3X16 + 3;
+	const uint32_t max_number = INPUT_LUT_ENTRIES + 3;
 
 	struct fixed31_32 left, right;
 
@@ -686,12 +686,12 @@ static bool build_custom_gamma_mapping_coefficients_worker(
 			return false;
 		}
 
-		if (index_left >= RGB_256X3X16 + 3) {
+		if (index_left >= INPUT_LUT_ENTRIES + 3) {
 			BREAK_TO_DEBUGGER();
 			return false;
 		}
 
-		if (index_right >= RGB_256X3X16 + 3) {
+		if (index_right >= INPUT_LUT_ENTRIES + 3) {
 			BREAK_TO_DEBUGGER();
 			return false;
 		}
@@ -958,20 +958,13 @@ static bool scale_gamma(struct pwl_float_data *pwl_rgb,
 		const struct core_gamma *ramp,
 		struct dividers dividers)
 {
-	const struct dc_gamma_ramp_rgb256x3x16 *gamma;
+	const struct dc_gamma *gamma = &ramp->public;
 	const uint16_t max_driver = 0xFFFF;
 	const uint16_t max_os = 0xFF00;
 	uint16_t scaler = max_os;
-	uint32_t i;
+	uint32_t i = 0;
 	struct pwl_float_data *rgb = pwl_rgb;
-	struct pwl_float_data *rgb_last = rgb + RGB_256X3X16 - 1;
-
-	if (ramp->public.type == GAMMA_RAMP_RBG256X3X16)
-		gamma = &ramp->public.gamma_ramp_rgb256x3x16;
-	else
-		return false; /* invalid option */
-
-	i = 0;
+	struct pwl_float_data *rgb_last = rgb + INPUT_LUT_ENTRIES - 1;
 
 	do {
 		if ((gamma->red[i] > max_os) ||
@@ -981,7 +974,7 @@ static bool scale_gamma(struct pwl_float_data *pwl_rgb,
 			break;
 		}
 		++i;
-	} while (i != RGB_256X3X16);
+	} while (i != INPUT_LUT_ENTRIES);
 
 	i = 0;
 
@@ -995,7 +988,7 @@ static bool scale_gamma(struct pwl_float_data *pwl_rgb,
 
 		++rgb;
 		++i;
-	} while (i != RGB_256X3X16);
+	} while (i != INPUT_LUT_ENTRIES);
 
 	rgb->r = dal_fixed31_32_mul(rgb_last->r,
 			dividers.divider1);
@@ -1110,7 +1103,7 @@ static bool calculate_interpolated_hardware_curve(
 		return false;
 
 	coeff = coeff128;
-	max_entries += RGB_256X3X16;
+	max_entries += INPUT_LUT_ENTRIES;
 
 	/* TODO: float point case */
 
@@ -1440,13 +1433,13 @@ bool calculate_regamma_params(struct pwl_params *params,
 	coordinates_x = dm_alloc(sizeof(*coordinates_x)*(256 + 3));
 	if (!coordinates_x)
 		goto coordinates_x_alloc_fail;
-	rgb_user = dm_alloc(sizeof(*rgb_user) * (FLOAT_GAMMA_RAMP_MAX + 3));
+	rgb_user = dm_alloc(sizeof(*rgb_user) * (TRANSFER_FUNC_POINTS + 3));
 	if (!rgb_user)
 		goto rgb_user_alloc_fail;
 	rgb_regamma = dm_alloc(sizeof(*rgb_regamma) * (256 + 3));
 	if (!rgb_regamma)
 		goto rgb_regamma_alloc_fail;
-	rgb_oem = dm_alloc(sizeof(*rgb_oem) * (FLOAT_GAMMA_RAMP_MAX + 3));
+	rgb_oem = dm_alloc(sizeof(*rgb_oem) * (TRANSFER_FUNC_POINTS + 3));
 	if (!rgb_oem)
 		goto rgb_oem_alloc_fail;
 	axix_x_256 = dm_alloc(sizeof(*axix_x_256) * (256 + 3));
diff --git a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
index 1ca40a2..3ec1f36 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc_surface.c
@@ -189,9 +189,8 @@ void dc_gamma_release(const struct dc_gamma *dc_gamma)
 		dm_free(gamma);
 }
 
-struct dc_gamma *dc_create_gamma(const struct dc *dc)
+struct dc_gamma *dc_create_gamma()
 {
-	struct core_dc *core_dc = DC_TO_CORE(dc);
 	struct gamma *gamma = dm_alloc(sizeof(*gamma));
 
 	if (gamma == NULL)
@@ -221,9 +220,8 @@ void dc_transfer_func_release(const struct dc_transfer_func *dc_tf)
 		dm_free(tf);
 }
 
-struct dc_transfer_func *dc_create_transfer_func(const struct dc *dc)
+struct dc_transfer_func *dc_create_transfer_func()
 {
-	struct core_dc *core_dc = DC_TO_CORE(dc);
 	struct transfer_func *tf = dm_alloc(sizeof(*tf));
 
 	if (tf == NULL)
diff --git a/drivers/gpu/drm/amd/display/dc/dc.h b/drivers/gpu/drm/amd/display/dc/dc.h
index 05fcb06..0ee6f41 100644
--- a/drivers/gpu/drm/amd/display/dc/dc.h
+++ b/drivers/gpu/drm/amd/display/dc/dc.h
@@ -183,43 +183,9 @@ void dc_destroy(struct dc **dc);
  ******************************************************************************/
 
 enum {
-	RGB_256X3X16 = 256,
-	FLOAT_GAMMA_RAMP_MAX = 1025,
 	TRANSFER_FUNC_POINTS = 1025
 };
 
-enum dc_gamma_ramp_type {
-	GAMMA_RAMP_RBG256X3X16,
-	GAMMA_RAMP_FLOAT,
-};
-
-struct float_rgb {
-	struct fixed32_32 red;
-	struct fixed32_32 green;
-	struct fixed32_32 blue;
-};
-
-struct dc_gamma_ramp_float {
-	struct float_rgb scale;
-	struct float_rgb offset;
-	struct float_rgb gamma_curve[FLOAT_GAMMA_RAMP_MAX];
-};
-
-struct dc_gamma_ramp_rgb256x3x16 {
-	uint16_t red[RGB_256X3X16];
-	uint16_t green[RGB_256X3X16];
-	uint16_t blue[RGB_256X3X16];
-};
-
-struct dc_gamma {
-	enum dc_gamma_ramp_type type;
-	union {
-		struct dc_gamma_ramp_rgb256x3x16 gamma_ramp_rgb256x3x16;
-		struct dc_gamma_ramp_float gamma_ramp_float;
-	};
-	uint32_t size;
-};
-
 enum dc_transfer_func_type {
 	TF_TYPE_PREDEFINED,
 	TF_TYPE_DISTRIBUTED_POINTS,
@@ -266,9 +232,7 @@ struct dc_surface {
 	bool horizontal_mirror;
 	enum plane_stereo_format stereo_format;
 
-	/* TO BE REMOVED AFTER BELOW TRANSFER FUNCTIONS IMPLEMENTED */
 	const struct dc_gamma *gamma_correction;
-
 	const struct dc_transfer_func *in_transfer_func;
 };
 
@@ -332,11 +296,11 @@ void dc_surface_release(const struct dc_surface *dc_surface);
 
 void dc_gamma_retain(const struct dc_gamma *dc_gamma);
 void dc_gamma_release(const struct dc_gamma *dc_gamma);
-struct dc_gamma *dc_create_gamma(const struct dc *dc);
+struct dc_gamma *dc_create_gamma(void);
 
 void dc_transfer_func_retain(const struct dc_transfer_func *dc_tf);
 void dc_transfer_func_release(const struct dc_transfer_func *dc_tf);
-struct dc_transfer_func *dc_create_transfer_func(const struct dc *dc);
+struct dc_transfer_func *dc_create_transfer_func(void);
 
 /*
  * This structure holds a surface address.  There could be multiple addresses
diff --git a/drivers/gpu/drm/amd/display/dc/dc_hw_types.h b/drivers/gpu/drm/amd/display/dc/dc_hw_types.h
index 499f6b2..00958bd 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_hw_types.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_hw_types.h
@@ -370,6 +370,16 @@ struct dc_cursor_mi_param {
 
 /* IPP related types */
 
+enum {
+	INPUT_LUT_ENTRIES = 256
+};
+
+struct dc_gamma {
+	uint16_t red[INPUT_LUT_ENTRIES];
+	uint16_t green[INPUT_LUT_ENTRIES];
+	uint16_t blue[INPUT_LUT_ENTRIES];
+};
+
 /* Used by both ipp amd opp functions*/
 /* TODO: to be consolidated with enum color_space */
 
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
index 653f93d..46b1287 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.c
@@ -28,8 +28,6 @@
 
 #include "dce_opp.h"
 
-#include "gamma_types.h"
-
 #include "reg_helper.h"
 
 #define REG(reg)\
diff --git a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.h b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.h
index 1c01a83e..f2828f0 100644
--- a/drivers/gpu/drm/amd/display/dc/dce/dce_opp.h
+++ b/drivers/gpu/drm/amd/display/dc/dce/dce_opp.h
@@ -29,10 +29,6 @@
 #include "opp.h"
 #include "core_types.h"
 
-#include "gamma_types.h" /* decprecated */
-
-struct gamma_parameters;
-
 #define FROM_DCE11_OPP(opp)\
 	container_of(opp, struct dce110_opp, base)
 
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
index 2f79075..e4cef9d 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c
@@ -228,10 +228,11 @@ static void build_prescale_params(struct ipp_prescale_params *prescale_params,
 		break;
 	default:
 		ASSERT(false);
+		break;
 	}
 }
 
-static bool dce110_set_degamma(
+static bool dce110_set_input_transfer_func(
 	struct pipe_ctx *pipe_ctx,
 	const struct core_surface *surface)
 {
@@ -249,6 +250,9 @@ static bool dce110_set_degamma(
 	build_prescale_params(&prescale_params, surface);
 	ipp->funcs->ipp_program_prescale(ipp, &prescale_params);
 
+	if (surface->public.gamma_correction)
+	    ipp->funcs->ipp_program_input_lut(ipp, surface->public.gamma_correction);
+
 	if (tf == NULL) {
 		/* Default case if no input transfer function specified */
 		ipp->funcs->ipp_set_degamma(ipp,
@@ -272,6 +276,7 @@ static bool dce110_set_degamma(
 			break;
 		default:
 			result = false;
+			break;
 		}
 	} else {
 		/*TF_TYPE_DISTRIBUTED_POINTS - Not supported in DCE 11*/
@@ -303,8 +308,11 @@ static bool dce110_set_output_transfer_func(
 
 	opp->funcs->opp_power_on_regamma_lut(opp, true);
 
-	if (ramp && calculate_regamma_params(
-				regamma_params, ramp, surface, stream)) {
+	if (stream->public.out_transfer_func &&
+	    stream->public.out_transfer_func->type == TF_TYPE_PREDEFINED &&
+	    stream->public.out_transfer_func->tf == TRANSFER_FUNCTION_SRGB) {
+		opp->funcs->opp_set_regamma_mode(opp, OPP_REGAMMA_SRGB);
+	} else if (ramp && calculate_regamma_params(regamma_params, ramp, surface, stream)) {
 		opp->funcs->opp_program_regamma_pwl(opp, regamma_params);
 		opp->funcs->opp_set_regamma_mode(opp, OPP_REGAMMA_USER);
 	} else {
@@ -1318,7 +1326,6 @@ enum dc_status dce110_apply_ctx_to_hw(
 			* instead of per pipe.
 			*/
 			struct audio_output audio_output;
-			struct pipe_ctx *pipe_ctx = &context->res_ctx.pipe_ctx[i];
 
 			build_audio_output(pipe_ctx, &audio_output);
 
@@ -1945,7 +1952,7 @@ static const struct hw_sequencer_funcs dce110_funcs = {
 	.set_plane_config = set_plane_config,
 	.update_plane_addr = update_plane_addr,
 	.update_pending_status = dce110_update_pending_status,
-	.set_input_transfer_func = dce110_set_degamma,
+	.set_input_transfer_func = dce110_set_input_transfer_func,
 	.set_output_transfer_func = dce110_set_output_transfer_func,
 	.power_down = dce110_power_down,
 	.enable_accelerated_mode = dce110_enable_accelerated_mode,
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp.c
index dd69f60..86fa765 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp.c
@@ -35,6 +35,7 @@ static const struct ipp_funcs funcs = {
 		.ipp_cursor_set_attributes = dce110_ipp_cursor_set_attributes,
 		.ipp_cursor_set_position = dce110_ipp_cursor_set_position,
 		.ipp_program_prescale = dce110_ipp_program_prescale,
+		.ipp_program_input_lut = dce110_ipp_program_input_lut,
 		.ipp_set_degamma = dce110_ipp_set_degamma,
 };
 
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp.h b/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp.h
index 56fe327..a374ef2 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp.h
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp.h
@@ -28,9 +28,6 @@
 
 #include "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)
 
@@ -69,9 +66,9 @@ bool dce110_ipp_set_degamma(
 void dce110_ipp_program_prescale(
 	struct input_pixel_processor *ipp,
 	struct ipp_prescale_params *params);
-/*
- * Helper functions to be resused in other ASICs
- */
-void dce110_helper_select_lut(struct dce110_ipp *ipp110);
+
+void dce110_ipp_program_input_lut(
+	struct input_pixel_processor *ipp,
+	const struct dc_gamma *gamma);
 
 #endif /*__DC_IPP_DCE110_H__*/
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp_gamma.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp_gamma.c
index 79a6a6d..c68914b 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp_gamma.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_ipp_gamma.c
@@ -32,21 +32,39 @@
 #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)
+	(mm##reg + ipp110->offsets.dcp_offset)
+
+#define DCP_REG_SET_N(reg_name, n, ...)	\
+	generic_reg_update_ex(ipp110->base.ctx, \
+			DCP_REG(reg_name), \
+			0, n, __VA_ARGS__)
+
+#define DCP_REG_SET(reg, field1, val1) \
+		DCP_REG_SET_N(reg, 1, FD(reg##__##field1), val1)
+
+#define DCP_REG_SET_2(reg, field1, val1, field2, val2) \
+		DCP_REG_SET_N(reg, 2, \
+			FD(reg##__##field1), val1, \
+			FD(reg##__##field2), val2)
+
+#define DCP_REG_SET_3(reg, field1, val1, field2, val2, field3, val3) \
+		DCP_REG_SET_N(reg, 3, \
+			FD(reg##__##field1), val1, \
+			FD(reg##__##field2), val2, \
+			FD(reg##__##field3), val3)
+
+#define DCP_REG_UPDATE_N(reg_name, n, ...)	\
+	generic_reg_update_ex(ipp110->base.ctx, \
+			DCP_REG(reg_name), \
+			dm_read_reg(ipp110->base.ctx, DCP_REG(reg_name)), \
+			n, __VA_ARGS__)
+
+#define DCP_REG_UPDATE(reg, field, val)	\
+		DCP_REG_UPDATE_N(reg, 1, FD(reg##__##field), val)
 
-enum {
-	MAX_INPUT_LUT_ENTRY = 256
-};
 
-/*PROTOTYPE DECLARATIONS*/
-static void set_lut_inc(
-	struct dce110_ipp *ipp110,
-	uint8_t inc,
-	bool is_float,
-	bool is_signed);
 
 bool dce110_ipp_set_degamma(
 	struct input_pixel_processor *ipp,
@@ -61,25 +79,11 @@ bool dce110_ipp_set_degamma(
 	ASSERT(mode == IPP_DEGAMMA_MODE_BYPASS ||
 			mode == IPP_DEGAMMA_MODE_HW_sRGB);
 
-	set_reg_field_value(
-		value,
-		degamma_type,
-		DEGAMMA_CONTROL,
-		GRPH_DEGAMMA_MODE);
-
-	set_reg_field_value(
-		value,
-		degamma_type,
-		DEGAMMA_CONTROL,
-		CURSOR_DEGAMMA_MODE);
-
-	set_reg_field_value(
-		value,
-		degamma_type,
+	DCP_REG_SET_3(
 		DEGAMMA_CONTROL,
-		CURSOR2_DEGAMMA_MODE);
-
-	dm_write_reg(ipp110->base.ctx, DCP_REG(mmDEGAMMA_CONTROL), value);
+		GRPH_DEGAMMA_MODE, degamma_type,
+		CURSOR_DEGAMMA_MODE, degamma_type,
+		CURSOR2_DEGAMMA_MODE, degamma_type);
 
 	return true;
 }
@@ -90,214 +94,70 @@ void dce110_ipp_program_prescale(
 {
 	struct dce110_ipp *ipp110 = TO_DCE110_IPP(ipp);
 
-	uint32_t prescale_control = 0;
-	uint32_t prescale_value = 0;
-	uint32_t legacy_lut_control = 0;
+	/* set to bypass mode first before change */
+	DCP_REG_UPDATE(PRESCALE_GRPH_CONTROL,
+		GRPH_PRESCALE_BYPASS, 1);
 
-	prescale_control = dm_read_reg(ipp110->base.ctx,
-			DCP_REG(mmPRESCALE_GRPH_CONTROL));
+	DCP_REG_SET_2(PRESCALE_VALUES_GRPH_R,
+		GRPH_PRESCALE_SCALE_R, params->scale,
+		GRPH_PRESCALE_BIAS_R, params->bias);
 
-	if (params->mode != IPP_PRESCALE_MODE_BYPASS) {
+	DCP_REG_SET_2(PRESCALE_VALUES_GRPH_G,
+		GRPH_PRESCALE_SCALE_G, params->scale,
+		GRPH_PRESCALE_BIAS_G, params->bias);
 
-		set_reg_field_value(
-			prescale_control,
-			0,
-			PRESCALE_GRPH_CONTROL,
-			GRPH_PRESCALE_BYPASS);
-
-		/*
-		 * If prescale is in use, then legacy lut should
-		 * be bypassed
-		 */
-		legacy_lut_control = dm_read_reg(ipp110->base.ctx,
-			DCP_REG(mmINPUT_GAMMA_CONTROL));
-
-		set_reg_field_value(
-			legacy_lut_control,
-			1,
-			INPUT_GAMMA_CONTROL,
-			GRPH_INPUT_GAMMA_MODE);
-
-		dm_write_reg(ipp110->base.ctx,
-			DCP_REG(mmINPUT_GAMMA_CONTROL),
-			legacy_lut_control);
-	} else {
-		set_reg_field_value(
-			prescale_control,
-			1,
-			PRESCALE_GRPH_CONTROL,
-			GRPH_PRESCALE_BYPASS);
-	}
+	DCP_REG_SET_2(PRESCALE_VALUES_GRPH_B,
+		GRPH_PRESCALE_SCALE_B, params->scale,
+		GRPH_PRESCALE_BIAS_B, params->bias);
 
-	set_reg_field_value(
-		prescale_value,
-		params->scale,
-		PRESCALE_VALUES_GRPH_R,
-		GRPH_PRESCALE_SCALE_R);
-
-	set_reg_field_value(
-		prescale_value,
-		params->bias,
-		PRESCALE_VALUES_GRPH_R,
-		GRPH_PRESCALE_BIAS_R);
-
-	dm_write_reg(ipp110->base.ctx,
-		DCP_REG(mmPRESCALE_GRPH_CONTROL),
-		prescale_control);
-
-	dm_write_reg(ipp110->base.ctx,
-		DCP_REG(mmPRESCALE_VALUES_GRPH_R),
-		prescale_value);
-
-	dm_write_reg(ipp110->base.ctx,
-		DCP_REG(mmPRESCALE_VALUES_GRPH_G),
-		prescale_value);
-
-	dm_write_reg(ipp110->base.ctx,
-		DCP_REG(mmPRESCALE_VALUES_GRPH_B),
-		prescale_value);
-}
-
-static void set_lut_inc(
-	struct dce110_ipp *ipp110,
-	uint8_t inc,
-	bool is_float,
-	bool is_signed)
-{
-	const uint32_t addr = DCP_REG(mmDC_LUT_CONTROL);
-
-	uint32_t value = dm_read_reg(ipp110->base.ctx, addr);
-
-	set_reg_field_value(
-		value,
-		inc,
-		DC_LUT_CONTROL,
-		DC_LUT_INC_R);
-
-	set_reg_field_value(
-		value,
-		inc,
-		DC_LUT_CONTROL,
-		DC_LUT_INC_G);
-
-	set_reg_field_value(
-		value,
-		inc,
-		DC_LUT_CONTROL,
-		DC_LUT_INC_B);
-
-	set_reg_field_value(
-		value,
-		is_float,
-		DC_LUT_CONTROL,
-		DC_LUT_DATA_R_FLOAT_POINT_EN);
-
-	set_reg_field_value(
-		value,
-		is_float,
-		DC_LUT_CONTROL,
-		DC_LUT_DATA_G_FLOAT_POINT_EN);
-
-	set_reg_field_value(
-		value,
-		is_float,
-		DC_LUT_CONTROL,
-		DC_LUT_DATA_B_FLOAT_POINT_EN);
-
-	set_reg_field_value(
-		value,
-		is_signed,
-		DC_LUT_CONTROL,
-		DC_LUT_DATA_R_SIGNED_EN);
-
-	set_reg_field_value(
-		value,
-		is_signed,
-		DC_LUT_CONTROL,
-		DC_LUT_DATA_G_SIGNED_EN);
-
-	set_reg_field_value(
-		value,
-		is_signed,
-		DC_LUT_CONTROL,
-		DC_LUT_DATA_B_SIGNED_EN);
-
-	dm_write_reg(ipp110->base.ctx, addr, value);
+	if (params->mode != IPP_PRESCALE_MODE_BYPASS) {
+		/* If prescale is in use, then legacy lut should be bypassed */
+		DCP_REG_UPDATE(PRESCALE_GRPH_CONTROL, GRPH_PRESCALE_BYPASS, 0);
+		DCP_REG_UPDATE(INPUT_GAMMA_CONTROL, GRPH_INPUT_GAMMA_MODE, 1);
+	}
 }
 
-void dce110_helper_select_lut(struct dce110_ipp *ipp110)
+static void dce110_helper_select_lut(struct dce110_ipp *ipp110)
 {
-	uint32_t value = 0;
-
-	set_lut_inc(ipp110, 0, false, false);
-
-	{
-		const uint32_t addr = DCP_REG(mmDC_LUT_WRITE_EN_MASK);
-
-		value = dm_read_reg(ipp110->base.ctx, addr);
-
-		/* enable all */
-		set_reg_field_value(
-			value,
-			0x7,
-			DC_LUT_WRITE_EN_MASK,
-			DC_LUT_WRITE_EN_MASK);
-
-		dm_write_reg(ipp110->base.ctx, addr, value);
-	}
-
-	{
-		const uint32_t addr = DCP_REG(mmDC_LUT_RW_MODE);
-
-		value = dm_read_reg(ipp110->base.ctx, addr);
+	/* enable all */
+	DCP_REG_SET(DC_LUT_WRITE_EN_MASK, DC_LUT_WRITE_EN_MASK, 0x7);
 
-		set_reg_field_value(
-			value,
-			0,
-			DC_LUT_RW_MODE,
-			DC_LUT_RW_MODE);
+	/* 256 entry mode */
+	DCP_REG_UPDATE(DC_LUT_RW_MODE, DC_LUT_RW_MODE, 0);
 
-		dm_write_reg(ipp110->base.ctx, addr, value);
-	}
-
-	{
-		const uint32_t addr = DCP_REG(mmDC_LUT_CONTROL);
+	/* LUT-256, unsigned, integer, new u0.12 format */
+	DCP_REG_SET_3(DC_LUT_CONTROL,
+		DC_LUT_DATA_R_FORMAT, 3,
+		DC_LUT_DATA_G_FORMAT, 3,
+		DC_LUT_DATA_B_FORMAT, 3);
 
-		value = dm_read_reg(ipp110->base.ctx, addr);
+	/* start from index 0 */
+	DCP_REG_SET(DC_LUT_RW_INDEX, DC_LUT_RW_INDEX, 0);
+}
 
-		/* 00 - new u0.12 */
-		set_reg_field_value(
-			value,
-			3,
-			DC_LUT_CONTROL,
-			DC_LUT_DATA_R_FORMAT);
+void dce110_ipp_program_input_lut(
+	struct input_pixel_processor *ipp,
+	const struct dc_gamma *gamma)
+{
+	int i;
+	struct dce110_ipp *ipp110 = TO_DCE110_IPP(ipp);
 
-		set_reg_field_value(
-			value,
-			3,
-			DC_LUT_CONTROL,
-			DC_LUT_DATA_G_FORMAT);
+	dce110_helper_select_lut(ipp110);
 
-		set_reg_field_value(
-			value,
-			3,
-			DC_LUT_CONTROL,
-			DC_LUT_DATA_B_FORMAT);
+	/* power on LUT memory and give it time to settle */
+	DCP_REG_SET(DCFE_MEM_PWR_CTRL, DCP_LUT_MEM_PWR_DIS, 1);
+	udelay(10);
 
-		dm_write_reg(ipp110->base.ctx, addr, value);
+	for (i = 0; i < INPUT_LUT_ENTRIES; i++) {
+		DCP_REG_SET(DC_LUT_SEQ_COLOR, DC_LUT_SEQ_COLOR, gamma->red[i]);
+		DCP_REG_SET(DC_LUT_SEQ_COLOR, DC_LUT_SEQ_COLOR, gamma->green[i]);
+		DCP_REG_SET(DC_LUT_SEQ_COLOR, DC_LUT_SEQ_COLOR, gamma->blue[i]);
 	}
 
-	{
-		const uint32_t addr = DCP_REG(mmDC_LUT_RW_INDEX);
-
-		value = dm_read_reg(ipp110->base.ctx, addr);
+	/* power off LUT memory */
+	DCP_REG_SET(DCFE_MEM_PWR_CTRL, DCP_LUT_MEM_PWR_DIS, 0);
 
-		set_reg_field_value(
-			value,
-			0,
-			DC_LUT_RW_INDEX,
-			DC_LUT_RW_INDEX);
-
-		dm_write_reg(ipp110->base.ctx, addr, value);
-	}
+	/* bypass prescale, enable legacy LUT */
+	DCP_REG_UPDATE(PRESCALE_GRPH_CONTROL, GRPH_PRESCALE_BYPASS, 1);
+	DCP_REG_UPDATE(INPUT_GAMMA_CONTROL, GRPH_INPUT_GAMMA_MODE, 0);
 }
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_regamma_v.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_regamma_v.c
index 81fcbc5..8164aa6 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_regamma_v.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_regamma_v.c
@@ -30,7 +30,6 @@
 #include "dce/dce_11_0_sh_mask.h"
 
 #include "dce/dce_opp.h"
-#include "gamma_types.h"
 
 static void power_on_lut(struct output_pixel_processor *opp,
 	bool power_on, bool inputgamma, bool regamma)
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_v.c b/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_v.c
index dfd63a7..0a9b384 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_v.c
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_v.c
@@ -32,8 +32,6 @@
 #include "dce/dce_opp.h"
 #include "dce110_opp_v.h"
 
-#include "gamma_types.h"
-
 /*****************************************/
 /* Constructor, Destructor               */
 /*****************************************/
diff --git a/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_v.h b/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_v.h
index dcdbf86..ac59377 100644
--- a/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_v.h
+++ b/drivers/gpu/drm/amd/display/dc/dce110/dce110_opp_v.h
@@ -29,10 +29,6 @@
 #include "opp.h"
 #include "core_types.h"
 
-#include "gamma_types.h" /* decprecated */
-
-struct gamma_parameters;
-
 bool dce110_opp_v_construct(struct dce110_opp *opp110,
 	struct dc_context *ctx);
 
diff --git a/drivers/gpu/drm/amd/display/dc/dce80/dce80_ipp.c b/drivers/gpu/drm/amd/display/dc/dce80/dce80_ipp.c
index 86826c2..c195acb 100644
--- a/drivers/gpu/drm/amd/display/dc/dce80/dce80_ipp.c
+++ b/drivers/gpu/drm/amd/display/dc/dce80/dce80_ipp.c
@@ -37,6 +37,7 @@ static const struct ipp_funcs funcs = {
 		.ipp_cursor_set_attributes = dce110_ipp_cursor_set_attributes,
 		.ipp_cursor_set_position = dce110_ipp_cursor_set_position,
 		.ipp_program_prescale = dce110_ipp_program_prescale,
+		.ipp_program_input_lut = dce110_ipp_program_input_lut,
 		.ipp_set_degamma = dce110_ipp_set_degamma,
 };
 
diff --git a/drivers/gpu/drm/amd/display/dc/dce80/dce80_ipp.h b/drivers/gpu/drm/amd/display/dc/dce80/dce80_ipp.h
index d350138..06e8598 100644
--- a/drivers/gpu/drm/amd/display/dc/dce80/dce80_ipp.h
+++ b/drivers/gpu/drm/amd/display/dc/dce80/dce80_ipp.h
@@ -33,8 +33,6 @@
 
 struct dce110_ipp;
 struct dce110_ipp_reg_offsets;
-struct gamma_parameters;
-struct dev_c_lut;
 
 bool dce80_ipp_construct(
 	struct dce110_ipp *ipp,
diff --git a/drivers/gpu/drm/amd/display/dc/dce80/dce80_ipp_gamma.c b/drivers/gpu/drm/amd/display/dc/dce80/dce80_ipp_gamma.c
index eacb14e..760168d 100644
--- a/drivers/gpu/drm/amd/display/dc/dce80/dce80_ipp_gamma.c
+++ b/drivers/gpu/drm/amd/display/dc/dce80/dce80_ipp_gamma.c
@@ -34,15 +34,10 @@
 
 #include "dce80_ipp.h"
 #include "dce110/dce110_ipp.h"
-#include "gamma_types.h"
 
 #define DCP_REG(reg)\
 	(reg + ipp80->offsets.dcp_offset)
 
-enum {
-	MAX_INPUT_LUT_ENTRY = 256
-};
-
 /*PROTOTYPE DECLARATIONS*/
 
 static void set_legacy_input_gamma_mode(
diff --git a/drivers/gpu/drm/amd/display/dc/inc/gamma_types.h b/drivers/gpu/drm/amd/display/dc/inc/gamma_types.h
deleted file mode 100644
index 7948d2c..0000000
--- a/drivers/gpu/drm/amd/display/dc/inc/gamma_types.h
+++ /dev/null
@@ -1,38 +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 GAMMA_TYPES_H_
-
-#define GAMMA_TYPES_H_
-
-#include "dc_types.h"
-
-/* TODO: Used in IPP and OPP */
-
-struct dev_c_lut16 {
-	uint16_t red;
-	uint16_t green;
-	uint16_t blue;
-};
-#endif
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/ipp.h b/drivers/gpu/drm/amd/display/dc/inc/hw/ipp.h
index e9ed167..0457bc7 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/ipp.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/ipp.h
@@ -110,6 +110,10 @@ struct ipp_funcs {
 			struct input_pixel_processor *ipp,
 			struct ipp_prescale_params *params);
 
+	void (*ipp_program_input_lut)(
+			struct input_pixel_processor *ipp,
+			const struct dc_gamma *gamma);
+
 	/*** DEGAMMA RELATED ***/
 	bool (*ipp_set_degamma)(
 		struct input_pixel_processor *ipp,
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h b/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
index e615997..a1f31a4 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw/opp.h
@@ -30,7 +30,6 @@
 #include "transform.h"
 
 struct fixed31_32;
-struct gamma_parameters;
 
 /* TODO: Need cleanup */
 enum clamping_range {
diff --git a/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h b/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h
index 0e803ca..895c446 100644
--- a/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h
+++ b/drivers/gpu/drm/amd/display/dc/inc/hw_sequencer.h
@@ -28,8 +28,6 @@
 #include "core_types.h"
 #include "timing_generator.h"
 
-struct gamma_parameters;
-
 enum pipe_gating_control {
 	PIPE_GATING_CONTROL_DISABLE = 0,
 	PIPE_GATING_CONTROL_ENABLE,
diff --git a/drivers/gpu/drm/amd/display/modules/color/color.c b/drivers/gpu/drm/amd/display/modules/color/color.c
index 6d1b20f..5c578aec 100644
--- a/drivers/gpu/drm/amd/display/modules/color/color.c
+++ b/drivers/gpu/drm/amd/display/modules/color/color.c
@@ -2433,7 +2433,7 @@ bool mod_color_set_input_gamma_correction(struct mod_color *mod_color,
 
 		if (surface != NULL) {
 			struct dc_transfer_func *input_tf =
-					dc_create_transfer_func(core_color->dc);
+					dc_create_transfer_func();
 			struct dc_surface_update updates = {0};
 
 			if (input_tf != NULL) {
@@ -2724,7 +2724,7 @@ bool mod_color_update_gamut_info(struct mod_color *mod_color,
 		/* 3. ---- SET DEGAMMA ---- */
 		struct dc_transfer_func *input_tf = NULL;
 
-		input_tf = dc_create_transfer_func(core_color->dc);
+		input_tf = dc_create_transfer_func();
 
 		if (input_tf != NULL) {
 			input_tf->type = TF_TYPE_PREDEFINED;
@@ -2747,7 +2747,7 @@ bool mod_color_update_gamut_info(struct mod_color *mod_color,
 		/* 4. ---- SET REGAMMA ---- */
 		struct dc_transfer_func *output_tf = NULL;
 
-		output_tf = dc_create_transfer_func(core_color->dc);
+		output_tf = dc_create_transfer_func();
 
 		if (output_tf != NULL) {
 			output_tf->type = TF_TYPE_PREDEFINED;
-- 
2.7.4