All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/amd/display: Get min/max vfreq from display_info
@ 2024-03-12 13:47 Harry Wentland
  2024-03-12 14:58 ` Alex Deucher
  2024-03-13 13:31 ` Hamza Mahfooz
  0 siblings, 2 replies; 5+ messages in thread
From: Harry Wentland @ 2024-03-12 13:47 UTC (permalink / raw)
  To: amd-gfx; +Cc: 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")
Signed-off-by: Harry Wentland <harry.wentland@amd.com>
---
 drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
index b1ca0aee0b30..cffb2655177c 100644
--- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
+++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
@@ -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) {
-- 
2.44.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/amd/display: Get min/max vfreq from display_info
  2024-03-12 13:47 [PATCH] drm/amd/display: Get min/max vfreq from display_info Harry Wentland
@ 2024-03-12 14:58 ` Alex Deucher
  2024-03-12 15:28   ` Harry Wentland
  2024-03-13 13:31 ` Hamza Mahfooz
  1 sibling, 1 reply; 5+ messages in thread
From: Alex Deucher @ 2024-03-12 14:58 UTC (permalink / raw)
  To: Harry Wentland; +Cc: amd-gfx

On Tue, Mar 12, 2024 at 9:57 AM Harry Wentland <harry.wentland@amd.com> wrote:
>
> 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")
> Signed-off-by: Harry Wentland <harry.wentland@amd.com>
> ---
>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
>  1 file changed, 5 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index b1ca0aee0b30..cffb2655177c 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -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

> +                       } else {
>                                 edid_check_required = edid->version > 1 ||
>                                                       (edid->version == 1 &&
>                                                        edid->revision > 1);
> +                       }
>                 }
>
>                 if (edid_check_required) {
> --
> 2.44.0
>

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/amd/display: Get min/max vfreq from display_info
  2024-03-12 14:58 ` Alex Deucher
@ 2024-03-12 15:28   ` Harry Wentland
  2024-03-13 13:31     ` Wheeler, Daniel
  0 siblings, 1 reply; 5+ messages in thread
From: Harry Wentland @ 2024-03-12 15:28 UTC (permalink / raw)
  To: Alex Deucher; +Cc: amd-gfx



On 2024-03-12 10:58, Alex Deucher wrote:
> On Tue, Mar 12, 2024 at 9:57 AM Harry Wentland <harry.wentland@amd.com> wrote:
>>
>> 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")
>> Signed-off-by: Harry Wentland <harry.wentland@amd.com>
>> ---
>>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> index b1ca0aee0b30..cffb2655177c 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> @@ -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)?
> 

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

> Alex
> 
>> +                       } else {
>>                                 edid_check_required = edid->version > 1 ||
>>                                                       (edid->version == 1 &&
>>                                                        edid->revision > 1);
>> +                       }
>>                 }
>>
>>                 if (edid_check_required) {
>> --
>> 2.44.0
>>


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] drm/amd/display: Get min/max vfreq from display_info
  2024-03-12 13:47 [PATCH] drm/amd/display: Get min/max vfreq from display_info Harry Wentland
  2024-03-12 14:58 ` Alex Deucher
@ 2024-03-13 13:31 ` Hamza Mahfooz
  1 sibling, 0 replies; 5+ messages in thread
From: Hamza Mahfooz @ 2024-03-13 13:31 UTC (permalink / raw)
  To: Harry Wentland, amd-gfx

On 3/12/24 09:47, Harry Wentland wrote:
> 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")
> Signed-off-by: Harry Wentland <harry.wentland@amd.com>

Acked-by: Hamza Mahfooz <hamza.mahfooz@amd.com>

> ---
>   drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
>   1 file changed, 5 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> index b1ca0aee0b30..cffb2655177c 100644
> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
> @@ -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) {
-- 
Hamza


^ permalink raw reply	[flat|nested] 5+ messages in thread

* RE: [PATCH] drm/amd/display: Get min/max vfreq from display_info
  2024-03-12 15:28   ` Harry Wentland
@ 2024-03-13 13:31     ` Wheeler, Daniel
  0 siblings, 0 replies; 5+ messages in thread
From: Wheeler, Daniel @ 2024-03-13 13:31 UTC (permalink / raw)
  To: Wentland, Harry, Alex Deucher; +Cc: amd-gfx

[Public]

Hi all,

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

Tested-by: Daniel Wheeler <daniel.wheeler@amd.com>

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 <amd-gfx-bounces@lists.freedesktop.org> On Behalf Of Harry Wentland
Sent: Tuesday, March 12, 2024 11:29 AM
To: Alex Deucher <alexdeucher@gmail.com>
Cc: amd-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/amd/display: Get min/max vfreq from display_info



On 2024-03-12 10:58, Alex Deucher wrote:
> On Tue, Mar 12, 2024 at 9:57 AM Harry Wentland <harry.wentland@amd.com> wrote:
>>
>> 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")
>> Signed-off-by: Harry Wentland <harry.wentland@amd.com>
>> ---
>>  drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 7 +++++--
>>  1 file changed, 5 insertions(+), 2 deletions(-)
>>
>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> index b1ca0aee0b30..cffb2655177c 100644
>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c
>> @@ -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)?
>

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

> Alex
>
>> +                       } else {
>>                                 edid_check_required = edid->version > 1 ||
>>                                                       (edid->version == 1 &&
>>                                                        edid->revision
>> > 1);
>> +                       }
>>                 }
>>
>>                 if (edid_check_required) {
>> --
>> 2.44.0
>>


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2024-03-13 13:31 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-03-12 13:47 [PATCH] drm/amd/display: Get min/max vfreq from display_info Harry Wentland
2024-03-12 14:58 ` Alex Deucher
2024-03-12 15:28   ` Harry Wentland
2024-03-13 13:31     ` Wheeler, Daniel
2024-03-13 13:31 ` Hamza Mahfooz

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.