From aa5068c58947f31252cad69d80686e40bbce29db Mon Sep 17 00:00:00 2001 From: Maarten Lankhorst Date: Fri, 2 Feb 2018 11:00:50 +0100 Subject: tests: Always call igt_remove_fb without checking. This cleans up the tests slightly. Signed-off-by: Maarten Lankhorst Reviewed-by: Mika Kahola Tested-by: Vidya Srinivas --- tests/kms_panel_fitting.c | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) (limited to 'tests/kms_panel_fitting.c') diff --git a/tests/kms_panel_fitting.c b/tests/kms_panel_fitting.c index e0ca6cca..b3cee223 100644 --- a/tests/kms_panel_fitting.c +++ b/tests/kms_panel_fitting.c @@ -51,10 +51,7 @@ static void prepare_crtc(data_t *data, igt_output_t *output, enum pipe pipe, igt_output_set_pipe(output, pipe); /* before allocating, free if any older fb */ - if (data->fb1.fb_id) { - igt_remove_fb(data->drm_fd, &data->fb1); - data->fb1.fb_id = 0; - } + igt_remove_fb(data->drm_fd, &data->fb1); /* allocate fb for plane 1 */ igt_create_pattern_fb(data->drm_fd, @@ -83,14 +80,8 @@ static void cleanup_crtc(data_t *data, igt_output_t *output, igt_plane_t *plane) { igt_display_t *display = &data->display; - if (data->fb1.fb_id) { - igt_remove_fb(data->drm_fd, &data->fb1); - data->fb1.fb_id = 0; - } - if (data->fb2.fb_id) { - igt_remove_fb(data->drm_fd, &data->fb2); - data->fb2.fb_id = 0; - } + igt_remove_fb(data->drm_fd, &data->fb1); + igt_remove_fb(data->drm_fd, &data->fb2); if (plane->type != DRM_PLANE_TYPE_PRIMARY) { igt_plane_t *primary; -- cgit v1.2.3