[igt-dev] [PATCH i-g-t 3/3] test/kms_fbcon_fbt: Give a explicit parameter name to functions that expect debugfs fd

Pandiyan, Dhinakaran dhinakaran.pandiyan at intel.com
Thu Sep 20 04:59:54 UTC 2018


On Tue, 2018-09-18 at 15:15 -0700, José Roberto de Souza wrote:
> Let's rename to debugfs_fd all the parameters of the functions that
> expect debugfs fd to avoid call one those functions with the wrong
> file descriptor.

I was about to merge the series but noticed fbc_wait_until_enabled(int
fd) was missed.

Can you please fix that along with two other checkpatch errors that the
series has?

WARNING: line over 80 characters
#56: FILE: tests/kms_frontbuffer_tracking.c:1634:
+               igt_assert_f(psr_wait_entry(drm.debugfs), "PSR still
disabled\n");


WARNING: Missing a blank line after declarations
#35: FILE: tests/kms_fbcon_fbt.c:209:
+       bool r = igt_wait(psr_is_enabled(debugfs_fd), 5000, 1);
+       psr_print_status(debugfs_fd);


-DK

> 
> Cc: Dhinakaran Pandiyan <dhinakaran.pandiyan at intel.com>
> Signed-off-by: José Roberto de Souza <jose.souza at intel.com>
> ---
>  tests/kms_fbcon_fbt.c | 22 +++++++++++-----------
>  1 file changed, 11 insertions(+), 11 deletions(-)
> 
> diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c
> index 138eda9b..9869aa14 100644
> --- a/tests/kms_fbcon_fbt.c
> +++ b/tests/kms_fbcon_fbt.c
> @@ -203,34 +203,34 @@ static bool psr_is_enabled(int debugfs_fd)
>  	return strstr(buf, "\nHW Enabled & Active bit: yes\n");
>  }
>  
> -static bool psr_wait_until_enabled(int fd)
> +static bool psr_wait_until_enabled(int debugfs_fd)
>  {
> -	bool r = igt_wait(psr_is_enabled(fd), 5000, 1);
> -	psr_print_status(fd);
> +	bool r = igt_wait(psr_is_enabled(debugfs_fd), 5000, 1);
> +	psr_print_status(debugfs_fd);
>  	return r;
>  }
>  
> -static void disable_features(int fd)
> +static void disable_features(int debugfs_fd)
>  {
>  	igt_set_module_param_int("enable_fbc", 0);
> -	psr_disable(fd);
> +	psr_disable(debugfs_fd);
>  }
>  
> -static inline void fbc_modparam_enable(int fd)
> +static inline void fbc_modparam_enable(int debugfs_fd)
>  {
>  	igt_set_module_param_int("enable_fbc", 1);
>  }
>  
> -static inline void psr_debugfs_enable(int fd)
> +static inline void psr_debugfs_enable(int debugfs_fd)
>  {
> -	psr_enable(fd);
> +	psr_enable(debugfs_fd);
>  }
>  
>  struct feature {
> -	bool (*supported_on_chipset)(int fd);
> -	bool (*wait_until_enabled)(int fd);
> +	bool (*supported_on_chipset)(int debugfs_fd);
> +	bool (*wait_until_enabled)(int debugfs_fd);
>  	bool (*connector_possible_fn)(drmModeConnectorPtr
> connector);
> -	void (*enable)(int fd);
> +	void (*enable)(int debugfs_fd);
>  } fbc = {
>  	.supported_on_chipset = fbc_supported_on_chipset,
>  	.wait_until_enabled = fbc_wait_until_enabled,


More information about the igt-dev mailing list