public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Sharma, Swati2" <swati2.sharma@intel.com>
To: Kunal Joshi <kunal1.joshi@intel.com>, igt-dev@lists.freedesktop.org
Cc: petri.latvala@intel.com
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_chamelium: Add support to validate YUV pixel formats
Date: Thu, 5 Mar 2020 11:51:21 +0530	[thread overview]
Message-ID: <9a06c2b1-798f-5335-6d24-883fca4558b4@intel.com> (raw)
In-Reply-To: <1583324295-22013-1-git-send-email-kunal1.joshi@intel.com>

Hi Kunal,

Can we rewrite subtests for rgb pixel formats too in the same fashion as 
you did for yuv?

On 04-Mar-20 5:48 PM, Kunal Joshi wrote:
> Currently, only hard coded pixel formats are validated which are not
> generic for all the platforms which leads to false alarms.
> Added support to validate only those pixel formats which are supported
> by platform.
> 
> Signed-off-by: Kunal Joshi <kunal1.joshi@intel.com>
> ---
>   tests/kms_chamelium.c | 70 +++++++++++++++++++++++----------------------------
>   1 file changed, 32 insertions(+), 38 deletions(-)
> 
> diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
> index 5c4a189..d6d63c6 100644
> --- a/tests/kms_chamelium.c
> +++ b/tests/kms_chamelium.c
> @@ -2612,6 +2612,14 @@ static const struct edid *get_edid(enum test_edid edid)
>   			if (chamelium_port_get_type(port) == \
>   			    DRM_MODE_CONNECTOR_ ## type__)
>   
> +#define connector_subtest_start(name__, type__)              \
> +	igt_subtest_with_dynamic(name__)                     \
> +		for_each_port(p, port)                       \
> +			if (chamelium_port_get_type(port) == \
> +			    DRM_MODE_CONNECTOR_ ## type__) {
> +
> +#define connector_subtest_end }
> +
>   static data_t data;
>   
>   IGT_TEST_DESCRIPTION("Tests requiring a Chamelium board");
> @@ -2872,44 +2880,30 @@ igt_main
>   						   CHAMELIUM_CHECK_CRC);
>   
>   		igt_describe(test_display_one_mode_desc);
> -		connector_subtest("hdmi-cmp-nv12", HDMIA)
> -			test_display_one_mode(&data, port, DRM_FORMAT_NV12,
> -					      CHAMELIUM_CHECK_CHECKERBOARD, 1);
> -
> -		igt_describe(test_display_one_mode_desc);
> -		connector_subtest("hdmi-cmp-nv16", HDMIA)
> -			test_display_one_mode(&data, port, DRM_FORMAT_NV16,
> -					      CHAMELIUM_CHECK_CHECKERBOARD, 1);
> -
> -		igt_describe(test_display_one_mode_desc);
> -		connector_subtest("hdmi-cmp-nv21", HDMIA)
> -			test_display_one_mode(&data, port, DRM_FORMAT_NV21,
> -					      CHAMELIUM_CHECK_CHECKERBOARD, 1);
> -
> -		igt_describe(test_display_one_mode_desc);
> -		connector_subtest("hdmi-cmp-nv61", HDMIA)
> -			test_display_one_mode(&data, port, DRM_FORMAT_NV61,
> -					      CHAMELIUM_CHECK_CHECKERBOARD, 1);
> -
> -		igt_describe(test_display_one_mode_desc);
> -		connector_subtest("hdmi-cmp-yu12", HDMIA)
> -			test_display_one_mode(&data, port, DRM_FORMAT_YUV420,
> -					      CHAMELIUM_CHECK_CHECKERBOARD, 1);
> -
> -		igt_describe(test_display_one_mode_desc);
> -		connector_subtest("hdmi-cmp-yu16", HDMIA)
> -			test_display_one_mode(&data, port, DRM_FORMAT_YUV422,
> -					      CHAMELIUM_CHECK_CHECKERBOARD, 1);
> -
> -		igt_describe(test_display_one_mode_desc);
> -		connector_subtest("hdmi-cmp-yv12", HDMIA)
> -			test_display_one_mode(&data, port, DRM_FORMAT_YVU420,
> -					      CHAMELIUM_CHECK_CHECKERBOARD, 1);
> -
> -		igt_describe(test_display_one_mode_desc);
> -		connector_subtest("hdmi-cmp-yv16", HDMIA)
> -			test_display_one_mode(&data, port, DRM_FORMAT_YVU422,
> -					      CHAMELIUM_CHECK_CHECKERBOARD, 1);
> +		connector_subtest_start("hdmi-yuv", HDMIA)
Can we name test format like hdmi-yuv-format ?
> +			int k;
> +			igt_output_t *output;
> +			igt_plane_t *primary;
> +
> +			output = prepare_output(&data, port, TEST_EDID_BASE);
> +			primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> +			igt_assert(primary);
> +
> +			for (k = 0; k < primary->format_mod_count; k++) {
> +
Extra \n?
> +				if (!igt_fb_supported_format(primary->formats[k]))
> +					continue;
> +
> +				if (!(igt_format_is_yuv(primary->formats[k])
> +				   && primary->modifiers[k] != LOCAL_DRM_FORMAT_MOD_NONE))
> +					continue;
Nitpick: Can we but && in first line?
> +
> +				igt_dynamic_f("%c%c%c%c", IGT_FORMAT_ARGS(primary->formats[k]))
> +					test_display_one_mode(&data, port, primary->formats[k],
> +							      CHAMELIUM_CHECK_CHECKERBOARD,
> +							      1);
> +			}
> +		connector_subtest_end
>   
>   		igt_describe(test_display_planes_random_desc);
>   		connector_subtest("hdmi-cmp-planes-random", HDMIA)
> 
Rest look good to me.

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

  parent reply	other threads:[~2020-03-05  6:21 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-04 12:18 [igt-dev] [PATCH i-g-t] tests/kms_chamelium: Add support to validate YUV pixel formats Kunal Joshi
2020-03-04 19:59 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2020-03-05  6:21 ` Sharma, Swati2 [this message]
2020-03-05 11:54 ` [igt-dev] [PATCH i-g-t] " Petri Latvala
2020-03-05  8:33   ` Kunal Joshi
2020-03-05 18:17 ` [igt-dev] ✓ Fi.CI.IGT: success for " 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=9a06c2b1-798f-5335-6d24-883fca4558b4@intel.com \
    --to=swati2.sharma@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=kunal1.joshi@intel.com \
    --cc=petri.latvala@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox