[igt-dev] [i-g-t 00/45] Add IGT display support for XE

Zbigniew Kempczyński zbigniew.kempczynski at intel.com
Wed Apr 19 16:19:23 UTC 2023


On Wed, Apr 19, 2023 at 05:27:24PM +0530, Modem, Bhanuprakash wrote:
<cut>

> @Zbigniew, How about moving xe_device_get() to drm_open_driver()?
> So that, no need to call xe_device_get() in test level.
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -601,6 +601,9 @@ int drm_open_driver(int chipset)
>                 }
>         }
> 
> +       if (is_xe_device(fd))
> +               xe_device_get(fd);
> +
>         return fd;
>  }
> 
> Ofcourse we need some efforts to handle xe_device_put():
> 1- Create a new helper maybe drm_close(fd)
> 	drm_close(int fd) {
> 		if (is_xe_device(fd))
> 			xe_device_put(fd);
> 
> 		close(fd);
> 	}
> 2- Update both kms & gem tests to use s/close(fd)/drm_close(fd)/
> 
> - Bhanu
> 

I got no strong preference to call this helper but if you plan to
do so I think  __drm_open_driver_another() is better place to put
this into. I mean with using filters you can omit drm_open_driver().
And yes, drm_close() might need to be added also to call freeing
helper.

Just try out, let's see what will happen on CI. I don't think
you'll regress i915, only xe path may need some tweaks.

--
Zbigniew


More information about the igt-dev mailing list