mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-04 20:19:47 +08:00
drm/amd/display: Blank eDP on enable drv if odm enabled
[Why] For panels with pixel clock > 1200MHz that require ODM in pre-OS, when driver is disabled in OS, odm is enabled. Upon driver enablement, corruption is seen if odm was originally enabled. DP_PIXEL_COMBINE and pixelclk must be programmed prior to programming the optc-odm registers. However, eDP displays aren't blanked prior to initializing odm in this case. [How] Upon driver enablement, check whether odm is enabled, if so, blank eDP prior to programming optc-odm registers. Reviewed-by: Nicholas Kazlauskas <Nicholas.Kazlauskas@amd.com> Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com> Signed-off-by: Duncan Ma <duncan.ma@amd.com> Tested-by: Daniel Wheeler <daniel.wheeler@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
parent
77361ed89a
commit
2d017189e2
@ -2126,6 +2126,26 @@ void dc_link_blank_all_dp_displays(struct dc *dc)
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void dc_link_blank_all_edp_displays(struct dc *dc)
|
||||||
|
{
|
||||||
|
unsigned int i;
|
||||||
|
uint8_t dpcd_power_state = '\0';
|
||||||
|
enum dc_status status = DC_ERROR_UNEXPECTED;
|
||||||
|
|
||||||
|
for (i = 0; i < dc->link_count; i++) {
|
||||||
|
if ((dc->links[i]->connector_signal != SIGNAL_TYPE_EDP) ||
|
||||||
|
(!dc->links[i]->edp_sink_present))
|
||||||
|
continue;
|
||||||
|
|
||||||
|
/* if any of the displays are lit up turn them off */
|
||||||
|
status = core_link_read_dpcd(dc->links[i], DP_SET_POWER,
|
||||||
|
&dpcd_power_state, sizeof(dpcd_power_state));
|
||||||
|
|
||||||
|
if (status == DC_OK && dpcd_power_state == DP_POWER_STATE_D0)
|
||||||
|
dc_link_blank_dp_stream(dc->links[i], true);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
void dc_link_blank_dp_stream(struct dc_link *link, bool hw_init)
|
void dc_link_blank_dp_stream(struct dc_link *link, bool hw_init)
|
||||||
{
|
{
|
||||||
unsigned int j;
|
unsigned int j;
|
||||||
|
|||||||
@ -216,6 +216,7 @@ struct dc_caps {
|
|||||||
uint16_t subvp_pstate_allow_width_us;
|
uint16_t subvp_pstate_allow_width_us;
|
||||||
uint16_t subvp_vertical_int_margin_us;
|
uint16_t subvp_vertical_int_margin_us;
|
||||||
#endif
|
#endif
|
||||||
|
bool seamless_odm;
|
||||||
};
|
};
|
||||||
|
|
||||||
struct dc_bug_wa {
|
struct dc_bug_wa {
|
||||||
|
|||||||
@ -322,6 +322,7 @@ bool dc_link_setup_psr(struct dc_link *dc_link,
|
|||||||
void dc_link_get_psr_residency(const struct dc_link *link, uint32_t *residency);
|
void dc_link_get_psr_residency(const struct dc_link *link, uint32_t *residency);
|
||||||
|
|
||||||
void dc_link_blank_all_dp_displays(struct dc *dc);
|
void dc_link_blank_all_dp_displays(struct dc *dc);
|
||||||
|
void dc_link_blank_all_edp_displays(struct dc *dc);
|
||||||
|
|
||||||
void dc_link_blank_dp_stream(struct dc_link *link, bool hw_init);
|
void dc_link_blank_dp_stream(struct dc_link *link, bool hw_init);
|
||||||
|
|
||||||
|
|||||||
@ -213,6 +213,28 @@ void dcn31_init_hw(struct dc *dc)
|
|||||||
* everything down.
|
* everything down.
|
||||||
*/
|
*/
|
||||||
if (dcb->funcs->is_accelerated_mode(dcb) || !dc->config.seamless_boot_edp_requested) {
|
if (dcb->funcs->is_accelerated_mode(dcb) || !dc->config.seamless_boot_edp_requested) {
|
||||||
|
|
||||||
|
// we want to turn off edp displays if odm is enabled and no seamless boot
|
||||||
|
if (!dc->caps.seamless_odm) {
|
||||||
|
for (i = 0; i < dc->res_pool->timing_generator_count; i++) {
|
||||||
|
struct timing_generator *tg = dc->res_pool->timing_generators[i];
|
||||||
|
uint32_t num_opps, opp_id_src0, opp_id_src1;
|
||||||
|
|
||||||
|
num_opps = 1;
|
||||||
|
if (tg) {
|
||||||
|
if (tg->funcs->is_tg_enabled(tg) && tg->funcs->get_optc_source) {
|
||||||
|
tg->funcs->get_optc_source(tg, &num_opps,
|
||||||
|
&opp_id_src0, &opp_id_src1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (num_opps > 1) {
|
||||||
|
dc_link_blank_all_edp_displays(dc);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
hws->funcs.init_pipes(dc, dc->current_state);
|
hws->funcs.init_pipes(dc, dc->current_state);
|
||||||
if (dc->res_pool->hubbub->funcs->allow_self_refresh_control)
|
if (dc->res_pool->hubbub->funcs->allow_self_refresh_control)
|
||||||
dc->res_pool->hubbub->funcs->allow_self_refresh_control(dc->res_pool->hubbub,
|
dc->res_pool->hubbub->funcs->allow_self_refresh_control(dc->res_pool->hubbub,
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user