[Intel-gfx] [PATCH i-g-t] kms_universal_plane: Check for cursor fb leaks

Chris Wilson chris at chris-wilson.co.uk
Fri Feb 27 01:46:46 PST 2015


On Thu, Feb 26, 2015 at 07:00:19PM -0800, Matt Roper wrote:
> We've been leaking the framebuffers that get created inside the
> legacy -> universal cursor compatibility layer and nobody noticed.  Add
> an i-g-t test to check debugfs and ensure we end up the same number of
> framebuffers we started with after performing cursor operations.
> 
> +	/*
> +	 * Exercise both legacy and universal code paths.  Note that legacy
> +	 * handling in the kernel redirects through universal codepaths
> +	 * internally, so that redirection is where we're most worried about
> +	 * leaking.
> +	 */
> +	for (i = 0; i < 10; i++) {
> +		igt_plane_set_fb(cursor, &cursor_fb[i]);
> +		igt_display_commit2(display, COMMIT_UNIVERSAL);
> +	}
> +	for (i = 0; i < 10; i++) {
> +		igt_plane_set_fb(cursor, &cursor_fb[i]);
> +		igt_display_commit2(display, COMMIT_LEGACY);
> +	}

Oh, magic igt. The comment had me searching for how COMMIT_UNIVERSAL
triggered DRM_MODE_CURSOR_BO - it took me a while to spot you had two
loops! I think it would be better to split these tests up (or at
least mix the combinations of universal | legacy) to have finer grained
tests in case something does go wrong again in the future.

Another useful test (that maybe xfail for a while) is to check that the
active cursor (and other planes) are cleared after close(fd).
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list