Skip to content

Commit 75e9ec9

Browse files
Lawstorant1Naim
authored andcommitted
drm/amd/display: Enable HDMI VRR
[Why] We'd like to expose VRR functionality to end user if HDMI sink is advertising it's support. [How] VTEM info frame is used to signal HDMI sink that VRR is active. Use VTEM info packet as vrr_infopacket Signed-off-by: Tomasz Pakuła <tomasz.pakula.oficjalny@gmail.com>
1 parent b0f50df commit 75e9ec9

4 files changed

Lines changed: 18 additions & 3 deletions

File tree

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

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9638,7 +9638,10 @@ static void update_freesync_state_on_stream(
96389638

96399639
aconn = (struct amdgpu_dm_connector *)new_stream->dm_stream_context;
96409640

9641-
if (aconn && (aconn->as_type == ADAPTIVE_SYNC_TYPE_PCON_ALLOWED ||
9641+
if (aconn && aconn->as_type == ADAPTIVE_SYNC_TYPE_HDMI)
9642+
packet_type = PACKET_TYPE_VTEM;
9643+
9644+
else if (aconn && (aconn->as_type == ADAPTIVE_SYNC_TYPE_PCON_ALLOWED ||
96429645
aconn->vsdb_info.replay_mode)) {
96439646
pack_sdp_v1_3 = aconn->pack_sdp_v1_3;
96449647

@@ -13428,8 +13431,14 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,
1342813431
}
1342913432

1343013433
/* HDMI */
13431-
} else if (sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A && vsdb_info.freesync_supported) {
13432-
monitor_range_from_vsdb(&connector->display_info, &vsdb_info);
13434+
} else if (sink->sink_signal == SIGNAL_TYPE_HDMI_TYPE_A) {
13435+
/* Prefer HDMI VRR */
13436+
if (hdmi_vrr.supported) {
13437+
amdgpu_dm_connector->as_type = ADAPTIVE_SYNC_TYPE_HDMI;
13438+
monitor_range_from_hdmi(&connector->display_info, &vsdb_info);
13439+
} else if (vsdb_info.freesync_supported)
13440+
monitor_range_from_vsdb(&connector->display_info, &vsdb_info);
13441+
1343313442
freesync_capable = copy_range_to_amdgpu_connector(connector);
1343413443

1343513444
/* DP -> HDMI PCON */

drivers/gpu/drm/amd/display/modules/freesync/freesync.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
#include "dc.h"
2828
#include "mod_freesync.h"
2929
#include "core_types.h"
30+
#include "mod_info_packet.h"
3031

3132
#define MOD_FREESYNC_MAX_CONCURRENT_STREAMS 32
3233

@@ -955,6 +956,9 @@ void mod_freesync_build_vrr_infopacket(struct mod_freesync *mod_freesync,
955956
return;
956957

957958
switch (packet_type) {
959+
case PACKET_TYPE_VTEM:
960+
mod_build_vtem_infopacket(stream, vrr, infopacket);
961+
break;
958962
case PACKET_TYPE_FS_V3:
959963
build_vrr_infopacket_v3(stream->signal, vrr, app_tf, infopacket, stream->freesync_on_desktop);
960964
break;

drivers/gpu/drm/amd/display/modules/inc/mod_info_packet.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,7 @@ enum adaptive_sync_type {
5959
ADAPTIVE_SYNC_TYPE_PCON_ALLOWED = 2,
6060
ADAPTIVE_SYNC_TYPE_PCON_NOT_ALLOWED = 3,
6161
ADAPTIVE_SYNC_TYPE_EDP = 4,
62+
ADAPTIVE_SYNC_TYPE_HDMI = 5,
6263
};
6364

6465
enum adaptive_sync_sdp_version {

drivers/gpu/drm/amd/display/modules/info_packet/info_packet.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -699,6 +699,7 @@ void mod_build_adaptive_sync_infopacket(const struct dc_stream_state *stream,
699699
break;
700700
case ADAPTIVE_SYNC_TYPE_NONE:
701701
case ADAPTIVE_SYNC_TYPE_PCON_NOT_ALLOWED:
702+
case ADAPTIVE_SYNC_TYPE_HDMI:
702703
default:
703704
break;
704705
}

0 commit comments

Comments
 (0)