[igt-dev] [PATCH i-g-t 5/9] tests/kms_rotation_crc: Fix bad-tiling testcase.

Mika Kahola mika.kahola at intel.com
Tue Feb 6 10:50:12 UTC 2018


On Thu, 2018-02-01 at 16:39 +0100, Maarten Lankhorst wrote:
> bad-tiling test didn't work, LOCAL_DRM_FORMAT_MODE_NONE == 0, so
> the fb was created with tiling = Y, but because test_bad_format
> was set but override_tiling wasn't, we fell through to the success
> case. Always assume failure if test_bad_format is set, and pass X
> tiled for fb, so the format override works.
> 
> Also clear variables after subtests in main, so if the next subtest
> doesn't run we still clear the variables.
> 

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

> Signed-off-by: Maarten Lankhorst <maarten.lankhorst at linux.intel.com>
> ---
>  tests/kms_rotation_crc.c | 12 +++++++-----
>  1 file changed, 7 insertions(+), 5 deletions(-)
> 
> diff --git a/tests/kms_rotation_crc.c b/tests/kms_rotation_crc.c
> index f65562bae9eb..c402da068ae0 100644
> --- a/tests/kms_rotation_crc.c
> +++ b/tests/kms_rotation_crc.c
> @@ -423,7 +423,7 @@ static void __test_plane_rotation(data_t *data,
> int plane_type, bool test_bad_fo
>  				igt_plane_set_size(plane, data-
> >fb.height, data->fb.width);
>  
>  			ret = igt_display_try_commit2(display,
> commit);
> -			if (test_bad_format && (data->override_fmt
> || data->override_tiling)) {
> +			if (test_bad_format) {
>  				igt_assert_eq(ret, -EINVAL);
>  				continue;
>  			}
> @@ -787,6 +787,7 @@ igt_main
>  			test_plane_rotation(&data, subtest->plane);
>  		}
>  	}
> +	data.flips = 0;
>  
>  	igt_subtest_f("sprite-rotation-90-pos-100-0") {
>  		igt_require(gen >= 9);
> @@ -795,23 +796,24 @@ igt_main
>  		data.pos_y = 0;
>  		test_plane_rotation(&data, DRM_PLANE_TYPE_OVERLAY);
>  	}
> +	data.pos_x = 0,
> +	data.pos_y = 0;
>  
>  	igt_subtest_f("bad-pixel-format") {
>  		igt_require(gen >= 9);
> -		data.pos_x = 0,
> -		data.pos_y = 0;
>  		data.rotation = IGT_ROTATION_90;
>  		data.override_fmt = DRM_FORMAT_RGB565;
>  		test_bad_plane_rotation(&data,
> DRM_PLANE_TYPE_PRIMARY);
>  	}
> +	data.override_fmt = 0;
>  
>  	igt_subtest_f("bad-tiling") {
>  		igt_require(gen >= 9);
> -		data.override_fmt = 0;
>  		data.rotation = IGT_ROTATION_90;
> -		data.override_tiling = LOCAL_DRM_FORMAT_MOD_NONE;
> +		data.override_tiling =
> LOCAL_I915_FORMAT_MOD_X_TILED;
>  		test_bad_plane_rotation(&data,
> DRM_PLANE_TYPE_PRIMARY);
>  	}
> +	data.override_tiling = 0;
>  
>  	igt_subtest_f("primary-rotation-90-Y-tiled") {
>  		enum pipe pipe;
-- 
Mika Kahola - Intel OTC



More information about the igt-dev mailing list