[PATCH i-g-t] tests/amdgpu/amd_vrr_range: Fix test may fail on non-zero card index
Alex Hung
alex.hung at amd.com
Mon Apr 14 16:26:05 UTC 2025
Reviewed-by: Alex Hung <alex.hung at amd.com>
On 4/14/25 03:21, Tom Chung wrote:
> [Why]
> Current test use hard code for card index.
> If the card index is not 0, the test will be failed.
>
> [How]
> Get the card index dynamically during the test.
>
> Signed-off-by: Tom Chung <chiahsuan.chung at amd.com>
> ---
> tests/amdgpu/amd_vrr_range.c | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tests/amdgpu/amd_vrr_range.c b/tests/amdgpu/amd_vrr_range.c
> index 9d2462e5e..38ef1d27f 100644
> --- a/tests/amdgpu/amd_vrr_range.c
> +++ b/tests/amdgpu/amd_vrr_range.c
> @@ -22,6 +22,7 @@
>
> #include "igt.h"
> #include "igt_sysfs.h"
> +#include "igt_device.h"
> #include "igt_amd.h"
> #include <fcntl.h>
>
> @@ -30,7 +31,7 @@ IGT_TEST_DESCRIPTION("Test EDID parsing and debugfs reporting on Freesync displa
> /* Maximumm pipes on any AMD ASIC. */
> #define MAX_PIPES 6
> #define EDID_SIZE 256
> -#define EDID_PATH "/sys/class/drm/card0-%s/edid"
> +#define EDID_PATH "/sys/class/drm/card%d-%s/edid"
>
> /* Common test data. */
> struct vrr_range {
> @@ -295,7 +296,7 @@ static bool find_vrr_range_from_edid(data_t *data, igt_output_t *output)
>
> /* Get EDID */
> igt_assert(snprintf(edid_path, PATH_MAX, EDID_PATH,
> - output->name) < PATH_MAX);
> + igt_device_get_card_index(data->fd), output->name) < PATH_MAX);
>
> fd = open(edid_path, O_RDONLY);
> if (fd == -1)
More information about the igt-dev
mailing list