summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Ser <simon.ser@intel.com>2019-05-13 16:37:23 +0300
committerArkadiusz Hiler <arkadiusz.hiler@intel.com>2019-05-14 14:31:38 +0300
commit512aad1e6a3c0725a92fb8ccd2f7162caa81a628 (patch)
tree2f0932313ecac0ae1f5493170d6d1cec13e40689
parentdc0598498a16d43b0bc9cbc654491d4e6dc56626 (diff)
tests/kms_chamelium: check ports have audio support
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> Reviewed-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
-rw-r--r--lib/igt_chamelium.c13
-rw-r--r--lib/igt_chamelium.h2
-rw-r--r--tests/kms_chamelium.c4
3 files changed, 19 insertions, 0 deletions
diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index ffc68f35..94825002 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 f47b84cb..a067c888 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 502f1efa..7c300698 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);