All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mika Kahola <mika.kahola@intel.com>
To: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>,
	igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 7/9] tests/kms_rotation_crc: Always run the flip tests when available.
Date: Tue, 06 Feb 2018 13:39:01 +0200	[thread overview]
Message-ID: <1517917141.2602.64.camel@intel.com> (raw)
In-Reply-To: <20180201153914.74639-8-maarten.lankhorst@linux.intel.com>

On Thu, 2018-02-01 at 16:39 +0100, Maarten Lankhorst wrote:
> The -flip tests are the same, but with a pageflip at the end,
> since the test is otherwise the same, run the test once with flips
> always enabled when possible.
> 

Reviewed-by: Mika Kahola <mika.kahola@intel.com>

> Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> ---
>  tests/kms_rotation_crc.c | 106 +++++++++++++++--------------------
> ------------
>  1 file changed, 34 insertions(+), 72 deletions(-)
> 
> diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
> index 70eb6d24b466..cc1a9bfe655e 100644
> --- a/tests/kms_rotation_crc.c
> +++ b/tests/kms_rotation_crc.c
> @@ -43,7 +43,6 @@ typedef struct {
>  	int pos_y;
>  	uint32_t override_fmt;
>  	uint64_t override_tiling;
> -	bool flips;
>  	int devid;
>  } data_t;
>  
> @@ -260,7 +259,7 @@ static void prepare_fbs(data_t *data,
> igt_output_t *output,
>  	/*
>  	 * Create a reference software rotated flip framebuffer.
>  	 */
> -	if (data->flips) {
> +	if (plane->type == DRM_PLANE_TYPE_PRIMARY || display-
> >is_atomic) {
>  		igt_create_fb(data->gfx_fd, ref_w, ref_h,
> pixel_format, tiling,
>  			      &data->fb_flip);
>  		paint_squares(data, data->rotation, &data->fb_flip,
> @@ -272,6 +271,15 @@ static void prepare_fbs(data_t *data,
> igt_output_t *output,
>  				    display->is_atomic ?
>  				    COMMIT_ATOMIC :
> COMMIT_UNIVERSAL);
>  		igt_pipe_crc_collect_crc(data->pipe_crc, &data-
> >flip_crc);
> +
> +		/*
> +		 * Prepare the non-rotated flip fb.
> +		 */
> +		igt_remove_fb(data->gfx_fd, &data->fb_flip);
> +		igt_create_fb(data->gfx_fd, w, h, pixel_format,
> tiling,
> +			      &data->fb_flip);
> +		paint_squares(data, IGT_ROTATION_0, &data->fb_flip,
> +			      flip_opacity);
>  	}
>  
>  	/*
> @@ -308,18 +316,6 @@ static void prepare_fbs(data_t *data,
> igt_output_t *output,
>  
>  	if (plane->type != DRM_PLANE_TYPE_CURSOR)
>  		igt_plane_set_position(plane, data->pos_x, data-
> >pos_y);
> -
> -	/*
> -	 * Prepare the non-rotated flip fb.
> -	 */
> -	if (data->flips) {
> -		igt_remove_fb(data->gfx_fd, &data->fb_flip);
> -		igt_create_fb(data->gfx_fd, w, h, pixel_format,
> tiling,
> -			      &data->fb_flip);
> -		paint_squares(data, IGT_ROTATION_0, &data->fb_flip,
> -			      flip_opacity);
> -	}
> -
>  }
>  
>  static void cleanup_crtc(data_t *data, igt_output_t *output,
> igt_plane_t *plane)
> @@ -378,9 +374,6 @@ static void test_plane_rotation(data_t *data, int
> plane_type, bool test_bad_form
>  	enum igt_commit_style commit = COMMIT_LEGACY;
>  	int ret;
>  
> -	if (data->flips && plane_type != DRM_PLANE_TYPE_PRIMARY)
> -		igt_require(data->display.is_atomic);
> -
>  	if (plane_type == DRM_PLANE_TYPE_PRIMARY || plane_type ==
> DRM_PLANE_TYPE_CURSOR)
>  		commit = COMMIT_UNIVERSAL;
>  
> @@ -439,7 +432,7 @@ static void test_plane_rotation(data_t *data, int
> plane_type, bool test_bad_form
>  			 * If flips are requested flip to a
> different fb and
>  			 * check CRC against that one as well.
>  			 */
> -			if (data->flips) {
> +			if (data->fb_flip.fb_id) {
>  				igt_plane_set_fb(plane, &data-
> >fb_flip);
>  				if (data->rotation ==
> IGT_ROTATION_90 || data->rotation == IGT_ROTATION_270)
>  					igt_plane_set_size(plane,
> data->fb.height, data->fb.width);
> @@ -688,63 +681,37 @@ static const char *tiling_test_str(uint64_t
> tiling)
>  	}
>  }
>  
> -static const char *flip_test_str(unsigned flips)
> -{
> -	if (flips)
> -		return "-flip";
> -	else
> -		return "";
> -}
> -
>  igt_main
>  {
>  	struct rot_subtest {
>  		unsigned plane;
>  		igt_rotation_t rot;
> -		bool flips;
>  	} *subtest, subtests[] = {
> -		{ DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_90, 0 },
> -		{ DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_180, 0 },
> -		{ DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_270, 0 },
> -		{ DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_90, 1 },
> -		{ DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_180, 1 },
> -		{ DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_270, 1 },
> -		{ DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_90, 0 },
> -		{ DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_180, 0 },
> -		{ DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_270, 0 },
> -		{ DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_90, 1 },
> -		{ DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_180, 1 },
> -		{ DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_270, 1 },
> -		{ DRM_PLANE_TYPE_CURSOR, IGT_ROTATION_180, 0 },
> -		{ 0, 0, 0}
> +		{ DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_90 },
> +		{ DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_180 },
> +		{ DRM_PLANE_TYPE_PRIMARY, IGT_ROTATION_270 },
> +		{ DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_90 },
> +		{ DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_180 },
> +		{ DRM_PLANE_TYPE_OVERLAY, IGT_ROTATION_270 },
> +		{ DRM_PLANE_TYPE_CURSOR, IGT_ROTATION_180 },
> +		{ 0, 0}
>  	};
>  
>  	struct reflect_x {
>  		uint64_t tiling;
>  		igt_rotation_t rot;
> -		bool flips;
>  	} *reflect_x, reflect_x_subtests[] = {
> -		{ LOCAL_I915_FORMAT_MOD_X_TILED, IGT_ROTATION_0, 0
> },
> -		{ LOCAL_I915_FORMAT_MOD_X_TILED, IGT_ROTATION_180, 0
> },
> -		{ LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_0, 0
> },
> -		{ LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_90, 0
> },
> -		{ LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_180, 0
> },
> -		{ LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_270, 0
> },
> -		{ LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_0, 0
> },
> -		{ LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_90, 0
> },
> -		{ LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_180,
> 0 },
> -		{ LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_270,
> 0 },
> -		{ LOCAL_I915_FORMAT_MOD_X_TILED, IGT_ROTATION_0, 1
> },
> -		{ LOCAL_I915_FORMAT_MOD_X_TILED, IGT_ROTATION_180, 1
> },
> -		{ LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_0, 1
> },
> -		{ LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_90, 1
> },
> -		{ LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_180, 1
> },
> -		{ LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_270, 1
> },
> -		{ LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_0, 1
> },
> -		{ LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_90, 1
> },
> -		{ LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_180,
> 1 },
> -		{ LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_270,
> 1 },
> -		{ 0, 0, 0 }
> +		{ LOCAL_I915_FORMAT_MOD_X_TILED, IGT_ROTATION_0 },
> +		{ LOCAL_I915_FORMAT_MOD_X_TILED, IGT_ROTATION_180 },
> +		{ LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_0 },
> +		{ LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_90 },
> +		{ LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_180 },
> +		{ LOCAL_I915_FORMAT_MOD_Y_TILED, IGT_ROTATION_270 },
> +		{ LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_0 },
> +		{ LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_90 },
> +		{ LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_180
> },
> +		{ LOCAL_I915_FORMAT_MOD_Yf_TILED, IGT_ROTATION_270
> },
> +		{ 0, 0 }
>  	};
>  
>  	data_t data = {};
> @@ -765,19 +732,16 @@ igt_main
>  	}
>  
>  	for (subtest = subtests; subtest->rot; subtest++) {
> -		igt_subtest_f("%s-rotation-%s%s",
> +		igt_subtest_f("%s-rotation-%s",
>  			      plane_test_str(subtest->plane),
> -			      rot_test_str(subtest->rot),
> -			      flip_test_str(subtest->flips)) {
> +			      rot_test_str(subtest->rot)) {
>  			igt_require(!(subtest->rot &
>  				    (IGT_ROTATION_90 |
> IGT_ROTATION_270)) ||
>  				    gen >= 9);
>  			data.rotation = subtest->rot;
> -			data.flips = subtest->flips;
>  			test_plane_rotation(&data, subtest->plane,
> false);
>  		}
>  	}
> -	data.flips = 0;
>  
>  	igt_subtest_f("sprite-rotation-90-pos-100-0") {
>  		igt_require(gen >= 9);
> @@ -826,16 +790,14 @@ igt_main
>  	}
>  
>  	for (reflect_x = reflect_x_subtests; reflect_x->tiling;
> reflect_x++) {
> -		igt_subtest_f("primary-%s-reflect-x-%s%s",
> +		igt_subtest_f("primary-%s-reflect-x-%s",
>  			      tiling_test_str(reflect_x->tiling),
> -			      rot_test_str(reflect_x->rot),
> -			      flip_test_str(reflect_x->flips)) {
> +			      rot_test_str(reflect_x->rot)) {
>  			igt_require(gen >= 10 ||
>  				    (IS_CHERRYVIEW(data.devid) &&
> reflect_x->rot == IGT_ROTATION_0
>  				     && reflect_x->tiling ==
> LOCAL_I915_FORMAT_MOD_X_TILED));
>  			data.rotation = (IGT_REFLECT_X | reflect_x-
> >rot);
>  			data.override_tiling = reflect_x->tiling;
> -			data.flips = reflect_x->flips;
>  			test_plane_rotation(&data,
> DRM_PLANE_TYPE_PRIMARY, false);
>  		}
>  	}
-- 
Mika Kahola - Intel OTC

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2018-02-06 11:39 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-01 15:39 [igt-dev] [PATCH i-g-t 0/9] tests: Cleanups and NV12 preparations Maarten Lankhorst
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 1/9] tests/kms_panel_fitting: Remove dead code Maarten Lankhorst
2018-02-05 10:50   ` Mika Kahola
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 2/9] tests/kms_atomic: Add the test for CRTC_ID/FB_ID mismatch Maarten Lankhorst
2018-02-05 10:53   ` Mika Kahola
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 3/9] tests/kms_plane_scaling: Test all pixel formats in pipe-*-scaler-with-rotation Maarten Lankhorst
2018-02-05 11:14   ` Mika Kahola
2018-02-05 11:15     ` Mika Kahola
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 4/9] tests/kms_plane_scaling: Test all pixel formats with clamping and clipping too Maarten Lankhorst
2018-02-05 11:47   ` Mika Kahola
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 5/9] tests/kms_rotation_crc: Fix bad-tiling testcase Maarten Lankhorst
2018-02-06 10:50   ` Mika Kahola
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 6/9] tests/kms_rotation_crc: Move bad_format parameter to test_plane_rotation Maarten Lankhorst
2018-02-06 10:57   ` Mika Kahola
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 7/9] tests/kms_rotation_crc: Always run the flip tests when available Maarten Lankhorst
2018-02-06 11:39   ` Mika Kahola [this message]
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 8/9] tests/kms_rotation_crc: Remove primary-rotation-90-Y-tiled Maarten Lankhorst
2018-02-06 13:01   ` Mika Kahola
2018-02-01 15:39 ` [igt-dev] [PATCH i-g-t 9/9] tests/kms_rotation_crc: Perform lazy cleanup and require atomic Maarten Lankhorst
2018-02-07  8:55   ` Mika Kahola
2018-02-07  9:46     ` Maarten Lankhorst
2018-02-07 10:37       ` Mika Kahola
2018-02-01 16:04 ` [igt-dev] ✓ Fi.CI.BAT: success for tests: Cleanups and NV12 preparations Patchwork
2018-02-01 19:07 ` [igt-dev] ✗ Fi.CI.IGT: warning " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1517917141.2602.64.camel@intel.com \
    --to=mika.kahola@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=maarten.lankhorst@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.