Skip to contentSkip to conversation

drm/amd/display: Store the AMD VSDB version for DP sinks without Replay

PATCH In review Wayne Lin 3 participants 3 messages Nov 19

Subsystems (3)
lore
Share & tools
lore

Wayne Lin

author
#0 lore raw

PATCH 1/1 drm/amd/display: Store the AMD VSDB version for DP sinks without Replay

Store amd_vsdb_version for every DP and eDP sink after get_amd_vsdb(), not only when Replay is advertised. Without this, a native DP sink above 255 Hz with AMD VSDB v3 and no Replay keeps version 0. amdgpu_dm_update_freesync_state_on_stream() then sends the v1 infopacket and truncates the rate to eight bits. A later EDID without the VSDB still writes 0. Replay still sets replay_mode and the eDP adaptive-sync type.

Cooper Morgan's patch already contained this hunk in amdgpu_dm_connector.c. The hunk was left out when the patch was applied. This follow-up puts that hunk back.

Fixes ae60ec4dcfc4 ("drm/amd/display: Use FreeSync v3 infopacket for sinks above 255 Hz")
Cc Cooper Morgan <[email protected]>
Cc Eren Özen <[email protected]>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c +1 -1
index 1bc8547d5777..41fc641b1b60 100644
@@ -3928,10 +3928,10 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,
 		}
 
 		get_amd_vsdb(amdgpu_dm_connector, &vsdb_info);
+		amdgpu_dm_connector->vsdb_info.amd_vsdb_version = vsdb_info.amd_vsdb_version;
 
 		if (vsdb_info.replay_mode) {
 			amdgpu_dm_connector->vsdb_info.replay_mode = vsdb_info.replay_mode;
-			amdgpu_dm_connector->vsdb_info.amd_vsdb_version = vsdb_info.amd_vsdb_version;
 			amdgpu_dm_connector->as_type = ADAPTIVE_SYNC_TYPE_EDP;
 		}
 
Signature · 1 line
2.43.0
Tested-by on v1 1/1
#1 lore raw

Hi Wayne,

Thanks for the quick fix. It's the same hunk as in Cooper's v1/v2.

I ran the amdgpu_dm KUnit suite on amd-staging-drm-next 8dd68a79583a with this change plus the i2c_xfer test fix, so the suite runs to the end. dm_test_fs_caps_dp_vsdb_version passes again, and all 1931 tests pass. I haven't tested it on a DP monitor above 255 Hz.

Thanks,
Eren

Reviewed-by on v1 1/1
#2 lore raw
In reply to Wayne Lin
Quoted 12 lines · Wayne Lin

Store amd_vsdb_version for every DP and eDP sink after get_amd_vsdb(), not only when Replay is advertised. Without this, a native DP sink above 255 Hz with AMD VSDB v3 and no Replay keeps version 0. amdgpu_dm_update_freesync_state_on_stream() then sends the v1 infopacket and truncates the rate to eight bits. A later EDID without the VSDB still writes 0. Replay still sets replay_mode and the eDP adaptive-sync type.

Cooper Morgan's patch already contained this hunk in amdgpu_dm_connector.c. The hunk was left out when the patch was applied. This follow-up puts that hunk back.

Quoted 6 lines
Fixes ae60ec4dcfc4 ("drm/amd/display: Use FreeSync v3 infopacket for sinks above 255 Hz")
Cc Cooper Morgan <[email protected]>
Cc Eren Özen <[email protected]>
Quoted 20 lines
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_connector.c +1 -1
index 1bc8547d5777..41fc641b1b60 100644
@@ -3928,10 +3928,10 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,
  		}
 
  		get_amd_vsdb(amdgpu_dm_connector, &vsdb_info);
+		amdgpu_dm_connector->vsdb_info.amd_vsdb_version = vsdb_info.amd_vsdb_version;
 
  		if (vsdb_info.replay_mode) {
  			amdgpu_dm_connector->vsdb_info.replay_mode = vsdb_info.replay_mode;
-			amdgpu_dm_connector->vsdb_info.amd_vsdb_version = vsdb_info.amd_vsdb_version;
  			amdgpu_dm_connector->as_type = ADAPTIVE_SYNC_TYPE_EDP;
  		}