diff options
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.14.71/5581-drm-amd-display-Freesync-does-not-engage-on-some-dis.patch')
-rw-r--r-- | common/recipes-kernel/linux/linux-yocto-4.14.71/5581-drm-amd-display-Freesync-does-not-engage-on-some-dis.patch | 94 |
1 files changed, 94 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.14.71/5581-drm-amd-display-Freesync-does-not-engage-on-some-dis.patch b/common/recipes-kernel/linux/linux-yocto-4.14.71/5581-drm-amd-display-Freesync-does-not-engage-on-some-dis.patch new file mode 100644 index 00000000..43054462 --- /dev/null +++ b/common/recipes-kernel/linux/linux-yocto-4.14.71/5581-drm-amd-display-Freesync-does-not-engage-on-some-dis.patch @@ -0,0 +1,94 @@ +From c7af9b5d8fc3742d8185d2ac49cfe870c096c36b Mon Sep 17 00:00:00 2001 +From: Harmanprit Tatla <htatla@amd.com> +Date: Mon, 24 Sep 2018 16:46:38 -0400 +Subject: [PATCH 5581/5725] drm/amd/display: Freesync does not engage on some + displays + +[Why] +Current render margin time is not sufficient to compute exit frame +time for most monitors. + +[How] +Declared render margin in FPS to compute a exit frame rate that is +4 FPS above the minimum FPS required to engage FreeSync. + Also did code clean-up to remove redundancies. + +Signed-off-by: Harmanprit Tatla <htatla@amd.com> +Reviewed-by: Anthony Koo <Anthony.Koo@amd.com> +Acked-by: Bhawanpreet Lakha <Bhawanpreet.Lakha@amd.com> +--- + .../drm/amd/display/modules/freesync/freesync.c | 37 ++++++---------------- + 1 file changed, 9 insertions(+), 28 deletions(-) + +diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c +index 4018c71..620a171 100644 +--- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c ++++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c +@@ -37,6 +37,8 @@ + #define RENDER_TIMES_MAX_COUNT 10 + /* Threshold to exit BTR (to avoid frequent enter-exits at the lower limit) */ + #define BTR_EXIT_MARGIN 2000 ++/*Threshold to exit fixed refresh rate*/ ++#define FIXED_REFRESH_EXIT_MARGIN_IN_HZ 4 + /* Number of consecutive frames to check before entering/exiting fixed refresh*/ + #define FIXED_REFRESH_ENTER_FRAME_COUNT 5 + #define FIXED_REFRESH_EXIT_FRAME_COUNT 5 +@@ -257,40 +259,14 @@ static void apply_below_the_range(struct core_freesync *core_freesync, + if (in_out_vrr->btr.btr_active) { + in_out_vrr->btr.frame_counter = 0; + in_out_vrr->btr.btr_active = false; +- +- /* Exit Fixed Refresh mode */ +- } else if (in_out_vrr->fixed.fixed_active) { +- +- in_out_vrr->fixed.frame_counter++; +- +- if (in_out_vrr->fixed.frame_counter > +- FIXED_REFRESH_EXIT_FRAME_COUNT) { +- in_out_vrr->fixed.frame_counter = 0; +- in_out_vrr->fixed.fixed_active = false; +- } + } + } else if (last_render_time_in_us > max_render_time_in_us) { + /* Enter Below the Range */ +- if (!in_out_vrr->btr.btr_active && +- in_out_vrr->btr.btr_enabled) { +- in_out_vrr->btr.btr_active = true; +- +- /* Enter Fixed Refresh mode */ +- } else if (!in_out_vrr->fixed.fixed_active && +- !in_out_vrr->btr.btr_enabled) { +- in_out_vrr->fixed.frame_counter++; +- +- if (in_out_vrr->fixed.frame_counter > +- FIXED_REFRESH_ENTER_FRAME_COUNT) { +- in_out_vrr->fixed.frame_counter = 0; +- in_out_vrr->fixed.fixed_active = true; +- } +- } ++ in_out_vrr->btr.btr_active = true; + } + + /* BTR set to "not active" so disengage */ + if (!in_out_vrr->btr.btr_active) { +- in_out_vrr->btr.btr_active = false; + in_out_vrr->btr.inserted_duration_in_us = 0; + in_out_vrr->btr.frames_to_insert = 0; + in_out_vrr->btr.frame_counter = 0; +@@ -375,7 +351,12 @@ static void apply_fixed_refresh(struct core_freesync *core_freesync, + bool update = false; + unsigned int max_render_time_in_us = in_out_vrr->max_duration_in_us; + +- if (last_render_time_in_us + BTR_EXIT_MARGIN < max_render_time_in_us) { ++ //Compute the exit refresh rate and exit frame duration ++ unsigned int exit_refresh_rate_in_milli_hz = ((1000000000/max_render_time_in_us) ++ + (1000*FIXED_REFRESH_EXIT_MARGIN_IN_HZ)); ++ unsigned int exit_frame_duration_in_us = 1000000000/exit_refresh_rate_in_milli_hz; ++ ++ if (last_render_time_in_us < exit_frame_duration_in_us) { + /* Exit Fixed Refresh mode */ + if (in_out_vrr->fixed.fixed_active) { + in_out_vrr->fixed.frame_counter++; +-- +2.7.4 + |