From: Martin Peres <martin.peres@linux.intel.com>
To: Simon Ser <simon.ser@intel.com>, igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [RFC PATCH 3/3] tests/kms_chamelium: add InfoFrame checks to audio tests
Date: Wed, 17 Jul 2019 16:36:36 +0300 [thread overview]
Message-ID: <6c00c0ed-ddc0-a37c-ade3-1029680876ed@linux.intel.com> (raw)
In-Reply-To: <20190716115814.17676-4-simon.ser@intel.com>
On 16/07/2019 14:58, Simon Ser wrote:
> If the DUT sends an InfoFrame, check that its values are correct. Per the HDMI
> and DP specs, most of the fields can be set to "refer to stream header" because
> some information is duplicated. The DP spec also says that InfoFrames are
> optional if mono or stereo audio is used (because there's no channel speaker
> allocation).
>
> Signed-off-by: Simon Ser <simon.ser@intel.com>
Looks good! With the TODO of patch 2 addressed, the series is:
Reviewed-by: Martin Peres <martin.peres@linux.intel.com>
> ---
> tests/kms_chamelium.c | 50 +++++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 50 insertions(+)
>
> diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
> index 321fb16b73bd..e754c4734736 100644
> --- a/tests/kms_chamelium.c
> +++ b/tests/kms_chamelium.c
> @@ -29,6 +29,7 @@
> #include "igt_vc4.h"
> #include "igt_edid.h"
> #include "igt_eld.h"
> +#include "igt_infoframe.h"
>
> #include <fcntl.h>
> #include <pthread.h>
> @@ -1014,6 +1015,53 @@ static void audio_state_stop(struct audio_state *state, bool success)
> success ? "ALL GREEN" : "FAILED");
> }
>
> +static void check_audio_infoframe(struct audio_state *state)
> +{
> + struct chamelium_infoframe *infoframe;
> + struct infoframe_audio infoframe_audio;
> + struct infoframe_audio expected = {0};
> + bool ok;
> +
> + expected.coding_type = INFOFRAME_AUDIO_CT_PCM;
> + expected.channel_count = state->playback.channels;
> + expected.sampling_freq = state->playback.rate;
> + expected.sample_size = snd_pcm_format_width(state->playback.format);
> +
> + infoframe = chamelium_get_last_infoframe(state->chamelium, state->port,
> + CHAMELIUM_INFOFRAME_AUDIO);
> + if (infoframe == NULL && state->playback.channels <= 2) {
> + /* Audio InfoFrames are optional for mono and stereo audio */
> + igt_debug("Skipping audio InfoFrame check: "
> + "no InfoFrame received\n");
> + return;
> + }
> + igt_assert_f(infoframe != NULL, "no audio InfoFrame received\n");
> +
> + ok = infoframe_audio_parse(&infoframe_audio, infoframe->version,
> + infoframe->payload, infoframe->payload_size);
> + chamelium_infoframe_destroy(infoframe);
> + igt_assert_f(ok, "failed to parse audio InfoFrame\n");
> +
> + igt_debug("Checking audio InfoFrame:\n");
> + igt_debug("coding_type: got %d, expected %d\n",
> + infoframe_audio.coding_type, expected.coding_type);
> + igt_debug("channel_count: got %d, expected %d\n",
> + infoframe_audio.channel_count, expected.channel_count);
> + igt_debug("sampling_freq: got %d, expected %d\n",
> + infoframe_audio.sampling_freq, expected.sampling_freq);
> + igt_debug("sample_size: got %d, expected %d\n",
> + infoframe_audio.sample_size, expected.sample_size);
> +
> + if (infoframe_audio.coding_type != INFOFRAME_AUDIO_CT_UNSPECIFIED)
> + igt_assert(infoframe_audio.coding_type == expected.coding_type);
> + if (infoframe_audio.channel_count >= 0)
> + igt_assert(infoframe_audio.channel_count == expected.channel_count);
> + if (infoframe_audio.sampling_freq >= 0)
> + igt_assert(infoframe_audio.sampling_freq == expected.sampling_freq);
> + if (infoframe_audio.sample_size >= 0)
> + igt_assert(infoframe_audio.sample_size == expected.sample_size);
> +}
> +
> static int
> audio_output_frequencies_callback(void *data, void *buffer, int samples)
> {
> @@ -1139,6 +1187,8 @@ static bool test_audio_frequencies(struct audio_state *state)
> free(channel);
> audio_signal_fini(state->signal);
>
> + check_audio_infoframe(state);
> +
> return success;
> }
>
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2019-07-17 13:36 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-07-16 11:58 [igt-dev] [RFC PATCH 0/3] Chamelium audio InfoFrame tests Simon Ser
2019-07-16 11:58 ` [igt-dev] [RFC PATCH 1/3] lib/igt_infoframe: new library Simon Ser
2019-07-16 11:58 ` [igt-dev] [RFC PATCH 2/3] lib/igt_chamelium: add support for GetLastInfoFrame Simon Ser
2019-07-16 11:58 ` [igt-dev] [RFC PATCH 3/3] tests/kms_chamelium: add InfoFrame checks to audio tests Simon Ser
2019-07-17 13:36 ` Martin Peres [this message]
2019-07-16 13:18 ` [igt-dev] ✓ Fi.CI.BAT: success for Chamelium audio InfoFrame tests Patchwork
2019-07-16 14:26 ` [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=6c00c0ed-ddc0-a37c-ade3-1029680876ed@linux.intel.com \
--to=martin.peres@linux.intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=simon.ser@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.