Skip to content

Commit 6fe6ece

Browse files
Michel Dänzeralexdeucher
authored andcommitted
Revert "drm/amd/display: Enable Freesync Video Mode by default"
This reverts commit de05abe. The bug referenced below was bisected to this commit. There has been no activity toward fixing it in 3 months, so let's revert for now. Bug: https://gitlab.freedesktop.org/drm/amd/-/issues/2162 Signed-off-by: Michel Dänzer <[email protected]> Signed-off-by: Alex Deucher <[email protected]> Cc: [email protected]
1 parent f3c23be commit 6fe6ece

File tree

3 files changed

+35
-5
lines changed

3 files changed

+35
-5
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ extern int amdgpu_emu_mode;
195195
extern uint amdgpu_smu_memory_pool_size;
196196
extern int amdgpu_smu_pptable_id;
197197
extern uint amdgpu_dc_feature_mask;
198+
extern uint amdgpu_freesync_vid_mode;
198199
extern uint amdgpu_dc_debug_mask;
199200
extern uint amdgpu_dc_visual_confirm;
200201
extern uint amdgpu_dm_abm_level;

drivers/gpu/drm/amd/amdgpu/amdgpu_drv.c

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -181,6 +181,7 @@ int amdgpu_mes_kiq;
181181
int amdgpu_noretry = -1;
182182
int amdgpu_force_asic_type = -1;
183183
int amdgpu_tmz = -1; /* auto */
184+
uint amdgpu_freesync_vid_mode;
184185
int amdgpu_reset_method = -1; /* auto */
185186
int amdgpu_num_kcq = -1;
186187
int amdgpu_smartshift_bias;
@@ -879,6 +880,32 @@ module_param_named(backlight, amdgpu_backlight, bint, 0444);
879880
MODULE_PARM_DESC(tmz, "Enable TMZ feature (-1 = auto (default), 0 = off, 1 = on)");
880881
module_param_named(tmz, amdgpu_tmz, int, 0444);
881882

883+
/**
884+
* DOC: freesync_video (uint)
885+
* Enable the optimization to adjust front porch timing to achieve seamless
886+
* mode change experience when setting a freesync supported mode for which full
887+
* modeset is not needed.
888+
*
889+
* The Display Core will add a set of modes derived from the base FreeSync
890+
* video mode into the corresponding connector's mode list based on commonly
891+
* used refresh rates and VRR range of the connected display, when users enable
892+
* this feature. From the userspace perspective, they can see a seamless mode
893+
* change experience when the change between different refresh rates under the
894+
* same resolution. Additionally, userspace applications such as Video playback
895+
* can read this modeset list and change the refresh rate based on the video
896+
* frame rate. Finally, the userspace can also derive an appropriate mode for a
897+
* particular refresh rate based on the FreeSync Mode and add it to the
898+
* connector's mode list.
899+
*
900+
* Note: This is an experimental feature.
901+
*
902+
* The default value: 0 (off).
903+
*/
904+
MODULE_PARM_DESC(
905+
freesync_video,
906+
"Enable freesync modesetting optimization feature (0 = off (default), 1 = on)");
907+
module_param_named(freesync_video, amdgpu_freesync_vid_mode, uint, 0444);
908+
882909
/**
883910
* DOC: reset_method (int)
884911
* GPU reset method (-1 = auto (default), 0 = legacy, 1 = mode0, 2 = mode1, 3 = mode2, 4 = baco)

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5835,7 +5835,8 @@ create_stream_for_sink(struct amdgpu_dm_connector *aconnector,
58355835
*/
58365836
DRM_DEBUG_DRIVER("No preferred mode found\n");
58375837
} else {
5838-
recalculate_timing = is_freesync_video_mode(&mode, aconnector);
5838+
recalculate_timing = amdgpu_freesync_vid_mode &&
5839+
is_freesync_video_mode(&mode, aconnector);
58395840
if (recalculate_timing) {
58405841
freesync_mode = get_highest_refresh_rate_mode(aconnector, false);
58415842
drm_mode_copy(&saved_mode, &mode);
@@ -6986,7 +6987,7 @@ static void amdgpu_dm_connector_add_freesync_modes(struct drm_connector *connect
69866987
struct amdgpu_dm_connector *amdgpu_dm_connector =
69876988
to_amdgpu_dm_connector(connector);
69886989

6989-
if (!edid)
6990+
if (!(amdgpu_freesync_vid_mode && edid))
69906991
return;
69916992

69926993
if (amdgpu_dm_connector->max_vfreq - amdgpu_dm_connector->min_vfreq > 10)
@@ -8850,7 +8851,8 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
88508851
* TODO: Refactor this function to allow this check to work
88518852
* in all conditions.
88528853
*/
8853-
if (dm_new_crtc_state->stream &&
8854+
if (amdgpu_freesync_vid_mode &&
8855+
dm_new_crtc_state->stream &&
88548856
is_timing_unchanged_for_freesync(new_crtc_state, old_crtc_state))
88558857
goto skip_modeset;
88568858

@@ -8885,7 +8887,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
88858887
if (!dm_old_crtc_state->stream)
88868888
goto skip_modeset;
88878889

8888-
if (dm_new_crtc_state->stream &&
8890+
if (amdgpu_freesync_vid_mode && dm_new_crtc_state->stream &&
88898891
is_timing_unchanged_for_freesync(new_crtc_state,
88908892
old_crtc_state)) {
88918893
new_crtc_state->mode_changed = false;
@@ -8897,7 +8899,7 @@ static int dm_update_crtc_state(struct amdgpu_display_manager *dm,
88978899
set_freesync_fixed_config(dm_new_crtc_state);
88988900

88998901
goto skip_modeset;
8900-
} else if (aconnector &&
8902+
} else if (amdgpu_freesync_vid_mode && aconnector &&
89018903
is_freesync_video_mode(&new_crtc_state->mode,
89028904
aconnector)) {
89038905
struct drm_display_mode *high_mode;

0 commit comments

Comments
 (0)