Skip to contentSkip to conversation

lib/igt_draw: Fix bo leak in gpu draw routines

PATCH In review Maarten Lankhorst 3 participants 4 messages Feb 28, 2018 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 lib/igt_draw: Fix bo leak in gpu draw routines

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!

---
 lib/igt_draw.c | 3 +++
 1 file changed, 3 insertions(+)
lib/igt_draw.c +3 -0
index 8f8238292fb5..4c2b0fd9925f 100644
@@ -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);
 }
 
Signature · 6 lines
2.16.2

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Reviewed-by on v1 1/1
#1 lore raw

Quoting Maarten Lankhorst (2018-02-28 09:14:03)

Quoted 7 lines

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!

3 gem_handle_to_libdrm_bo, 3 unrefs.

-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#2 lore raw

Op 28-02-18 om 10:22 schreef Chris Wilson:

Quoted 11 lines

Quoting Maarten Lankhorst (2018-02-28 09:14:03)

Quoted 7 lines

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!

3 gem_handle_to_libdrm_bo, 3 unrefs.

-Chris

Thanks, pushed. :)

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev

#3 lore raw

[igt-dev] ✗ Fi.CI.BAT: failure for lib/igt_draw: Fix bo leak in gpu draw routines

In reply to Maarten Lankhorst
== Series Details ==

== Series Details ==

Series: lib/igt_draw: Fix bo leak in gpu draw routines
URL : https://patchwork.freedesktop.org/series/39096/
State : failure

== Summary ==

Series 39096 revision 1 was fully merged or fully failed: no git log

_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev