[PATCH i-g-t 1/2] tests/kms_rmfb: Fix support for xe

B, Jeevan jeevan.b at intel.com
Fri Sep 20 04:39:07 UTC 2024


LGTM

Reviewed-by: Jeevan B <jeevan.b at intel.com>

> -----Original Message-----
> From: igt-dev <igt-dev-bounces at lists.freedesktop.org> On Behalf Of Lucas De
> Marchi
> Sent: Friday, September 20, 2024 1:03 AM
> To: igt-dev at lists.freedesktop.org
> Cc: De Marchi, Lucas <lucas.demarchi at intel.com>; Modem, Bhanuprakash
> <bhanuprakash.modem at intel.com>; Sharma, Swati2
> <swati2.sharma at intel.com>
> Subject: [PATCH i-g-t 1/2] tests/kms_rmfb: Fix support for xe
> 
> Make sure to hold a drm fd open while running the test so we can check for
> fb_id == 0 after either removing the fb or closing the previous fd.
> With i915 this is guaranteed by holding on to an fd to be used in an exit handler
> in drm_open_driver().
> 
> Cc: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
> Cc: Swati Sharma <swati2.sharma at intel.com>
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>
> ---
>  tests/kms_rmfb.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/tests/kms_rmfb.c b/tests/kms_rmfb.c index 0ea689d60..e4203bdd4
> 100644
> --- a/tests/kms_rmfb.c
> +++ b/tests/kms_rmfb.c
> @@ -206,10 +206,15 @@ igt_main
>  				    "it" },
>  	};
>  	struct rmfb_data data = {};
> -	int i;
> +	int i, other_fd;
> 
>  	igt_fixture {
>  		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
> +		/*
> +		 * Prevent fb from changing underneath so we can check by
> +		 * fb_id == 0 after removing the fb
> +		 */
> +		other_fd = drm_reopen_driver(data.drm_fd);
> 
>  		kmstest_set_vt_graphics_mode();
> 
> @@ -227,5 +232,6 @@ igt_main
>  	igt_fixture {
>  		igt_display_fini(&data.display);
>  		drm_close_driver(data.drm_fd);
> +		drm_close_driver(other_fd);
>  	}
>  }
> --
> 2.46.1



More information about the igt-dev mailing list