Skip to content

Commit dd7a595

Browse files
Dmytro Laktyushkinalexdeucher
authored andcommitted
drm/amd/display: Fix OPTC_DATA_FORMAT programming
This should be programmed with timing rather than with odm. Signed-off-by: Dmytro Laktyushkin <[email protected]> Acked-by: Eryk Brol <[email protected]> Signed-off-by: Alex Deucher <[email protected]>
1 parent 508300a commit dd7a595

File tree

3 files changed

+11
-16
lines changed

3 files changed

+11
-16
lines changed

drivers/gpu/drm/amd/display/dc/dcn10/dcn10_optc.c

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -288,6 +288,17 @@ void optc1_program_timing(
288288
if (optc1_is_two_pixels_per_containter(&patched_crtc_timing) || optc1->opp_count == 2)
289289
h_div = H_TIMING_DIV_BY2;
290290

291+
if (REG(OPTC_DATA_FORMAT_CONTROL)) {
292+
uint32_t data_fmt = 0;
293+
294+
if (patched_crtc_timing.pixel_encoding == PIXEL_ENCODING_YCBCR422)
295+
data_fmt = 1;
296+
else if (patched_crtc_timing.pixel_encoding == PIXEL_ENCODING_YCBCR420)
297+
data_fmt = 2;
298+
299+
REG_UPDATE(OPTC_DATA_FORMAT_CONTROL, OPTC_DATA_FORMAT, data_fmt);
300+
}
301+
291302
#if defined(CONFIG_DRM_AMD_DC_DCN3_0)
292303
if (optc1->tg_mask->OTG_H_TIMING_DIV_MODE != 0) {
293304
if (optc1->opp_count == 4)

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,6 @@ void optc2_set_odm_combine(struct timing_generator *optc, int *opp_id, int opp_c
239239
int mpcc_hactive = (timing->h_addressable + timing->h_border_left + timing->h_border_right)
240240
/ opp_cnt;
241241
uint32_t memory_mask;
242-
uint32_t data_fmt = 0;
243242

244243
ASSERT(opp_cnt == 2);
245244

@@ -262,13 +261,6 @@ void optc2_set_odm_combine(struct timing_generator *optc, int *opp_id, int opp_c
262261
REG_SET(OPTC_MEMORY_CONFIG, 0,
263262
OPTC_MEM_SEL, memory_mask);
264263

265-
if (timing->pixel_encoding == PIXEL_ENCODING_YCBCR422)
266-
data_fmt = 1;
267-
else if (timing->pixel_encoding == PIXEL_ENCODING_YCBCR420)
268-
data_fmt = 2;
269-
270-
REG_UPDATE(OPTC_DATA_FORMAT_CONTROL, OPTC_DATA_FORMAT, data_fmt);
271-
272264
REG_SET_3(OPTC_DATA_SOURCE_SELECT, 0,
273265
OPTC_NUM_OF_INPUT_SEGMENT, 1,
274266
OPTC_SEG0_SRC_SEL, opp_id[0],

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

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -209,7 +209,6 @@ static void optc3_set_odm_combine(struct timing_generator *optc, int *opp_id, in
209209
int mpcc_hactive = (timing->h_addressable + timing->h_border_left + timing->h_border_right)
210210
/ opp_cnt;
211211
uint32_t memory_mask = 0;
212-
uint32_t data_fmt = 0;
213212

214213
/* TODO: In pseudocode but does not affect maximus, delete comment if we dont need on asic
215214
* REG_SET(OTG_GLOBAL_CONTROL2, 0, GLOBAL_UPDATE_LOCK_EN, 1);
@@ -240,13 +239,6 @@ static void optc3_set_odm_combine(struct timing_generator *optc, int *opp_id, in
240239
REG_SET(OPTC_MEMORY_CONFIG, 0,
241240
OPTC_MEM_SEL, memory_mask);
242241

243-
if (timing->pixel_encoding == PIXEL_ENCODING_YCBCR422)
244-
data_fmt = 1;
245-
else if (timing->pixel_encoding == PIXEL_ENCODING_YCBCR420)
246-
data_fmt = 2;
247-
248-
REG_UPDATE(OPTC_DATA_FORMAT_CONTROL, OPTC_DATA_FORMAT, data_fmt);
249-
250242
if (opp_cnt == 2) {
251243
REG_SET_3(OPTC_DATA_SOURCE_SELECT, 0,
252244
OPTC_NUM_OF_INPUT_SEGMENT, 1,

0 commit comments

Comments
 (0)