mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-21 13:23:02 +00:00
kmstest: Fix up lifetimes of cairo objects
cairo_t is the short lived drawing context, whereas cairo_surface_t is the heavyweight object that persists and is also tied to underlying GEM objects. So make the kmstest API reflect the different weights and fix the lifetime and underlying object reference leaks. Based on the fix by Paulo Zanoni. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
+2
-2
@@ -55,8 +55,6 @@ static int paint_fb(struct kmstest_fb *fb, const char *test_name,
|
||||
cairo_t *cr;
|
||||
|
||||
cr = kmstest_get_cairo_ctx(drm_fd, fb);
|
||||
if (!cr)
|
||||
return -1;
|
||||
|
||||
kmstest_paint_color_gradient(cr, 0, 0, fb->width, fb->height, 1, 1, 1);
|
||||
kmstest_paint_test_pattern(cr, fb->width, fb->height);
|
||||
@@ -69,6 +67,8 @@ static int paint_fb(struct kmstest_fb *fb, const char *test_name,
|
||||
kmstest_cairo_printf_line(cr, align_hcenter, 10, "%s", mode_format_str);
|
||||
kmstest_cairo_printf_line(cr, align_hcenter, 10, "%s", cconf_str);
|
||||
|
||||
cairo_destroy(cr);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user