[PATCH v2 5/5] lib/igt_gt: Stop passing fd == -1 in igt_open_forcewake_handle()

Ville Syrjälä ville.syrjala at linux.intel.com
Tue Sep 24 08:25:39 UTC 2024


On Mon, Sep 23, 2024 at 05:11:46PM -0500, Lucas De Marchi wrote:
> If something like -1 is needed, then
> igt_open_forcewake_handle_for_pcidev() should be used.
> 
> Signed-off-by: Lucas De Marchi <lucas.demarchi at intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala at linux.intel.com>

> ---
>  lib/igt_gt.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/igt_gt.c b/lib/igt_gt.c
> index c9fd9164f..ba4163c97 100644
> --- a/lib/igt_gt.c
> +++ b/lib/igt_gt.c
> @@ -493,6 +493,7 @@ void igt_stop_hang_helper(void)
>  
>  /**
>   * igt_open_forcewake_handle:
> + * @fd: drm fd - i915 or xe
>   *
>   * This functions opens the debugfs forcewake file and so prevents the GT from
>   * suspending. The reference is automatically dropped when the is closed.
> @@ -509,8 +510,10 @@ int igt_open_forcewake_handle(int fd)
>  
>  	if (is_xe_device(fd))
>  		fn = "forcewake_all";
> -	else
> +	else if (is_i915_device(fd))
>  		fn = "i915_forcewake_user";
> +	else
> +		return -1;
>  
>  	return igt_debugfs_open(fd, fn, O_RDONLY);
>  }
> -- 
> 2.46.1

-- 
Ville Syrjälä
Intel


More information about the igt-dev mailing list