[Intel-gfx] [PATCH v2] kms_atomic : Added subtest for Single Pipe DBUF validation

Chris Wilson chris at chris-wilson.co.uk
Tue Oct 25 10:10:15 UTC 2016


On Tue, Oct 25, 2016 at 02:40:00PM +0530, meghanelogal wrote:
> +	igt_subtest("validate_dbuf") {
> +		int gen;
> +
> +		gen = intel_gen(intel_get_drm_devid(desc.fd));
> +		igt_require(gen >= 9);
> +
> +		struct kms_atomic_state *scratch = atomic_state_dup(current);
> +		struct kms_atomic_crtc_state *crtc = find_crtc(scratch, true);
> +		struct kms_atomic_plane_state *plane;
> +		struct kms_atomic_connector_state *connector =
> +				find_connector(scratch, crtc);
> +		struct kms_atomic_plane_state **plane_array = NULL;
> +		/* Enabling Two planes */
> +		plane_array = calloc(2, sizeof(struct kms_atomic_plane_state *));
> +		int plane_count = 0;
> +
> +		igt_require(crtc);
> +		plane = find_plane(scratch, PLANE_TYPE_PRIMARY, crtc);
> +		igt_require(plane);
> +		plane_array[plane_count] = plane; plane_count++;
> +		plane = find_plane(scratch, PLANE_TYPE_OVERLAY, crtc);
> +		igt_require(plane);
> +		plane_array[plane_count] = plane; plane_count++;
> +		igt_require(connector);
> +		validate_dbuf(crtc, plane_array, plane_count);
> +		atomic_state_free(scratch);

	struct kms_atomic_state *scratch = atomic_state_dup(current);
	struct kms_atomic_crtc_state *crtc;
	struct kms_atomic_plane_state *planes[2];

	crtc = find_crtc(scratch, true);
	igt_require(crtc);

	igt_require(find_connector(scratch, crtc));

	planes[0] = find_plane(scratch, PLANE_TYPE_PRIMARY, crtc);
	igt_require(planes[0]);

	planes[1] = find_plane(scratch, PLANE_TYPE_OVERLAY, crtc);
	igt_require(planes[1]);

	validate_dbuf(crtc, planes, 2);
	atomic_state_free(scratch);

is a bit easier to read.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the Intel-gfx mailing list