Skip to content

Commit

Permalink
drm/amd/display: w/a to program DISPCLK_R_GATE_DISABLE DCN35
Browse files Browse the repository at this point in the history
[WHY & HOW]
Cursor corruption observed on USBC display with specific system setup with a
reboot. Cursor memory might still in the lightsleep state due to voltage
issue, we need program DISPCLK_R_GATE_DISABLE to avoid this issue only on
DCN35.

Reviewed-by: Nicholas Kazlauskas <nicholas.kazlauskas@amd.com>
Signed-off-by: Yihan Zhu <Yihan.Zhu@amd.com>
Signed-off-by: Wayne Lin <wayne.lin@amd.com>
Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Yihan Zhu authored and Alex Deucher committed Oct 22, 2024
1 parent 9b47278 commit 9bdcf2a
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 4 deletions.
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/display/dc/dpp/dcn20/dcn20_dpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -690,6 +690,7 @@ struct dcn20_dpp {
int lb_memory_size;
int lb_bits_per_entry;
bool is_write_to_ram_a_safe;
bool dispclk_r_gate_disable;
struct scaler_data scl_data;
struct pwl_params pwl_data;
};
Expand Down
1 change: 1 addition & 0 deletions drivers/gpu/drm/amd/display/dc/dpp/dcn30/dcn30_dpp.h
Original file line number Diff line number Diff line change
Expand Up @@ -572,6 +572,7 @@ struct dcn3_dpp {
int lb_memory_size;
int lb_bits_per_entry;
bool is_write_to_ram_a_safe;
bool dispclk_r_gate_disable;
struct scaler_data scl_data;
struct pwl_params pwl_data;
};
Expand Down
22 changes: 18 additions & 4 deletions drivers/gpu/drm/amd/display/dc/dpp/dcn35/dcn35_dpp.c
Original file line number Diff line number Diff line change
Expand Up @@ -50,11 +50,21 @@ void dpp35_dppclk_control(
DPPCLK_RATE_CONTROL, dppclk_div,
DPP_CLOCK_ENABLE, 1);
else
REG_UPDATE(DPP_CONTROL,
DPP_CLOCK_ENABLE, 1);
if (dpp->dispclk_r_gate_disable)
REG_UPDATE_2(DPP_CONTROL,
DPP_CLOCK_ENABLE, 1,
DISPCLK_R_GATE_DISABLE, 1);
else
REG_UPDATE(DPP_CONTROL,
DPP_CLOCK_ENABLE, 1);
} else
REG_UPDATE(DPP_CONTROL,
DPP_CLOCK_ENABLE, 0);
if (dpp->dispclk_r_gate_disable)
REG_UPDATE_2(DPP_CONTROL,
DPP_CLOCK_ENABLE, 0,
DISPCLK_R_GATE_DISABLE, 0);
else
REG_UPDATE(DPP_CONTROL,
DPP_CLOCK_ENABLE, 0);
}

void dpp35_program_bias_and_scale_fcnv(
Expand Down Expand Up @@ -126,6 +136,10 @@ bool dpp35_construct(
(const struct dcn3_dpp_mask *)(tf_mask));

dpp->base.funcs = &dcn35_dpp_funcs;

// w/a for cursor memory stuck in LS by programming DISPCLK_R_GATE_DISABLE, limit w/a to some ASIC revs
if (dpp->base.ctx->asic_id.hw_internal_rev <= 0x10)
dpp->dispclk_r_gate_disable = true;
return ret;
}

Expand Down

0 comments on commit 9bdcf2a

Please sign in to comment.