Skip to content

Commit 75b950e

Browse files
committed
Revert "drm/amd/display: Fix for otg synchronization logic"
This reverts commit a896f87. It causes odd flickering on my Radeon RX580 (PCI ID 1002:67df rev e7, subsystem ID 1da2:e353). Bisected right to this commit, and reverting it fixes things. Link: https://lore.kernel.org/all/CAHk-=wg9hDde_L3bK9tAfdJ4N=TJJ+SjO3ZDONqH5=bVoy_Mzg@mail.gmail.com/ Cc: Alex Deucher <alexdeucher@gmail.com> Cc: Daniel Vetter <daniel.vetter@ffwll.ch> Cc: Harry Wentland <harry.wentland@amd.com> Cc: Dave Airlie <airlied@gmail.com> Cc: Christian Koenig <christian.koenig@amd.com> Cc: Jun Lei <Jun.Lei@amd.com> Cc: Mustapha Ghaddar <mustapha.ghaddar@amd.com> Cc: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> Cc: meenakshikumar somasundaram <meenakshikumar.somasundaram@amd.com> Cc: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 8d0749b commit 75b950e

File tree

7 files changed

+14
-99
lines changed

7 files changed

+14
-99
lines changed

drivers/gpu/drm/amd/display/dc/core/dc.c

Lines changed: 14 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1404,29 +1404,22 @@ static void program_timing_sync(
14041404
status->timing_sync_info.master = false;
14051405

14061406
}
1407+
/* remove any other unblanked pipes as they have already been synced */
1408+
for (j = j + 1; j < group_size; j++) {
1409+
bool is_blanked;
14071410

1408-
/* remove any other pipes that are already been synced */
1409-
if (dc->config.use_pipe_ctx_sync_logic) {
1410-
/* check pipe's syncd to decide which pipe to be removed */
1411-
for (j = 1; j < group_size; j++) {
1412-
if (pipe_set[j]->pipe_idx_syncd == pipe_set[0]->pipe_idx_syncd) {
1413-
group_size--;
1414-
pipe_set[j] = pipe_set[group_size];
1415-
j--;
1416-
} else
1417-
/* link slave pipe's syncd with master pipe */
1418-
pipe_set[j]->pipe_idx_syncd = pipe_set[0]->pipe_idx_syncd;
1411+
if (pipe_set[j]->stream_res.opp->funcs->dpg_is_blanked)
1412+
is_blanked =
1413+
pipe_set[j]->stream_res.opp->funcs->dpg_is_blanked(pipe_set[j]->stream_res.opp);
1414+
else
1415+
is_blanked =
1416+
pipe_set[j]->stream_res.tg->funcs->is_blanked(pipe_set[j]->stream_res.tg);
1417+
if (!is_blanked) {
1418+
group_size--;
1419+
pipe_set[j] = pipe_set[group_size];
1420+
j--;
14191421
}
1420-
} else {
1421-
/* remove any other pipes by checking valid plane */
1422-
for (j = j + 1; j < group_size; j++) {
1423-
if (pipe_set[j]->plane_state) {
1424-
group_size--;
1425-
pipe_set[j] = pipe_set[group_size];
1426-
j--;
1427-
}
1428-
}
1429-
}
1422+
}
14301423

14311424
if (group_size > 1) {
14321425
if (sync_type == TIMING_SYNCHRONIZABLE) {

drivers/gpu/drm/amd/display/dc/core/dc_resource.c

Lines changed: 0 additions & 54 deletions
Original file line numberDiff line numberDiff line change
@@ -3216,57 +3216,3 @@ struct hpo_dp_link_encoder *resource_get_hpo_dp_link_enc_for_det_lt(
32163216
return hpo_dp_link_enc;
32173217
}
32183218
#endif
3219-
3220-
void reset_syncd_pipes_from_disabled_pipes(struct dc *dc,
3221-
struct dc_state *context)
3222-
{
3223-
int i, j;
3224-
struct pipe_ctx *pipe_ctx_old, *pipe_ctx, *pipe_ctx_syncd;
3225-
3226-
/* If pipe backend is reset, need to reset pipe syncd status */
3227-
for (i = 0; i < dc->res_pool->pipe_count; i++) {
3228-
pipe_ctx_old = &dc->current_state->res_ctx.pipe_ctx[i];
3229-
pipe_ctx = &context->res_ctx.pipe_ctx[i];
3230-
3231-
if (!pipe_ctx_old->stream)
3232-
continue;
3233-
3234-
if (pipe_ctx_old->top_pipe || pipe_ctx_old->prev_odm_pipe)
3235-
continue;
3236-
3237-
if (!pipe_ctx->stream ||
3238-
pipe_need_reprogram(pipe_ctx_old, pipe_ctx)) {
3239-
3240-
/* Reset all the syncd pipes from the disabled pipe */
3241-
for (j = 0; j < dc->res_pool->pipe_count; j++) {
3242-
pipe_ctx_syncd = &context->res_ctx.pipe_ctx[j];
3243-
if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx_syncd) == pipe_ctx_old->pipe_idx) ||
3244-
!IS_PIPE_SYNCD_VALID(pipe_ctx_syncd))
3245-
SET_PIPE_SYNCD_TO_PIPE(pipe_ctx_syncd, j);
3246-
}
3247-
}
3248-
}
3249-
}
3250-
3251-
void check_syncd_pipes_for_disabled_master_pipe(struct dc *dc,
3252-
struct dc_state *context,
3253-
uint8_t disabled_master_pipe_idx)
3254-
{
3255-
int i;
3256-
struct pipe_ctx *pipe_ctx, *pipe_ctx_check;
3257-
3258-
pipe_ctx = &context->res_ctx.pipe_ctx[disabled_master_pipe_idx];
3259-
if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx) != disabled_master_pipe_idx) ||
3260-
!IS_PIPE_SYNCD_VALID(pipe_ctx))
3261-
SET_PIPE_SYNCD_TO_PIPE(pipe_ctx, disabled_master_pipe_idx);
3262-
3263-
/* for the pipe disabled, check if any slave pipe exists and assert */
3264-
for (i = 0; i < dc->res_pool->pipe_count; i++) {
3265-
pipe_ctx_check = &context->res_ctx.pipe_ctx[i];
3266-
3267-
if ((GET_PIPE_SYNCD_FROM_PIPE(pipe_ctx_check) == disabled_master_pipe_idx) &&
3268-
IS_PIPE_SYNCD_VALID(pipe_ctx_check) && (i != disabled_master_pipe_idx))
3269-
DC_ERR("DC: Failure: pipe_idx[%d] syncd with disabled master pipe_idx[%d]\n",
3270-
i, disabled_master_pipe_idx);
3271-
}
3272-
}

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

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -344,7 +344,6 @@ struct dc_config {
344344
uint8_t vblank_alignment_max_frame_time_diff;
345345
bool is_asymmetric_memory;
346346
bool is_single_rank_dimm;
347-
bool use_pipe_ctx_sync_logic;
348347
};
349348

350349
enum visual_confirm {

drivers/gpu/drm/amd/display/dc/dce110/dce110_hw_sequencer.c

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1566,10 +1566,6 @@ static enum dc_status apply_single_controller_ctx_to_hw(
15661566
&pipe_ctx->stream->audio_info);
15671567
}
15681568

1569-
/* make sure no pipes syncd to the pipe being enabled */
1570-
if (!pipe_ctx->stream->apply_seamless_boot_optimization && dc->config.use_pipe_ctx_sync_logic)
1571-
check_syncd_pipes_for_disabled_master_pipe(dc, context, pipe_ctx->pipe_idx);
1572-
15731569
#if defined(CONFIG_DRM_AMD_DC_DCN)
15741570
/* DCN3.1 FPGA Workaround
15751571
* Need to enable HPO DP Stream Encoder before setting OTG master enable.
@@ -2301,10 +2297,6 @@ enum dc_status dce110_apply_ctx_to_hw(
23012297
enum dc_status status;
23022298
int i;
23032299

2304-
/* reset syncd pipes from disabled pipes */
2305-
if (dc->config.use_pipe_ctx_sync_logic)
2306-
reset_syncd_pipes_from_disabled_pipes(dc, context);
2307-
23082300
/* Reset old context */
23092301
/* look up the targets that have been removed since last commit */
23102302
hws->funcs.reset_hw_ctx_wrap(dc, context);

drivers/gpu/drm/amd/display/dc/dcn31/dcn31_resource.c

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2260,9 +2260,6 @@ static bool dcn31_resource_construct(
22602260
dc->caps.color.mpc.ogam_rom_caps.hlg = 0;
22612261
dc->caps.color.mpc.ocsc = 1;
22622262

2263-
/* Use pipe context based otg sync logic */
2264-
dc->config.use_pipe_ctx_sync_logic = true;
2265-
22662263
/* read VBIOS LTTPR caps */
22672264
{
22682265
if (ctx->dc_bios->funcs->get_lttpr_caps) {

drivers/gpu/drm/amd/display/dc/inc/core_types.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,6 @@ struct pipe_ctx {
382382
struct pll_settings pll_settings;
383383

384384
uint8_t pipe_idx;
385-
uint8_t pipe_idx_syncd;
386385

387386
struct pipe_ctx *top_pipe;
388387
struct pipe_ctx *bottom_pipe;

drivers/gpu/drm/amd/display/dc/inc/resource.h

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,6 @@
3434
#define MEMORY_TYPE_HBM 2
3535

3636

37-
#define IS_PIPE_SYNCD_VALID(pipe) ((((pipe)->pipe_idx_syncd) & 0x80)?1:0)
38-
#define GET_PIPE_SYNCD_FROM_PIPE(pipe) ((pipe)->pipe_idx_syncd & 0x7F)
39-
#define SET_PIPE_SYNCD_TO_PIPE(pipe, pipe_syncd) ((pipe)->pipe_idx_syncd = (0x80 | pipe_syncd))
40-
4137
enum dce_version resource_parse_asic_id(
4238
struct hw_asic_id asic_id);
4339

@@ -212,11 +208,4 @@ struct hpo_dp_link_encoder *resource_get_hpo_dp_link_enc_for_det_lt(
212208
const struct dc_link *link);
213209
#endif
214210

215-
void reset_syncd_pipes_from_disabled_pipes(struct dc *dc,
216-
struct dc_state *context);
217-
218-
void check_syncd_pipes_for_disabled_master_pipe(struct dc *dc,
219-
struct dc_state *context,
220-
uint8_t disabled_master_pipe_idx);
221-
222211
#endif /* DRIVERS_GPU_DRM_AMD_DC_DEV_DC_INC_RESOURCE_H_ */

0 commit comments

Comments
 (0)