[igt-dev] [PATCH i-g-t, v3] tests/kms_hdmi_inject: Fix audio test by loading snd driver

Nemesa Garg nemesa.garg at intel.com
Thu Aug 17 05:04:12 UTC 2023


As audio driver is blacklisted so load the snd_hda_intel
module before the inject_audio test run.

v2: Address comments(Kamil)

Signed-off-by: Nemesa Garg <nemesa.garg at intel.com>
---
 tests/kms_hdmi_inject.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/tests/kms_hdmi_inject.c b/tests/kms_hdmi_inject.c
index 9aa5c59fc..cb5ccd14d 100644
--- a/tests/kms_hdmi_inject.c
+++ b/tests/kms_hdmi_inject.c
@@ -29,11 +29,18 @@
 #include "igt.h"
 #include "igt_edid.h"
 #include "igt_eld.h"
+#include "igt_kmod.h"
 #include "xe/xe_query.h"
 
 #define HDISPLAY_4K	3840
 #define VDISPLAY_4K	2160
 
+/*
+ * Wait for 200ms as it take time for making
+ * driver entry after the driver load.
+ */
+#define AUDIO_DELAY_US  200000
+
 IGT_TEST_DESCRIPTION("Test that in-kernel EDID parsing is producing "
 		     "expected results by forcing a HDMI connector "
 		     "with a known EDID and checking that the metadata "
@@ -144,6 +151,11 @@ hdmi_inject_audio(int drm_fd, drmModeConnector *connector)
 	struct igt_fb fb;
 	struct kmstest_connector_config config;
 
+	if (!igt_kmod_is_loaded("snd_hda_intel"))
+		igt_assert(igt_kmod_load("snd_hda_intel", NULL) == 0);
+
+	usleep(AUDIO_DELAY_US);
+
 	igt_require(eld_is_supported());
 
 	edid = igt_kms_get_hdmi_audio_edid();
-- 
2.25.1



More information about the igt-dev mailing list