Skip to contentSkip to conversation

tests/kms_flip: disable DRRS if eDP support variable refresh rate

igt-dev Lee Shawn C 2 participants 2 messages Oct 22, 2023 – Oct 25, 2023

lore
Share & tools
lore
#0 lore raw

Just like https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/148.

kms_flip used the same way to calculate frametime. It may have chance to encounter this issue and get unexpected frame time due to DUT at low RR mode. So disable DRRS after crtc setmode can avoid driver switch to lower RR mode automatically to avoid this problem.

Cc Tvrtko Ursulin <[email protected]>
Cc Vidya Srinivas <[email protected]>
Cc Juha-Pekka Heikkila <[email protected]>
Cc Bhanuprakash Modem <[email protected]>
Cc Kamil Konieczny <[email protected]>
---
 tests/kms_flip.c | 4 ++++
 1 file changed, 4 insertions(+)
tests/kms_flip.c +4 -0
index 2c60cdf6db64..fc7cee0501c4 100755
@@ -30,6 +30,7 @@
 #include "config.h"
 
 #include "igt.h"
+#include "i915/intel_drrs.h"
 
 #include <cairo.h>
 #include <errno.h>
@@ -911,6 +912,9 @@ static int set_mode(struct test_output *o, uint32_t fb, int x, int y)
 				     conn, count, mode);
 		if (ret)
 			return ret;
+
+		if (is_intel_device(drm_fd))
+			intel_drrs_disable(drm_fd, o->pipe);
 	}
 
 	return 0;
Signature · 1 line
2.34.1
#1 lore raw
Quoted 30 lines · Lee Shawn C

Just like https://gitlab.freedesktop.org/drm/igt-gpu-tools/-/issues/148.

kms_flip used the same way to calculate frametime. It may have chance to encounter this issue and get unexpected frame time due to DUT at low RR mode. So disable DRRS after crtc setmode can avoid driver switch to lower RR mode automatically to avoid this problem.

Cc Tvrtko Ursulin <[email protected]>
Cc Vidya Srinivas <[email protected]>
Cc Juha-Pekka Heikkila <[email protected]>
Cc Bhanuprakash Modem <[email protected]>
Cc Kamil Konieczny <[email protected]>
---
  tests/kms_flip.c | 4 ++++
  1 file changed, 4 insertions(+)
tests/kms_flip.c +1 -0
index 2c60cdf6db64..fc7cee0501c4 100755
@@ -30,6 +30,7 @@
  #include "config.h"
 
  #include "igt.h"
+#include "i915/intel_drrs.h"
 
  #include <cairo.h>
  #include <errno.h>

tests/kms_flip.c static int set_mode(struct test_output *o, uint32_t fb, int x, int y) · line 917

Quoted 6 lines
tests/kms_flip.c +3 -0
@@ -911,6 +912,9 @@ static int set_mode(struct test_output *o, uint32_t fb, int x, int y)
  				     conn, count, mode);
  		if (ret)
  			return ret;
+
+		if (is_intel_device(drm_fd))
+			intel_drrs_disable(drm_fd, o->pipe);

LGTM

- Bhanu

Quoted 3 lines
tests/kms_flip.c +0 -0
  	}
 
  	return 0;