public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Kunal Joshi <kunal1.joshi@intel.com>
To: Petri Latvala <petri.latvala@intel.com>, igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t] tests/kms_chamelium: Add support to validate YUV pixel formats
Date: Thu, 5 Mar 2020 14:03:14 +0530	[thread overview]
Message-ID: <20200305083313.GA4267@intel.com> (raw)
In-Reply-To: <20200305115433.GS3839@platvala-desk.ger.corp.intel.com>

On 2020-03-05 at 13:54:33 +0200, Petri Latvala wrote:
> On Wed, Mar 04, 2020 at 05:48:15PM +0530, 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)
> > +			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++) {
> > +
> > +				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;
> 
> Can you structure this if statement in another way? if-inside-an-if or
> convert !(a && b) to (!a || !b). I had to read it three times and then
> open it in an editor to help me see what parens are what and how much
> that ! negates.
> 
> 
Thanks petri for the comment
I have addressed your comment in the new patch series
> -- 
> Petri Latvala
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  reply	other threads:[~2020-03-05 15:31 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 ` [igt-dev] [PATCH i-g-t] " Sharma, Swati2
2020-03-05 11:54 ` Petri Latvala
2020-03-05  8:33   ` Kunal Joshi [this message]
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=20200305083313.GA4267@intel.com \
    --to=kunal1.joshi@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --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