public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
From: Simon Ser <simon.ser@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Petri Latvala <petri.latvala@intel.com>
Subject: [igt-dev] [PATCH i-g-t] tests/kms_chamelium: check ports have audio support
Date: Mon, 13 May 2019 16:37:23 +0300	[thread overview]
Message-ID: <20190513133723.7179-1-simon.ser@intel.com> (raw)

Before starting an audio test, make sure the Chamelium supports audio capture
on the port we want to use.

Old Chamelium devices don't support audio capture on DisplayPort ports. This
patch will make the tests skip DisplayPort ports.

Signed-off-by: Simon Ser <simon.ser@intel.com>
---
 lib/igt_chamelium.c   | 13 +++++++++++++
 lib/igt_chamelium.h   |  2 ++
 tests/kms_chamelium.c |  4 ++++
 3 files changed, 19 insertions(+)

diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index ffc68f3557ee..94825002cab3 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -930,6 +930,19 @@ int chamelium_get_captured_frame_count(struct chamelium *chamelium)
 	return ret;
 }

+bool chamelium_has_audio_support(struct chamelium *chamelium,
+				 struct chamelium_port *port)
+{
+	xmlrpc_value *res;
+	xmlrpc_bool has_support;
+
+	res = chamelium_rpc(chamelium, port, "HasAudioSupport", "(i)", port->id);
+	xmlrpc_read_bool(&chamelium->env, res, &has_support);
+	xmlrpc_DECREF(res);
+
+	return has_support;
+}
+
 /**
  * chamelium_get_audio_channel_mapping:
  * @chamelium: the Chamelium instance
diff --git a/lib/igt_chamelium.h b/lib/igt_chamelium.h
index f47b84cbfc01..a067c888c0ff 100644
--- a/lib/igt_chamelium.h
+++ b/lib/igt_chamelium.h
@@ -106,6 +106,8 @@ void chamelium_start_capture(struct chamelium *chamelium,
 void chamelium_stop_capture(struct chamelium *chamelium, int frame_count);
 void chamelium_capture(struct chamelium *chamelium, struct chamelium_port *port,
 		       int x, int y, int w, int h, int frame_count);
+bool chamelium_has_audio_support(struct chamelium *chamelium,
+				 struct chamelium_port *port);
 void chamelium_get_audio_channel_mapping(struct chamelium *chamelium,
 					 struct chamelium_port *port,
 					 int mapping[static 8]);
diff --git a/tests/kms_chamelium.c b/tests/kms_chamelium.c
index 502f1efa0727..7c3006982abd 100644
--- a/tests/kms_chamelium.c
+++ b/tests/kms_chamelium.c
@@ -1033,6 +1033,10 @@ test_display_audio(data_t *data, struct chamelium_port *port,

 	igt_require(alsa_has_exclusive_access());

+	/* Old Chamelium devices need an update for DisplayPort audio
+	 * support. */
+	igt_require(chamelium_has_audio_support(data->chamelium, port));
+
 	alsa = alsa_init();
 	igt_assert(alsa);

--
2.21.0

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

             reply	other threads:[~2019-05-13 13:37 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-13 13:37 Simon Ser [this message]
2019-05-13 14:49 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/kms_chamelium: check ports have audio support Patchwork
2019-05-13 17:10 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2019-05-14 11:30 ` [igt-dev] [PATCH i-g-t] " Arkadiusz Hiler

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=20190513133723.7179-1-simon.ser@intel.com \
    --to=simon.ser@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