From: Sreeja Golui <[email protected]>

Why:
Need an extra flag to track when vblank is being stretched in idle
scenarios

How:
Track static screen with the new flag and pass it to dml layer.
Requires the DML DRR member and stutter-gate change in dml.

Cc: Dillon Varone <[email protected]>
Signed-off-by: Sreeja Golui <[email protected]>
Signed-off-by: Wayne Lin <[email protected]>
---
 drivers/gpu/drm/amd/display/dc/core/dc.c                   | 7 +++++++
 drivers/gpu/drm/amd/display/dc/dc_stream.h                 | 3 +++
 .../dml2_wrapper/dml21_wrapper/dml21_translation_helper.c  | 1 +
 3 files changed, 11 insertions(+)

diff --git a/drivers/gpu/drm/amd/display/dc/core/dc.c 
b/drivers/gpu/drm/amd/display/dc/core/dc.c
index fd382363a0ea..6f2f219a928a 100644
--- a/drivers/gpu/drm/amd/display/dc/core/dc.c
+++ b/drivers/gpu/drm/amd/display/dc/core/dc.c
@@ -3300,6 +3300,10 @@ static struct dc_update_descriptor 
check_update_surfaces_for_stream(
                                stream_update->vrr_active_variable || 
stream_update->vrr_active_fixed))
                        su_flags->bits.fams_changed = 1;
 
+               /* Static-screen transitions change DML stutter constraints 
even if VRR stays variable. */
+               if (stream_update->vrr_active_idle_static_screen)
+                       su_flags->bits.fams_changed = 1;
+
                if (stream_update->scaler_sharpener_update) {
                        su_flags->bits.scaler_sharpener = 1;
                        elevate_update_type(&overall_type, UPDATE_TYPE_FULL, 
LOCK_DESCRIPTOR_STREAM);
@@ -3669,6 +3673,9 @@ static void copy_stream_update_to_stream(struct dc *dc,
        if (update->vrr_active_fixed)
                stream->vrr_active_fixed = *update->vrr_active_fixed;
 
+       if (update->vrr_active_idle_static_screen)
+               stream->vrr_active_idle_static_screen = 
*update->vrr_active_idle_static_screen;
+
        if (update->crtc_timing_adjust) {
                if (stream->adjust.v_total_min != 
update->crtc_timing_adjust->v_total_min ||
                        stream->adjust.v_total_max != 
update->crtc_timing_adjust->v_total_max)
diff --git a/drivers/gpu/drm/amd/display/dc/dc_stream.h 
b/drivers/gpu/drm/amd/display/dc/dc_stream.h
index 7999a7d84a77..94eccb87cbde 100644
--- a/drivers/gpu/drm/amd/display/dc/dc_stream.h
+++ b/drivers/gpu/drm/amd/display/dc/dc_stream.h
@@ -256,6 +256,8 @@ struct dc_stream_state {
        bool vrr_active_variable;
        bool freesync_on_desktop;
        bool vrr_active_fixed;
+       /* Ramless Idle static screen; variable VRR still permits cursor 
boosting. */
+       bool vrr_active_idle_static_screen;
 
        bool converter_disable_audio;
        uint8_t qs_bit;
@@ -367,6 +369,7 @@ struct dc_stream_update {
        bool *allow_freesync;
        bool *vrr_active_variable;
        bool *vrr_active_fixed;
+       bool *vrr_active_idle_static_screen;
 
        struct colorspace_transform *gamut_remap;
        enum dc_color_space *output_color_space;
diff --git 
a/drivers/gpu/drm/amd/display/dc/dml2_wrapper/dml21_wrapper/dml21_translation_helper.c
 
b/drivers/gpu/drm/amd/display/dc/dml2_wrapper/dml21_wrapper/dml21_translation_helper.c
index dc65750a7fe3..2e3ad7152f3f 100644
--- 
a/drivers/gpu/drm/amd/display/dc/dml2_wrapper/dml21_wrapper/dml21_translation_helper.c
+++ 
b/drivers/gpu/drm/amd/display/dc/dml2_wrapper/dml21_wrapper/dml21_translation_helper.c
@@ -170,6 +170,7 @@ static void 
populate_dml21_timing_config_from_stream_state(struct dml2_timing_cf
        timing->drr_config.enabled = stream->ignore_msa_timing_param;
        timing->drr_config.drr_active_variable = stream->vrr_active_variable;
        timing->drr_config.drr_active_fixed = stream->vrr_active_fixed;
+       timing->drr_config.drr_active_idle_static_screen = 
stream->vrr_active_idle_static_screen;
        timing->drr_config.disallowed = !stream->allow_freesync;
 
        /* limit min refresh rate to DC cap */
-- 
2.43.0

Reply via email to