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
|
From a308d21ab36fa4a6832fbeb71efa634b5fff35c1 Mon Sep 17 00:00:00 2001
From: David Rokhvarg <David.Rokhvarg@amd.com>
Date: Thu, 18 Feb 2016 13:50:38 -0500
Subject: [PATCH 1379/1565] drm/amd/dal: Implement power control of COL_MAN
Gamma correction.
This is a part of MPO bringup.
Change-Id: I02b8a2f655889364d169311aeb11cdf7dfa06646
Signed-off-by: David Rokhvarg <David.Rokhvarg@amd.com>
Acked-by: Harry Wentland <harry.wentland@amd.com>
---
drivers/gpu/drm/amd/dal/dc/dce110/Makefile | 2 +-
drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.c | 2 +-
.../drm/amd/dal/dc/dce110/dce110_opp_regamma_v.c | 31 ++++++++++++++++++++++
drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_v.c | 6 +++++
drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_v.h | 3 +++
5 files changed, 42 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/Makefile b/drivers/gpu/drm/amd/dal/dc/dce110/Makefile
index 404b2bf..170c273 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/Makefile
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/Makefile
@@ -10,7 +10,7 @@ dce110_transform_gamut.o dce110_transform_scl.o dce110_opp_csc.o\
dce110_compressor.o dce110_mem_input.o dce110_hw_sequencer.o \
dce110_resource.o dce110_transform_bit_depth.o dce110_clock_source.o \
dce110_opp_regamma_v.o dce110_opp_csc_v.o dce110_timing_generator_v.o \
-dce110_mem_input_v.o
+dce110_mem_input_v.o dce110_opp_v.o
AMD_DAL_DCE110 = $(addprefix $(AMDDALPATH)/dc/dce110/,$(DCE110))
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 c06cf38..ab937d5 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp.c
@@ -42,7 +42,7 @@ enum {
/* Constructor, Destructor */
/*****************************************/
-struct opp_funcs funcs = {
+static struct opp_funcs funcs = {
.opp_power_on_regamma_lut = dce110_opp_power_on_regamma_lut,
.opp_program_bit_depth_reduction = dce110_opp_program_bit_depth_reduction,
.opp_program_clamping_and_pixel_encoding = dce110_opp_program_clamping_and_pixel_encoding,
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma_v.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma_v.c
index b9d7eda..8f4cb96 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma_v.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_regamma_v.c
@@ -517,4 +517,35 @@ bool dce110_opp_program_regamma_pwl_v(
return true;
}
+void dce110_opp_power_on_regamma_lut_v(
+ struct output_pixel_processor *opp,
+ bool power_on)
+{
+ uint32_t value = dm_read_reg(opp->ctx, mmDCFEV_MEM_PWR_CTRL);
+
+ set_reg_field_value(
+ value,
+ 0,
+ DCFEV_MEM_PWR_CTRL,
+ COL_MAN_GAMMA_CORR_MEM_PWR_FORCE);
+
+ set_reg_field_value(
+ value,
+ power_on,
+ DCFEV_MEM_PWR_CTRL,
+ COL_MAN_GAMMA_CORR_MEM_PWR_DIS);
+ set_reg_field_value(
+ value,
+ 0,
+ DCFEV_MEM_PWR_CTRL,
+ COL_MAN_INPUT_GAMMA_MEM_PWR_FORCE);
+
+ set_reg_field_value(
+ value,
+ power_on,
+ DCFEV_MEM_PWR_CTRL,
+ COL_MAN_INPUT_GAMMA_MEM_PWR_DIS);
+
+ dm_write_reg(opp->ctx, mmDCFEV_MEM_PWR_CTRL, value);
+}
diff --git a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_v.c b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_v.c
index 367325f..4b9042f 100644
--- a/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_v.c
+++ b/drivers/gpu/drm/amd/dal/dc/dce110/dce110_opp_v.c
@@ -39,6 +39,8 @@
/*****************************************/
struct opp_funcs funcs = {
+ .opp_power_on_regamma_lut = dce110_opp_power_on_regamma_lut_v,
+
.opp_program_regamma_pwl = dce110_opp_program_regamma_pwl_v,
.opp_set_csc_default = dce110_opp_v_set_csc_default,
@@ -47,10 +49,14 @@ struct opp_funcs funcs = {
.opp_program_bit_depth_reduction =
dce110_opp_program_bit_depth_reduction,
+
.opp_program_clamping_and_pixel_encoding =
dce110_opp_program_clamping_and_pixel_encoding,
.opp_set_dyn_expansion = dce110_opp_set_dyn_expansion,
+
+ .opp_set_regamma_mode = dce110_opp_set_regamma_mode,
+
.opp_destroy = dce110_opp_destroy,
};
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 3f2ed4a..9543a70 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
@@ -51,5 +51,8 @@ bool dce110_opp_program_regamma_pwl_v(
struct output_pixel_processor *opp,
const struct regamma_params *params);
+void dce110_opp_power_on_regamma_lut_v(
+ struct output_pixel_processor *opp,
+ bool power_on);
#endif /* __DC_OPP_DCE110_V_H__ */
--
1.9.1
|