[igt-dev] [[PATCH i-g-t]] tests/kms_setmode: disable DRRS if eDP support variable refresh rate

Lee, Shawn C shawn.c.lee at intel.com
Thu Oct 19 09:55:50 UTC 2023


On Thursday, October 19, 2023 1:04 AM, Mark Yacoub <markyacoub at chromium.org> wrote:
>On Wed, Oct 18, 2023 at 4:05 AM Lee Shawn C <shawn.c.lee at intel.com> wrote:
>>
>> Below is a failed case while testing kms_setmode.
>>
>> CRTC[80] [Pipe A] Mode: 1920x1200 at 60Hz Connectors: eDP-1[236] Expected 
>> frametime: 16659us; measured 20824.4us +- 4.799us accuracy 0.01% [0.10 
>> scanlines]
>>
>> The expected frame time is 16659us (60Hz refresh rate).
>> But kms_setmode report measured time was 20824.4us (48Hz) then it 
>> failed. We found legacy DRRS mode was active at that time then refresh 
>> rate fall into lower RR automatically to cause this problem.
>> Disable DRRS after crtc setmode can avoid driver switch to lower RR 
>> mode
>
>Is it okay for the driver to do so? Would it be that the driver should not do that if it wasn't asked?
>Thanks,
>-Mark
>

Hi Mark, thanks for your comment! After mode setting, legacy DRRS will schedule a task to
swtich to lower RR if user space did not update frontbuffer anymore. It is a standard activity
to switch high/low RR for legacy DRRS. And there is no additional parameter to tell kernel
driver to disable DRRS via IOCTL.

So we use this functional call (intel_drrs_disable) to cancel kernel task manually and avoid to swtich low refresh rate.
Both kms_frontbuffer_tracking and kms_dirtyfb have the same implementation as well. 

Best regards,
Shawn

>> and get pass for this test as well.
>>
>> Issue: https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/148
>> Cc: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>
>> Cc: Vidya Srinivas <vidya.srinivas at intel.com>
>> Signed-off-by: Lee Shawn C <shawn.c.lee at intel.com>
>> ---
>>  tests/kms_setmode.c | 4 ++++
>>  1 file changed, 4 insertions(+)
>>
>> diff --git a/tests/kms_setmode.c b/tests/kms_setmode.c index 
>> 5fc4421c0080..b6fe3f9c159a 100644
>> --- a/tests/kms_setmode.c
>> +++ b/tests/kms_setmode.c
>> @@ -31,6 +31,7 @@
>>  #include <sys/time.h>
>>  #include <math.h>
>>  #include "xe/xe_query.h"
>> +#include "i915/intel_drrs.h"
>>  /**
>>   * TEST: kms setmode
>>   * Category: Display
>> @@ -651,6 +652,9 @@ retry:
>>                                              crtc->fb_info.fb_id, 0, 0, ids,
>>                                              crtc->connector_count, 
>> &crtc->mode);
>>
>> +               if (is_intel_device(drm_fd))
>> +                       intel_drrs_disable(drm_fd, crtc->pipe_id);
>> +
>>                 free(ids);
>>
>>                 if (ret < 0) {
>> --
>> 2.34.1
>>


More information about the igt-dev mailing list