Skip to contentSkip to conversation

drm/amd/display: Get min/max vfreq from display_info

PATCH In review Harry Wentland 4 participants 5 messages Mar 12, 2024 – Mar 13, 2024

Subsystems (3)
lore
Share & tools
lore

Harry Wentland

author maintainer
#0 lore raw

PATCH 1/1 drm/amd/display: Get min/max vfreq from display_info

We need the min/max vfreq on the amdgpu_dm_connector in order to program VRR.

Fixes db3e4f1cbb84 ("drm/amd/display: Use freesync when `DRM_EDID_FEATURE_CONTINUOUS_FREQ` found")
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -2
index b1ca0aee0b30..cffb2655177c 100644
@@ -11278,12 +11278,15 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,
 
 		if (is_dp_capable_without_timing_msa(adev->dm.dc,
 						     amdgpu_dm_connector)) {
-			if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ)
+			if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) {
 				freesync_capable = true;
-			else
+				amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq;
+				amdgpu_dm_connector->max_vfreq = connector->display_info.monitor_range.max_vfreq;
+			} else {
 				edid_check_required = edid->version > 1 ||
 						      (edid->version == 1 &&
 						       edid->revision > 1);
+			}
 		}
 
 		if (edid_check_required) {
Signature · 1 line
2.44.0
#1 lore raw
Quoted 15 lines · Harry Wentland

We need the min/max vfreq on the amdgpu_dm_connector in order to program VRR.

Fixes db3e4f1cbb84 ("drm/amd/display: Use freesync when `DRM_EDID_FEATURE_CONTINUOUS_FREQ` found")
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index b1ca0aee0b30..cffb2655177c 100644

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, · line 11284

Quoted 9 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -2
@@ -11278,12 +11278,15 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,
 
                if (is_dp_capable_without_timing_msa(adev->dm.dc,
                                                     amdgpu_dm_connector)) {
-                       if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ)
+                       if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) {
                                freesync_capable = true;
-                       else
+                               amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq;
+                               amdgpu_dm_connector->max_vfreq = connector->display_info.monitor_range.max_vfreq;

Does this need special handling for DRM_EDID_RANGE_OFFSET_MIN_VFREQ and DRM_EDID_RANGE_OFFSET_MAX_VFREQ as well (similar to the code below it)?

Alex

Quoted 11 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
+                       } else {
                                edid_check_required = edid->version > 1 ||
                                                      (edid->version == 1 &&
                                                       edid->revision > 1);
+                       }
                }
 
                if (edid_check_required) {
--

2.44.0

author maintainer
#2 lore raw
Quoted 17 lines · Alex Deucher
Quoted 16 lines · Harry Wentland

We need the min/max vfreq on the amdgpu_dm_connector in order to program VRR.

Fixes db3e4f1cbb84 ("drm/amd/display: Use freesync when `DRM_EDID_FEATURE_CONTINUOUS_FREQ` found")
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index b1ca0aee0b30..cffb2655177c 100644
@@ -11278,12 +11278,15 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,
 
Quoted 13 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c void amdgpu_dm_update_freesync_caps(struct drm_connector *connector, · line 11284

Quoted 8 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +3 -2
                if (is_dp_capable_without_timing_msa(adev->dm.dc,
                                                     amdgpu_dm_connector)) {
-                       if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ)
+                       if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) {
                                freesync_capable = true;
-                       else
+                               amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq;
+                               amdgpu_dm_connector->max_vfreq = connector->display_info.monitor_range.max_vfreq;

Does this need special handling for DRM_EDID_RANGE_OFFSET_MIN_VFREQ and DRM_EDID_RANGE_OFFSET_MAX_VFREQ as well (similar to the code below it)?

get_monitor_range in drm_edid.c already handles it. I'm actually wondering if the "else" and "edid_check_required" case is still required now, as it essentially just duplicates the drm_edid code. But I don't want to rip it out in the same patch and without a bit of testing.

Harry

Quoted 13 lines

Alex

Quoted 11 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
+                       } else {
                                edid_check_required = edid->version > 1 ||
                                                      (edid->version == 1 &&
                                                       edid->revision > 1);
+                       }
                }
 
                if (edid_check_required) {
--

2.44.0

Tested-by
#3 lore raw

[Public]

Hi all,

I can confirm that this re-enables VRR for a RX6800, and a RX7900XTX.

Thank you,

Dan Wheeler
Sr. Technologist | AMD
SW Display
------------------------------------------------------------------------------------------------------------------
1 Commerce Valley Dr E, Thornhill, ON L3T 7X6
Facebook | Twitter | amd.com

-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Harry Wentland
Sent: Tuesday, March 12, 2024 11:29 AM
To: Alex Deucher <[email protected]>
Cc: [email protected]
Subject: Re: [PATCH] drm/amd/display: Get min/max vfreq from display_info

Quoted 20 lines · Alex Deucher
Quoted 19 lines · Harry Wentland

We need the min/max vfreq on the amdgpu_dm_connector in order to program VRR.

Fixes db3e4f1cbb84 ("drm/amd/display: Use freesync when

DRM_EDID_FEATURE_CONTINUOUS_FREQ found")

---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +0 -0
index b1ca0aee0b30..cffb2655177c 100644
@@ -11278,12 +11278,15 @@ void amdgpu_dm_update_freesync_caps(struct
 drm_connector *connector,
 
Quoted 15 lines

drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,

Quoted 10 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -2
                if (is_dp_capable_without_timing_msa(adev->dm.dc,
                                                     amdgpu_dm_connector)) {
-                       if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ)
+                       if (edid->features &
+ DRM_EDID_FEATURE_CONTINUOUS_FREQ) {
                                freesync_capable = true;
-                       else
+                               amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq;
+                               amdgpu_dm_connector->max_vfreq =
+ connector->display_info.monitor_range.max_vfreq;

Does this need special handling for DRM_EDID_RANGE_OFFSET_MIN_VFREQ and DRM_EDID_RANGE_OFFSET_MAX_VFREQ as well (similar to the code below it)?

get_monitor_range in drm_edid.c already handles it. I'm actually wondering if the "else" and "edid_check_required" case is still required now, as it essentially just duplicates the drm_edid code. But I don't want to rip it out in the same patch and without a bit of testing.

Harry

Quoted 14 lines

Alex

Quoted 12 lines
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +2 -1
+                       } else {
                                edid_check_required = edid->version > 1 ||
                                                      (edid->version == 1 &&
                                                       edid->revision
 > 1);
+                       }
                }
 
                if (edid_check_required) {
--

2.44.0

Acked-by on v1 1/1
#4 lore raw
In reply to Harry Wentland
Quoted 5 lines · Harry Wentland

We need the min/max vfreq on the amdgpu_dm_connector in order to program VRR.

Fixes db3e4f1cbb84 ("drm/amd/display: Use freesync when `DRM_EDID_FEATURE_CONTINUOUS_FREQ` found")
Quoted 26 lines
---
  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
  1 file changed, 5 insertions(+), 2 deletions(-)
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +5 -2
index b1ca0aee0b30..cffb2655177c 100644
@@ -11278,12 +11278,15 @@ void amdgpu_dm_update_freesync_caps(struct drm_connector *connector,
 
  		if (is_dp_capable_without_timing_msa(adev->dm.dc,
  						     amdgpu_dm_connector)) {
-			if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ)
+			if (edid->features & DRM_EDID_FEATURE_CONTINUOUS_FREQ) {
  				freesync_capable = true;
-			else
+				amdgpu_dm_connector->min_vfreq = connector->display_info.monitor_range.min_vfreq;
+				amdgpu_dm_connector->max_vfreq = connector->display_info.monitor_range.max_vfreq;
+			} else {
  				edid_check_required = edid->version > 1 ||
  						      (edid->version == 1 &&
  						       edid->revision > 1);
+			}
  		}
 
  		if (edid_check_required) {
Signature · 1 line
Hamza