[igt-dev] [PATCH i-g-t] lib/drmtest: Don't write ffffffff to a numeric param

Chris Wilson chris at chris-wilson.co.uk
Wed Jun 10 11:33:48 UTC 2020


Quoting Petri Latvala (2020-06-10 11:33:56)
> __cancel_work_at_exit writes -1 to param "reset", with the intention
> that it's "any available method". Hex values to numeric params should
> be prefixed with 0x to be parsed as a number. Use the convention of %u
> with -1 as is used elsewhere with the "reset" param.
> 
> Signed-off-by: Petri Latvala <petri.latvala at intel.com>
> ---
>  lib/drmtest.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/drmtest.c b/lib/drmtest.c
> index e4e710d4..c732d1dd 100644
> --- a/lib/drmtest.c
> +++ b/lib/drmtest.c
> @@ -478,7 +478,7 @@ static void __cancel_work_at_exit(int fd)
>  {
>         igt_terminate_spins(); /* for older kernels */
>  
> -       igt_params_set(fd, "reset", "%x", -1u /* any method */);
> +       igt_params_set(fd, "reset", "%u", -1u /* any method */);
>         igt_drop_caches_set(fd,
>                             /* cancel everything */
>                             DROP_RESET_ACTIVE | DROP_RESET_SEQNO |

Might explain why it seems like we ended up with reset=0 so frequently.
Reviewed-by: Chris Wilson <chris at chris-wilson.co.uk>
-Chris


More information about the igt-dev mailing list