summaryrefslogtreecommitdiff
path: root/lib/igt_draw.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2018-02-28 10:03:47 +0100
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2018-02-28 10:48:38 +0100
commitd3dc9c619791c8cb88d176fc7b3d8aa5e802055d (patch)
treeb793146b90e250138355461e6492879184d1e0c6 /lib/igt_draw.c
parent77411862d239916b40e218eeb6519b8f31fc7f1d (diff)
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! Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Cc: Chris Wilson <chris@chris-wilson.co.uk> Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'lib/igt_draw.c')
-rw-r--r--lib/igt_draw.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/igt_draw.c b/lib/igt_draw.c
index 8f823829..4c2b0fd9 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);
}