[igt-dev] [PATCH i-g-t] lib/igt_draw: Fix bo leak in gpu draw routines

Maarten Lankhorst maarten.lankhorst at linux.intel.com
Wed Feb 28 09:14:03 UTC 2018


gem_handle_to_libdrm_bo creates a new handle through the use of flink,
which makes kms_frontbuffer_tracking through a single run not complete
when it starts leaking 50MB objects. Add the missing bo_unref to kill
the duplicated handle and fix the leaks!

Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
Cc: Chris Wilson <chris at chris-wilson.co.uk>
---
 lib/igt_draw.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 8f8238292fb5..4c2b0fd9925f 100644
--- a/lib/igt_draw.c
+++ b/lib/igt_draw.c
@@ -557,6 +557,7 @@ static void draw_rect_blt(int fd, struct cmd_data *cmd_data,
 
 	intel_batchbuffer_flush(batch);
 	intel_batchbuffer_free(batch);
+	drm_intel_bo_unreference(dst);
 }
 
 static void draw_rect_render(int fd, struct cmd_data *cmd_data,
@@ -624,6 +625,8 @@ static void draw_rect_render(int fd, struct cmd_data *cmd_data,
 		   rect->h, &dst_buf, adjusted_dst_x, rect->y);
 
 	intel_batchbuffer_free(batch);
+	drm_intel_bo_unreference(src);
+	drm_intel_bo_unreference(dst);
 	gem_close(fd, tmp.handle);
 }
 
-- 
2.16.2



More information about the igt-dev mailing list