[PATCH] drm/amd/display: Expose connector VRR range via debugfs

Kazlauskas, Nicholas Nicholas.Kazlauskas at amd.com
Fri Jan 25 14:01:47 UTC 2019


On 1/25/19 3:13 AM, Koenig, Christian wrote:
> Am 24.01.19 um 18:56 schrieb Wentland, Harry:
>>
>> On 2019-01-24 12:41 p.m., Christian König wrote:
>>> Am 24.01.19 um 18:06 schrieb Nicholas Kazlauskas:
>>>> [Why]
>>>> It's useful to know the min and max vrr range for IGT testing.
>>>>
>>>> [How]
>>>> Expose the min and max vfreq for the connector via a debugfs file
>>>> on the connector, "vrr_range".
>>>>
>>>> Example usage: cat /sys/kernel/debug/dri/0/DP-1/vrr_range
>>>>
>>>> Cc: Harry Wentland <harry.wentland at amd.com>
>>>> Cc: Leo Li <sunpeng.li at amd.com>
>>>> Signed-off-by: Nicholas Kazlauskas <nicholas.kazlauskas at amd.com>
>>> Oh, nice that is indeed useful. Acked-by: Christian König <christian.koenig at amd.com>
>>>
>> FYI, IGT test case making use of this: https://patchwork.freedesktop.org/patch/275982/
> 
> BTW: I have a flaky 4k VRR monitor here which at around 50% of all boots
> is not correctly detected on a Vega10.
> 
> It used to work fine about a month ago and same cable/etc work fine on a
> Tonga, so most likely a regression.
> 
> Not my highest priority at the moment, but are you guys already working
> on this? If not I will try to start to bisect when I have time.
> 
> Christian.

If you were trying to use 4k at 30Hz that would below your monitor's min 
VRR range I'd imagine. We were setting ignore_msa_timing_param on 
modesets for VRR capable displays even if VRR wasn't going to be enabled 
by userspace, but that could cause the monitor to blackout when the 
refresh rate is below the min range. There's a fix coming up to address 
that bug at least.

I don't think I know of any other issue recently that sounds like what 
you're seeing, so feel to bisect in that case or post a bug report.

Nicholas Kazlauskas

> 
>>
>> Reviewed-by: Harry Wentland <harry.wentland at amd.com>
>>
>> Harry
>>
>>>> ---
>>>>     .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 22 ++++++++++++++++++-
>>>>     1 file changed, 21 insertions(+), 1 deletion(-)
>>>>
>>>> diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
>>>> index cca3e16cda4f..4a55cde027cf 100644
>>>> --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
>>>> +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c
>>>> @@ -671,6 +671,25 @@ static ssize_t dp_phy_test_pattern_debugfs_write(struct file *f, const char __us
>>>>         return bytes_from_user;
>>>>     }
>>>>     +/*
>>>> + * Returns the min and max vrr vfreq through the connector's debugfs file.
>>>> + * Example usage: cat /sys/kernel/debug/dri/0/DP-1/vrr_range
>>>> + */
>>>> +static int vrr_range_show(struct seq_file *m, void *data)
>>>> +{
>>>> +    struct drm_connector *connector = m->private;
>>>> +    struct amdgpu_dm_connector *aconnector = to_amdgpu_dm_connector(connector);
>>>> +
>>>> +    if (connector->status != connector_status_connected)
>>>> +        return -ENODEV;
>>>> +
>>>> +    seq_printf(m, "Min: %u\n", (unsigned int)aconnector->min_vfreq);
>>>> +    seq_printf(m, "Max: %u\n", (unsigned int)aconnector->max_vfreq);
>>>> +
>>>> +    return 0;
>>>> +}
>>>> +DEFINE_SHOW_ATTRIBUTE(vrr_range);
>>>> +
>>>>     static const struct file_operations dp_link_settings_debugfs_fops = {
>>>>         .owner = THIS_MODULE,
>>>>         .read = dp_link_settings_read,
>>>> @@ -697,7 +716,8 @@ static const struct {
>>>>     } dp_debugfs_entries[] = {
>>>>             {"link_settings", &dp_link_settings_debugfs_fops},
>>>>             {"phy_settings", &dp_phy_settings_debugfs_fop},
>>>> -        {"test_pattern", &dp_phy_test_pattern_fops}
>>>> +        {"test_pattern", &dp_phy_test_pattern_fops},
>>>> +        {"vrr_range", &vrr_range_fops}
>>>>     };
>>>>       int connector_debugfs_init(struct amdgpu_dm_connector *connector)
> 



More information about the amd-gfx mailing list