[igt-dev] [PATCH i-g-t 5/5] tests/kms_chv_cursor_fail: Handle cleanup better.

Ville Syrjälä ville.syrjala at linux.intel.com
Wed Mar 14 14:48:36 UTC 2018


On Wed, Mar 14, 2018 at 12:20:21PM +0100, Maarten Lankhorst wrote:
> Clean up cursor fb in cleanup_crtc, which means that cursor fb
> has to be created after prepare_crtc() is called.
> 
> This will fix a small leak when a subtest fails.
> 
> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> ---
>  tests/kms_chv_cursor_fail.c | 7 ++-----
>  1 file changed, 2 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/kms_chv_cursor_fail.c b/tests/kms_chv_cursor_fail.c
> index 0dd366c3b4b1..7138e549aeb7 100644
> --- a/tests/kms_chv_cursor_fail.c
> +++ b/tests/kms_chv_cursor_fail.c
> @@ -224,6 +224,7 @@ static void cleanup_crtc(data_t *data)
>  	data->pipe_crc = NULL;
>  
>  	igt_remove_fb(data->drm_fd, &data->primary_fb);
> +	igt_remove_fb(data->drm_fd, &data->fb);
>  }
>  
>  static void prepare_crtc(data_t *data)
> @@ -262,15 +263,11 @@ static void prepare_crtc(data_t *data)
>  
>  static void test_crtc(data_t *data, unsigned int edges)
>  {
> -	cleanup_crtc(data);
> +	prepare_crtc(data);
>  
>  	create_cursor_fb(data, data->curw, data->curh);

4 and 5 lgtm as well

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

>  
> -	prepare_crtc(data);
> -
>  	test_edges(data, edges);
> -
> -	igt_remove_fb(data->drm_fd, &data->fb);
>  }
>  
>  static int opt_handler(int opt, int opt_index, void *_data)
> -- 
> 2.16.2
> 
> _______________________________________________
> igt-dev mailing list
> igt-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev

-- 
Ville Syrjälä
Intel OTC


More information about the igt-dev mailing list