From: Benjamin Nwankwo <[email protected]> [WHY] On pipe resets, cursor cache resets to sync with power gated hubp. But dcn42 doesn't power gate hubp which causes a discrepancy where cursor registers are still enabled while the cache is cleared. This ultimately leads to a pipe's cursor incorrectly retaining its enabled state, while the cursor isn't in its viewport
[HOW] Skip memsets for dpp and hubp cursor caches if either disable_hubp_power_gate or ignore_pg flags are true Reviewed-by: Aric Cyr <[email protected]> Signed-off-by: Benjamin Nwankwo <[email protected]> Signed-off-by: Alex Hung <[email protected]> Cc: Mario Limonciello <[email protected]> Cc: Alex Deucher <[email protected]> Cc: [email protected] --- drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp.c | 7 ++++--- drivers/gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.c | 6 ++++-- 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp.c b/drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp.c index ce91e5d28956..194dba734cc1 100644 --- a/drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp.c +++ b/drivers/gpu/drm/amd/display/dc/dpp/dcn10/dcn10_dpp.c @@ -193,9 +193,10 @@ void dpp_reset(struct dpp *dpp_base) dpp->filter_v_c = NULL; dpp->filter_h = NULL; dpp->filter_v = NULL; - - memset(&dpp_base->pos, 0, sizeof(dpp_base->pos)); - memset(&dpp_base->att, 0, sizeof(dpp_base->att)); + if (!dpp_base->ctx->dc->debug.ignore_pg) { + memset(&dpp_base->pos, 0, sizeof(dpp_base->pos)); + memset(&dpp_base->att, 0, sizeof(dpp_base->att)); + } memset(&dpp->scl_data, 0, sizeof(dpp->scl_data)); memset(&dpp->pwl_data, 0, sizeof(dpp->pwl_data)); diff --git a/drivers/gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.c b/drivers/gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.c index 6378e3fd7249..a2ddf81538e6 100644 --- a/drivers/gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.c +++ b/drivers/gpu/drm/amd/display/dc/hubp/dcn10/dcn10_hubp.c @@ -548,8 +548,10 @@ void hubp1_dcc_control(struct hubp *hubp, bool enable, void hubp_reset(struct hubp *hubp) { - memset(&hubp->pos, 0, sizeof(hubp->pos)); - memset(&hubp->att, 0, sizeof(hubp->att)); + if (!hubp->ctx->dc->debug.ignore_pg && !hubp->ctx->dc->debug.disable_hubp_power_gate) { + memset(&hubp->pos, 0, sizeof(hubp->pos)); + memset(&hubp->att, 0, sizeof(hubp->att)); + } hubp->cursor_offload = false; } -- 2.43.0
