Skip to content

Commit 93235bf

Browse files
committed
Merge tag 'amd-drm-fixes-6.2-2023-01-04' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
amd-drm-fixes-6.2-2023-01-04: amdgpu: - DCN 3.2 fix - Display fix amdkfd: - Fix kernel warning Signed-off-by: Daniel Vetter <[email protected]> From: Alex Deucher <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 83e79ae + 6fe6ece commit 93235bf

File tree

5 files changed

+39
-9
lines changed

5 files changed

+39
-9
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/amdkfd/kfd_topology.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -801,7 +801,7 @@ static int kfd_build_sysfs_node_entry(struct kfd_topology_device *dev,
801801

802802
p2plink->attr.name = "properties";
803803
p2plink->attr.mode = KFD_SYSFS_FILE_MODE;
804-
sysfs_attr_init(&iolink->attr);
804+
sysfs_attr_init(&p2plink->attr);
805805
ret = sysfs_create_file(p2plink->kobj, &p2plink->attr);
806806
if (ret < 0)
807807
return ret;

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;

drivers/gpu/drm/amd/display/dc/dml/dcn32/display_mode_vba_util_32.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6257,12 +6257,12 @@ bool dml32_CalculateDETSwathFillLatencyHiding(unsigned int NumberOfActiveSurface
62576257
double SwathSizePerSurfaceC[DC__NUM_DPP__MAX];
62586258
bool NotEnoughDETSwathFillLatencyHiding = false;
62596259

6260-
/* calculate sum of single swath size for all pipes in bytes*/
6260+
/* calculate sum of single swath size for all pipes in bytes */
62616261
for (k = 0; k < NumberOfActiveSurfaces; k++) {
6262-
SwathSizePerSurfaceY[k] += SwathHeightY[k] * SwathWidthY[k] * BytePerPixelInDETY[k] * NumOfDPP[k];
6262+
SwathSizePerSurfaceY[k] = SwathHeightY[k] * SwathWidthY[k] * BytePerPixelInDETY[k] * NumOfDPP[k];
62636263

62646264
if (SwathHeightC[k] != 0)
6265-
SwathSizePerSurfaceC[k] += SwathHeightC[k] * SwathWidthC[k] * BytePerPixelInDETC[k] * NumOfDPP[k];
6265+
SwathSizePerSurfaceC[k] = SwathHeightC[k] * SwathWidthC[k] * BytePerPixelInDETC[k] * NumOfDPP[k];
62666266
else
62676267
SwathSizePerSurfaceC[k] = 0;
62686268

0 commit comments

Comments
 (0)