[igt-dev] [i-g-t 5/5] lib/igt_kms: Cache xe_device info for kms tests

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Tue Mar 14 11:38:08 UTC 2023


On Tue, Mar 14, 2023 at 04:24:52PM +0530, Bhanuprakash Modem wrote:
> Create or get xe_device data from Cache, so that all KMS tests
> will utilize.
> 
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>
> ---
>  lib/igt_kms.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 84091d5ce..d88863a90 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -59,6 +59,7 @@
>  #include "igt_device.h"
>  #include "igt_sysfs.h"
>  #include "sw_sync.h"
> +#include "xe/xe_query.h"
>  #ifdef HAVE_CHAMELIUM
>  #include "igt_chamelium.h"
>  #endif
> @@ -2541,6 +2542,9 @@ void igt_display_require(igt_display_t *display, int drm_fd)
>  	}
>  #endif
>  
> +	if (is_xe_device(drm_fd))
> +		xe_device_get(drm_fd);
> +

Maybe in the future we will try to use xe_device more explicitly but at
the moment it would require to rewrite almost everything. So for this
change in the library:

Acked-by: Zbigniew Kempczyński <zbigniew.kempczynski at intel.com>

--
Zbigniew

>  	/*
>  	 * With non-contiguous pipes display, crtc mapping is not always same
>  	 * as pipe mapping, In i915 pipe is enum id of i915's crtc object.
> @@ -2889,6 +2893,10 @@ static void igt_output_fini(igt_output_t *output)
>  void igt_display_fini(igt_display_t *display)
>  {
>  	int i;
> +	int drm_fd = display->drm_fd;
> +
> +	if (is_xe_device(drm_fd))
> +		xe_device_put(drm_fd);
>  
>  	for (i = 0; i < display->n_planes; ++i) {
>  		igt_plane_t *plane = &display->planes[i];
> -- 
> 2.39.1
> 


More information about the igt-dev mailing list