public inbox for igt-dev@lists.freedesktop.org
 help / color / mirror / Atom feed
* [igt-dev] [PATCH i-g-t] tests/kms_chamelium: check ports have audio support
@ 2019-05-13 13:37 Simon Ser
  2019-05-13 14:49 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Simon Ser @ 2019-05-13 13:37 UTC (permalink / raw)
  To: igt-dev; +Cc: Petri Latvala

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

^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2019-05-14 11:30 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-05-13 13:37 [igt-dev] [PATCH i-g-t] tests/kms_chamelium: check ports have audio support Simon Ser
2019-05-13 14:49 ` [igt-dev] ✓ Fi.CI.BAT: success for " 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox