Skip to content

Commit b4d56e0

Browse files
Wesley Chalmersalexdeucher
authored andcommitted
drm/amd/display: Add Interface to set FIFO ERRDET SW Override
[WHY] HW has handed down a new sequence which requires access to the FIFO ERRDET SW Override register. Signed-off-by: Wesley Chalmers <[email protected]> Reviewed-by: Dmytro Laktyushkin <[email protected]> Acked-by: Stylon Wang <[email protected]> Tested-by: Daniel Wheeler <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent bd4fd25 commit b4d56e0

File tree

6 files changed

+41
-3
lines changed

6 files changed

+41
-3
lines changed

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dccg.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,13 +96,23 @@ void dccg2_get_dccg_ref_freq(struct dccg *dccg,
9696
return;
9797
}
9898

99+
void dccg2_set_fifo_errdet_ovr_en(struct dccg *dccg,
100+
bool en)
101+
{
102+
struct dcn_dccg *dccg_dcn = TO_DCN_DCCG(dccg);
103+
104+
REG_UPDATE(DISPCLK_FREQ_CHANGE_CNTL,
105+
DCCG_FIFO_ERRDET_OVR_EN, en ? 1 : 0);
106+
}
107+
99108
void dccg2_init(struct dccg *dccg)
100109
{
101110
}
102111

103112
static const struct dccg_funcs dccg2_funcs = {
104113
.update_dpp_dto = dccg2_update_dpp_dto,
105114
.get_dccg_ref_freq = dccg2_get_dccg_ref_freq,
115+
.set_fifo_errdet_ovr_en = dccg2_set_fifo_errdet_ovr_en,
106116
.dccg_init = dccg2_init
107117
};
108118

drivers/gpu/drm/amd/display/dc/dcn20/dcn20_dccg.h

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
DCCG_SRII(DTO_PARAM, DPPCLK, 1),\
3535
DCCG_SRII(DTO_PARAM, DPPCLK, 2),\
3636
DCCG_SRII(DTO_PARAM, DPPCLK, 3),\
37-
SR(REFCLK_CNTL)
37+
SR(REFCLK_CNTL),\
38+
SR(DISPCLK_FREQ_CHANGE_CNTL)
3839

3940
#define DCCG_REG_LIST_DCN2() \
4041
DCCG_COMMON_REG_LIST_DCN_BASE(),\
@@ -59,7 +60,16 @@
5960
DCCG_SF(DPPCLK0_DTO_PARAM, DPPCLK0_DTO_PHASE, mask_sh),\
6061
DCCG_SF(DPPCLK0_DTO_PARAM, DPPCLK0_DTO_MODULO, mask_sh),\
6162
DCCG_SF(REFCLK_CNTL, REFCLK_CLOCK_EN, mask_sh),\
62-
DCCG_SF(REFCLK_CNTL, REFCLK_SRC_SEL, mask_sh)
63+
DCCG_SF(REFCLK_CNTL, REFCLK_SRC_SEL, mask_sh),\
64+
DCCG_SF(DISPCLK_FREQ_CHANGE_CNTL, DISPCLK_STEP_DELAY, mask_sh),\
65+
DCCG_SF(DISPCLK_FREQ_CHANGE_CNTL, DISPCLK_STEP_SIZE, mask_sh),\
66+
DCCG_SF(DISPCLK_FREQ_CHANGE_CNTL, DISPCLK_FREQ_RAMP_DONE, mask_sh),\
67+
DCCG_SF(DISPCLK_FREQ_CHANGE_CNTL, DISPCLK_MAX_ERRDET_CYCLES, mask_sh),\
68+
DCCG_SF(DISPCLK_FREQ_CHANGE_CNTL, DCCG_FIFO_ERRDET_RESET, mask_sh),\
69+
DCCG_SF(DISPCLK_FREQ_CHANGE_CNTL, DCCG_FIFO_ERRDET_STATE, mask_sh),\
70+
DCCG_SF(DISPCLK_FREQ_CHANGE_CNTL, DCCG_FIFO_ERRDET_OVR_EN, mask_sh),\
71+
DCCG_SF(DISPCLK_FREQ_CHANGE_CNTL, DISPCLK_CHG_FWD_CORR_DISABLE, mask_sh)
72+
6373

6474
#define DCCG_MASK_SH_LIST_DCN2(mask_sh) \
6575
DCCG_COMMON_MASK_SH_LIST_DCN_COMMON_BASE(mask_sh),\
@@ -74,7 +84,16 @@
7484
type DPPCLK_DTO_ENABLE[6];\
7585
type DPPCLK_DTO_DB_EN[6];\
7686
type REFCLK_CLOCK_EN;\
77-
type REFCLK_SRC_SEL;
87+
type REFCLK_SRC_SEL;\
88+
type DISPCLK_STEP_DELAY;\
89+
type DISPCLK_STEP_SIZE;\
90+
type DISPCLK_FREQ_RAMP_DONE;\
91+
type DISPCLK_MAX_ERRDET_CYCLES;\
92+
type DCCG_FIFO_ERRDET_RESET;\
93+
type DCCG_FIFO_ERRDET_STATE;\
94+
type DCCG_FIFO_ERRDET_OVR_EN;\
95+
type DISPCLK_CHG_FWD_CORR_DISABLE;\
96+
type DISPCLK_FREQ_CHANGE_CNTL;
7897

7998
#define DCCG3_REG_FIELD_LIST(type) \
8099
type PHYASYMCLK_FORCE_EN;\
@@ -137,6 +156,7 @@ struct dccg_registers {
137156
uint32_t DPPCLK_DTO_CTRL;
138157
uint32_t DPPCLK_DTO_PARAM[6];
139158
uint32_t REFCLK_CNTL;
159+
uint32_t DISPCLK_FREQ_CHANGE_CNTL;
140160
uint32_t HDMICHARCLK_CLOCK_CNTL[6];
141161
uint32_t PHYASYMCLK_CLOCK_CNTL;
142162
uint32_t PHYBSYMCLK_CLOCK_CNTL;
@@ -171,6 +191,9 @@ void dccg2_get_dccg_ref_freq(struct dccg *dccg,
171191
unsigned int xtalin_freq_inKhz,
172192
unsigned int *dccg_ref_freq_inKhz);
173193

194+
void dccg2_set_fifo_errdet_ovr_en(struct dccg *dccg,
195+
bool en);
196+
174197
void dccg2_init(struct dccg *dccg);
175198

176199
struct dccg *dccg2_create(

drivers/gpu/drm/amd/display/dc/dcn21/dcn21_dccg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ void dccg21_update_dpp_dto(struct dccg *dccg, int dpp_inst, int req_dppclk)
100100
static const struct dccg_funcs dccg21_funcs = {
101101
.update_dpp_dto = dccg21_update_dpp_dto,
102102
.get_dccg_ref_freq = dccg2_get_dccg_ref_freq,
103+
.set_fifo_errdet_ovr_en = dccg2_set_fifo_errdet_ovr_en,
103104
.dccg_init = dccg2_init
104105
};
105106

drivers/gpu/drm/amd/display/dc/dcn30/dcn30_dccg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
static const struct dccg_funcs dccg3_funcs = {
4747
.update_dpp_dto = dccg2_update_dpp_dto,
4848
.get_dccg_ref_freq = dccg2_get_dccg_ref_freq,
49+
.set_fifo_errdet_ovr_en = dccg2_set_fifo_errdet_ovr_en,
4950
.dccg_init = dccg2_init
5051
};
5152

drivers/gpu/drm/amd/display/dc/dcn301/dcn301_dccg.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
static const struct dccg_funcs dccg301_funcs = {
4646
.update_dpp_dto = dccg2_update_dpp_dto,
4747
.get_dccg_ref_freq = dccg2_get_dccg_ref_freq,
48+
.set_fifo_errdet_ovr_en = dccg2_set_fifo_errdet_ovr_en,
4849
.dccg_init = dccg2_init
4950
};
5051

drivers/gpu/drm/amd/display/dc/inc/hw/dccg.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,8 @@ struct dccg_funcs {
7676
void (*get_dccg_ref_freq)(struct dccg *dccg,
7777
unsigned int xtalin_freq_inKhz,
7878
unsigned int *dccg_ref_freq_inKhz);
79+
void (*set_fifo_errdet_ovr_en)(struct dccg *dccg,
80+
bool en);
7981
void (*dccg_init)(struct dccg *dccg);
8082
#if defined(CONFIG_DRM_AMD_DC_DCN3_1)
8183

0 commit comments

Comments
 (0)