[igt-dev] [PATCH i-g-t 5/5] tests/kms_chv_cursor_fail: Handle cleanup better.
Maarten Lankhorst
maarten.lankhorst at linux.intel.com
Wed Mar 14 11:20:21 UTC 2018
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);
- 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
More information about the igt-dev
mailing list