Re: [PATCH 3/3] lib: make igt_pipe_crc_start never fail

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Dec 06, 2013 at 10:48:44AM +0100, Daniel Vetter wrote:
> It's what callers expect - pipe_crc_new is the function where
> we pass a potential failure back to callers.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@xxxxxxxx>

Oh, yes, initially ono had to specify the point at _start() time, but I
moved it to _new() mid-development and forgot to remove the return
value.

Reviewed-by: Damien Lespiau <damien.lespiau@xxxxxxxxx>

> ---
>  lib/igt_debugfs.c          | 7 ++-----
>  lib/igt_debugfs.h          | 2 +-
>  tests/kms_pipe_crc_basic.c | 2 +-
>  3 files changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
> index 139be893f75b..4b96521331af 100644
> --- a/lib/igt_debugfs.c
> +++ b/lib/igt_debugfs.c
> @@ -269,12 +269,11 @@ void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc)
>  	free(pipe_crc);
>  }
>  
> -bool igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
> +void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
>  {
>  	igt_crc_t *crcs = NULL;
>  
> -	if (!igt_pipe_crc_do_start(pipe_crc))
> -		return false;
> +	igt_assert(igt_pipe_crc_do_start(pipe_crc));
>  
>  	/*
>  	 * For some no yet identified reason, the first CRC is bonkers. So
> @@ -282,8 +281,6 @@ bool igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
>  	 */
>  	igt_pipe_crc_get_crcs(pipe_crc, 1, &crcs);
>  	free(crcs);
> -
> -	return true;
>  }
>  
>  void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc)
> diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
> index 393b5767adbe..075e44625213 100644
> --- a/lib/igt_debugfs.h
> +++ b/lib/igt_debugfs.h
> @@ -75,7 +75,7 @@ igt_pipe_crc_t *
>  igt_pipe_crc_new(igt_debugfs_t *debugfs, int drm_fd, enum pipe pipe,
>  		 enum intel_pipe_crc_source source);
>  void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc);
> -bool igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc);
> +void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc);
>  void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc);
>  void igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
>  			   igt_crc_t **out_crcs);
> diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
> index 90d9b9404877..3fc59344d90d 100644
> --- a/tests/kms_pipe_crc_basic.c
> +++ b/tests/kms_pipe_crc_basic.c
> @@ -180,7 +180,7 @@ static void test_read_crc(data_t *data, int pipe, unsigned flags)
>  			continue;
>  		valid_connectors++;
>  
> -		igt_assert(igt_pipe_crc_start(pipe_crc));
> +		igt_pipe_crc_start(pipe_crc);
>  
>  		/* wait for 3 vblanks and the corresponding 3 CRCs */
>  		igt_pipe_crc_get_crcs(pipe_crc, 3, &crcs);
> -- 
> 1.8.4.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Intel-gfx mailing list
Intel-gfx@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/intel-gfx




[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]
  Powered by Linux