diff options
author | Amy Zhang <Amy.Zhang@amd.com> | 2017-06-28 18:14:09 -0400 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2017-09-26 18:08:27 -0400 |
commit | 1a87fbfee0a0f96e8b482c2ac7eae113c9ca2497 (patch) | |
tree | 11d0c7c9e7297d5943f22a0e99f06ae06b9552d1 /drivers/gpu/drm/amd/display/modules/freesync/freesync.c | |
parent | abe07e80836fb25a5bcfda573413a68be82439c6 (diff) |
drm/amd/display: Re-enable Vsync Interrupts for Gradual Refresh Ramp
- Make sure Vsync interrupts are disabled in static screen case
and enabled when not to save power
- Create no_static_for_external_dp debug option
Signed-off-by: Amy Zhang <Amy.Zhang@amd.com>
Reviewed-by: Anthony Koo <Anthony.Koo@amd.com>
Acked-by: Harry Wentland <Harry.Wentland@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/display/modules/freesync/freesync.c')
-rw-r--r-- | drivers/gpu/drm/amd/display/modules/freesync/freesync.c | 38 |
1 files changed, 28 insertions, 10 deletions
diff --git a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c index c7da90f2d8e7..4df79f7147f8 100644 --- a/drivers/gpu/drm/amd/display/modules/freesync/freesync.c +++ b/drivers/gpu/drm/amd/display/modules/freesync/freesync.c | |||
@@ -440,14 +440,11 @@ static void calc_freesync_range(struct core_freesync *core_freesync, | |||
440 | } | 440 | } |
441 | 441 | ||
442 | /* Determine whether BTR can be supported */ | 442 | /* Determine whether BTR can be supported */ |
443 | //if (max_frame_duration_in_ns >= | 443 | if (max_frame_duration_in_ns >= |
444 | // 2 * min_frame_duration_in_ns) | 444 | 2 * min_frame_duration_in_ns) |
445 | // core_freesync->map[index].caps->btr_supported = true; | 445 | core_freesync->map[index].caps->btr_supported = true; |
446 | //else | 446 | else |
447 | // core_freesync->map[index].caps->btr_supported = false; | 447 | core_freesync->map[index].caps->btr_supported = false; |
448 | |||
449 | /* Temp, keep btr disabled */ | ||
450 | core_freesync->map[index].caps->btr_supported = false; | ||
451 | 448 | ||
452 | /* Cache the time variables */ | 449 | /* Cache the time variables */ |
453 | state->time.max_render_time_in_us = | 450 | state->time.max_render_time_in_us = |
@@ -882,8 +879,10 @@ void mod_freesync_update_state(struct mod_freesync *mod_freesync, | |||
882 | * panels. Also change core variables only if there | 879 | * panels. Also change core variables only if there |
883 | * is a change. | 880 | * is a change. |
884 | */ | 881 | */ |
885 | if (dc_is_embedded_signal( | 882 | if ((dc_is_embedded_signal( |
886 | streams[stream_index]->sink->sink_signal) && | 883 | streams[stream_index]->sink->sink_signal) || |
884 | core_freesync->map[map_index].caps-> | ||
885 | no_static_for_external_dp == false) && | ||
887 | state->static_screen != | 886 | state->static_screen != |
888 | freesync_params->enable) { | 887 | freesync_params->enable) { |
889 | 888 | ||
@@ -1035,6 +1034,25 @@ bool mod_freesync_get_user_enable(struct mod_freesync *mod_freesync, | |||
1035 | return true; | 1034 | return true; |
1036 | } | 1035 | } |
1037 | 1036 | ||
1037 | bool mod_freesync_get_static_ramp_active(struct mod_freesync *mod_freesync, | ||
1038 | const struct dc_stream *stream, | ||
1039 | bool *is_ramp_active) | ||
1040 | { | ||
1041 | unsigned int index = 0; | ||
1042 | struct core_freesync *core_freesync = NULL; | ||
1043 | |||
1044 | if (mod_freesync == NULL) | ||
1045 | return false; | ||
1046 | |||
1047 | core_freesync = MOD_FREESYNC_TO_CORE(mod_freesync); | ||
1048 | index = map_index_from_stream(core_freesync, stream); | ||
1049 | |||
1050 | *is_ramp_active = | ||
1051 | core_freesync->map[index].state.static_ramp.ramp_is_active; | ||
1052 | |||
1053 | return true; | ||
1054 | } | ||
1055 | |||
1038 | bool mod_freesync_override_min_max(struct mod_freesync *mod_freesync, | 1056 | bool mod_freesync_override_min_max(struct mod_freesync *mod_freesync, |
1039 | const struct dc_stream *streams, | 1057 | const struct dc_stream *streams, |
1040 | unsigned int min_refresh, | 1058 | unsigned int min_refresh, |