public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ser, Simon" <simon.ser@intel.com>
To: "Hiler, Arkadiusz" <arkadiusz.hiler@intel.com>
Cc: "igt-dev@lists.freedesktop.org" <igt-dev@lists.freedesktop.org>,
	"Peres, Martin" <martin.peres@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t 5/5] tests/kms_chamelium: add an audio EDID test
Date: Mon, 3 Jun 2019 12:56:56 +0000	[thread overview]
Message-ID: <ed51d7a21f9997c428fbc1f1fe9280eb3a7af7f6.camel@intel.com> (raw)
In-Reply-To: <20190531131821.4w6o65jl7n3nqo34@ahiler-desk1.fi.intel.com>

On Fri, 2019-05-31 at 16:18 +0300, Arkadiusz Hiler wrote:
> On Fri, May 31, 2019 at 02:22:00PM +0300, Simon Ser wrote:
> > This test enables a Chamelium port with an audio-friendly EDID, and then checks
> > that the EDID-Like Data exposed by ALSA matches our expectations.
> > 
> > Remove some high sampling rates from get_hdmi_audio_edid, since the Chamelium
> > doesn't support them anyway. This makes the SAD check uniform for all ports.
> > 
> > Signed-off-by: Simon Ser <simon.ser@intel.com>
> > ---
> >  tests/kms_chamelium.c | 69 +++++++++++++++++++++++++++++++++++++++----
> >  1 file changed, 64 insertions(+), 5 deletions(-)
> > 
> > diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
> > index 49c3de0b7beb..16d3a773bb2a 100644
> > --- a/tests/kms_chamelium.c
> > +++ b/tests/kms_chamelium.c
> > @@ -28,6 +28,7 @@
> >  #include "igt.h"
> >  #include "igt_vc4.h"
> >  #include "igt_edid.h"
> > +#include "igt_eld.h"
> >  
> >  #include <fcntl.h>
> >  #include <pthread.h>
> > @@ -1426,6 +1427,60 @@ test_display_audio(data_t *data, struct chamelium_port *port,
> >  	free(alsa);
> >  }
> >  
> > +static void
> > +test_display_audio_edid(data_t *data, struct chamelium_port *port,
> > +			enum test_edid edid)
> > +{
> > +	igt_output_t *output;
> > +	igt_plane_t *primary;
> > +	struct igt_fb fb;
> > +	drmModeModeInfo *mode;
> > +	drmModeConnector *connector;
> > +	int fb_id;
> > +	struct eld_entry eld;
> > +	const char *monitor_name;
> > +	struct eld_sad *sad;
> > +
> > +	reset_state(data, port);
> > +
> > +	output = prepare_output(data, port, edid);
> > +	connector = chamelium_port_get_connector(data->chamelium, port, false);
> > +	primary = igt_output_get_plane_type(output, DRM_PLANE_TYPE_PRIMARY);
> > +	igt_assert(primary);
> > +
> > +	/* Enable the output because audio cannot be played on inactive
> > +	 * connectors. */
> > +	igt_assert(connector->count_modes > 0);
> > +	mode = &connector->modes[0];
> > +
> > +	fb_id = igt_create_color_pattern_fb(data->drm_fd,
> > +					    mode->hdisplay, mode->vdisplay,
> > +					    DRM_FORMAT_XRGB8888,
> > +					    LOCAL_DRM_FORMAT_MOD_NONE,
> > +					    0, 0, 0, &fb);
> > +	igt_assert(fb_id > 0);
> > +
> > +	enable_output(data, port, output, mode, &fb);
> > +
> > +	monitor_name = "IGT";
> > +	if (edid == TEST_EDID_CHAMELIUM_DEFAULT)
> > +		monitor_name = "AthenaDP";
> 
> I am starting to grow less and less fond of using the default
> Chamelium's EDID. This will just make us build up on simillar checks
> over time. Let's just define our own copy and then use values from it
> directly.
> 
> "monitor_name" should probably be named manufacturer_id and be obtained
> by chamelium_get_manufacturer_id(edid_id) or smth.
> 
> And since you were talking about MST in one of the other patches, let's
> talk about MST :-) This would make it more future proof (WIP was
> defining a copy of EDID for each port using manufacturer id in form of
> "I-$CHAM_PORT_ID"). chamelium_get_manufacturer_id() can be extended later
> to also take chamelium_port as parameter.

I now have a patch for another series that adds a DisplayPort EDID
(depends on Speaker Allocation Data blocks, so can't be added to this
one).

> Other than that the series looks good.
> 
> > +
> > +	igt_assert(eld_from_monitor_name(&eld, monitor_name));
> > +	igt_assert(eld.sads_len == 1);
> > +
> > +	sad = &eld.sads[0];
> > +	igt_assert(sad->coding_type == CEA_SAD_FORMAT_PCM);
> > +	igt_assert(sad->channels == 2);
> > +	igt_assert(sad->rates == (CEA_SAD_SAMPLING_RATE_32KHZ |
> > +		   CEA_SAD_SAMPLING_RATE_44KHZ | CEA_SAD_SAMPLING_RATE_48KHZ));
> > +	igt_assert(sad->bits == (CEA_SAD_SAMPLE_SIZE_16 |
> > +		   CEA_SAD_SAMPLE_SIZE_20 | CEA_SAD_SAMPLE_SIZE_24));
> > +
> > +	igt_remove_fb(data->drm_fd, &fb);
> > +
> > +	drmModeFreeConnector(connector);
> > +}
> >  
> >  static void randomize_plane_stride(data_t *data,
> >  				   uint32_t width, uint32_t height,
> > @@ -2005,11 +2060,7 @@ static unsigned const char *get_hdmi_audio_edid(void)
> >  	channels = 2; /* TODO: speaker alloc blocks for > 2 channels */
> >  	sampling_rates = CEA_SAD_SAMPLING_RATE_32KHZ |
> >  			 CEA_SAD_SAMPLING_RATE_44KHZ |
> > -			 CEA_SAD_SAMPLING_RATE_48KHZ |
> > -			 CEA_SAD_SAMPLING_RATE_88KHZ |
> > -			 CEA_SAD_SAMPLING_RATE_96KHZ |
> > -			 CEA_SAD_SAMPLING_RATE_176KHZ |
> > -			 CEA_SAD_SAMPLING_RATE_192KHZ;
> > +			 CEA_SAD_SAMPLING_RATE_48KHZ;
> >  	sample_sizes = CEA_SAD_SAMPLE_SIZE_16 |
> >  		       CEA_SAD_SAMPLE_SIZE_20 |
> >  		       CEA_SAD_SAMPLE_SIZE_24;
> > @@ -2174,6 +2225,10 @@ igt_main
> >  		connector_subtest("dp-audio", DisplayPort)
> >  			test_display_audio(&data, port, "HDMI",
> >  					   TEST_EDID_CHAMELIUM_DEFAULT);
> > +
> > +		connector_subtest("dp-audio-edid", DisplayPort)
> > +			test_display_audio_edid(&data, port,
> > +						TEST_EDID_CHAMELIUM_DEFAULT);
> >  	}
> >  
> >  	igt_subtest_group {
> > @@ -2325,6 +2380,10 @@ igt_main
> >  		connector_subtest("hdmi-audio", HDMIA)
> >  			test_display_audio(&data, port, "HDMI",
> >  					   TEST_EDID_HDMI_AUDIO);
> > +
> > +		connector_subtest("hdmi-audio-edid", HDMIA)
> > +			test_display_audio_edid(&data, port,
> > +						TEST_EDID_HDMI_AUDIO);
> >  	}
> >  
> >  	igt_subtest_group {
> > -- 
> > 2.21.0
> > 
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

  parent reply	other threads:[~2019-06-03 12:56 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-31 11:21 [igt-dev] [PATCH i-g-t 0/5] Add audio EDID tests to Chamelium Simon Ser
2019-05-31 11:21 ` [igt-dev] [PATCH i-g-t 1/5] lib/igt_eld: introduce an ELD library Simon Ser
2019-06-03 12:27   ` Martin Peres
2019-05-31 11:21 ` [igt-dev] [PATCH i-g-t 2/5] lib/igt_eld: consolidate ELD parsing Simon Ser
2019-06-03 12:42   ` Martin Peres
2019-06-03 14:34     ` Ser, Simon
2019-06-04  8:02       ` Peres, Martin
2019-05-31 11:21 ` [igt-dev] [PATCH i-g-t 3/5] lib/igt_eld: parse Short Audio Descriptors Simon Ser
2019-06-03 12:57   ` Martin Peres
2019-06-03 15:06     ` Ser, Simon
2019-05-31 11:21 ` [igt-dev] [PATCH i-g-t 4/5] lib/igt_eld: allow retrieving an ELD entry per monitor name Simon Ser
2019-06-03 13:04   ` Martin Peres
2019-06-03 15:10     ` Ser, Simon
2019-05-31 11:22 ` [igt-dev] [PATCH i-g-t 5/5] tests/kms_chamelium: add an audio EDID test Simon Ser
2019-05-31 13:18   ` Arkadiusz Hiler
2019-05-31 13:25     ` Arkadiusz Hiler
2019-05-31 14:06     ` Ser, Simon
2019-06-03 12:56     ` Ser, Simon [this message]
2019-05-31 16:02 ` [igt-dev] ✓ Fi.CI.BAT: success for Add audio EDID tests to Chamelium Patchwork
2019-06-01 18:54 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2019-06-03  6:38   ` Ser, Simon
2019-06-03 12:12     ` Peres, Martin
2019-06-03 12:17 ` [igt-dev] ✓ Fi.CI.IGT: success " Patchwork
2019-06-03 13:24 ` [igt-dev] ✓ Fi.CI.BAT: success for Add audio EDID tests to Chamelium (rev2) Patchwork
2019-06-03 19:53 ` [igt-dev] ✓ Fi.CI.IGT: " 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=ed51d7a21f9997c428fbc1f1fe9280eb3a7af7f6.camel@intel.com \
    --to=simon.ser@intel.com \
    --cc=arkadiusz.hiler@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=martin.peres@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