[igt-dev] [i-g-t] tests/i915/kms_draw_crc: Create separate subtest for each draw method

Karthik B S karthik.b.s at intel.com
Fri Feb 10 03:23:47 UTC 2023


On 2/9/2023 4:14 PM, Bhanuprakash Modem wrote:
> Instead of clubbing all draw methods, have a separate subtest for
> each draw method.
>
> Fixes: 9e71c27c6 (tests/i915/kms_draw_crc: Convert tests to dynamic)
> Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem at intel.com>

LGTM,

Reviewed-by: Karthik B S <karthik.b.s at intel.com>

> ---
>   tests/i915/kms_draw_crc.c | 29 ++++++++++-------------------
>   1 file changed, 10 insertions(+), 19 deletions(-)
>
> diff --git a/tests/i915/kms_draw_crc.c b/tests/i915/kms_draw_crc.c
> index 64d3b937e..701de8ecb 100644
> --- a/tests/i915/kms_draw_crc.c
> +++ b/tests/i915/kms_draw_crc.c
> @@ -286,32 +286,23 @@ igt_main
>   	igt_fixture
>   		setup_environment();
>   
> -	igt_describe("This subtest verfies igt_draw library works "
> -		     "with different modifiers, DRM_FORMATS, DRAW_METHODS.");
> -	igt_subtest_with_dynamic("draw-method") {
> -		for (format_idx = 0; format_idx < ARRAY_SIZE(formats); format_idx++) {
> -			/* 10-bit & 16-bit formats are bit slow, ignore in pre-si. */
> -			if (igt_run_in_simulation() &&
> -			    formats[format_idx] != DRM_FORMAT_XRGB8888)
> -				continue;
> -
> -			for (method = 0; method < IGT_DRAW_METHOD_COUNT; method++) {
> +	for (method = 0; method < IGT_DRAW_METHOD_COUNT; method++) {
> +		igt_describe_f("Verify that igt draw library works for the draw "
> +			       "method (%s) with different modifiers & DRM formats.",
> +			       igt_draw_get_method_name(method));
> +		igt_subtest_with_dynamic_f("draw-method-%s", igt_draw_get_method_name(method)) {
> +			igt_skip_on(method == IGT_DRAW_MMAP_WC && !gem_mmap__has_wc(drm_fd));
> +			igt_skip_on(method == IGT_DRAW_MMAP_GTT && !gem_has_mappable_ggtt(drm_fd));
> +
> +			for (format_idx = 0; format_idx < ARRAY_SIZE(formats); format_idx++) {
>   				for (modifier_idx = 0; modifier_idx < ARRAY_SIZE(modifiers); modifier_idx++) {
>   					modifier = modifiers[modifier_idx];
>   
>   					if (!igt_display_has_format_mod(&display, formats[format_idx], modifier))
>   						continue;
>   
> -					if (method == IGT_DRAW_MMAP_WC && !gem_mmap__has_wc(drm_fd))
> -						continue;
> -
> -					if (method == IGT_DRAW_MMAP_GTT &&
> -					    !gem_has_mappable_ggtt(drm_fd))
> -						continue;
> -
> -					igt_dynamic_f("%s-%s-%s",
> +					igt_dynamic_f("%s-%s",
>   						      format_str(format_idx),
> -						      igt_draw_get_method_name(method),
>   						      modifier_str(modifier_idx))
>   						draw_method_subtest(method, format_idx,
>   								    modifier);


More information about the igt-dev mailing list