[igt-dev] [i-g-t, v2 3/8] tests/amdgpu/amd_freesync_video_mode: Fix wrong resolution setting during the test

Tom Chung chiahsuan.chung at amd.com
Fri Jun 30 11:18:16 UTC 2023


[Why]
Some monitors may have different resolution for non-Freesync video mode and it may
cause the IGT test set to a wrong resolution during the test.

[How]
Check the resolution and use the same one during select the video mode.

Signed-off-by: Tom Chung <chiahsuan.chung at amd.com>
---
 tests/amdgpu/amd_freesync_video_mode.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/tests/amdgpu/amd_freesync_video_mode.c b/tests/amdgpu/amd_freesync_video_mode.c
index 79e3e493c..cc5b92a81 100644
--- a/tests/amdgpu/amd_freesync_video_mode.c
+++ b/tests/amdgpu/amd_freesync_video_mode.c
@@ -421,10 +421,11 @@ static drmModeModeInfo *select_mode(
 	case FSV_NON_FREESYNC_VIDEO_MODE:
 		for (i = 0; i < data->count_modes; i++) {
 			mode = &data->modes[i];
-			if (mode->vrefresh == refresh_rate &&
-			    !is_freesync_video_mode(data, mode)) {
+			if (mode->hdisplay == data->hdisplay &&
+				mode->vdisplay == data->vdisplay &&
+				mode->vrefresh == refresh_rate &&
+				!is_freesync_video_mode(data, mode))
 				break;
-			}
 		}
 		if (i >= data->count_modes)
 			mode = NULL;
-- 
2.25.1



More information about the igt-dev mailing list