Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Vinod Govindapillai <vinod.govindapillai@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [PATCH i-g-t v3 1/2] lib/igt_debugfs: set provision to ignore long HPDs
Date: Thu,  9 Mar 2023 10:37:50 +0200	[thread overview]
Message-ID: <20230309083751.347335-2-vinod.govindapillai@intel.com> (raw)
In-Reply-To: <20230309083751.347335-1-vinod.govindapillai@intel.com>

Add provision to ignore long HPDs as some displays generate
long HPDs even while connected. For some CI systems with
such displays it might be usefull to ignore such spurious
HPDs while executing testcases.

v2: Some sytling issues (Kamil)

Cc: Imre Deak <imre.deak@intel.com>
Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
---
 lib/igt_debugfs.c | 26 ++++++++++++++++++++++++++
 lib/igt_debugfs.h |  1 +
 2 files changed, 27 insertions(+)

diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 6de178d6..05889bbe 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -411,6 +411,32 @@ bool igt_debugfs_search(int device, const char *filename, const char *substring)
 	return matched;
 }
 
+/**
+ * igt_ignore_long_hpd:
+ * @drm_fd: the DRM device file fd
+ * @enable: flag to control the ignore long HPD entry
+ *
+ * Set / unset ignore long HPD events from the panels. Some panels
+ * generate long HPDs even while connected to the ports causing
+ * unexpected CI execution issues. Set this to ignore such unexpected
+ * long HPDs where we dont expect to disconnect the displays.
+ */
+bool igt_ignore_long_hpd(int drm_fd, bool enable)
+{
+	int fd = igt_debugfs_open(drm_fd, "i915_ignore_long_hpd", O_WRONLY);
+	int ret;
+
+	if (fd < 0) {
+		igt_debug("couldn't open ignore long hpd file\n");
+		return false;
+	}
+
+	ret = write(fd, enable ? "1" : "0", 1);
+
+	close(fd);
+	return ret == 1;
+}
+
 static void igt_hpd_storm_exit_handler(int sig)
 {
 	int fd = drm_open_driver(DRIVER_INTEL);
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index a883e2d4..4824344a 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -72,6 +72,7 @@ void igt_hpd_storm_set_threshold(int fd, unsigned int threshold);
 void igt_hpd_storm_reset(int fd);
 bool igt_hpd_storm_detected(int fd);
 void igt_require_hpd_storm_ctl(int fd);
+bool igt_ignore_long_hpd(int fd, bool enable);
 
 /*
  * Drop caches
-- 
2.34.1

  reply	other threads:[~2023-03-09  8:38 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-09  8:37 [igt-dev] [PATCH i-g-t v3 0/2] Handle spurious HPDs Vinod Govindapillai
2023-03-09  8:37 ` Vinod Govindapillai [this message]
2023-03-09  8:37 ` [igt-dev] [PATCH i-g-t v3 2/2] lib/igt_kms: handle " Vinod Govindapillai
2023-03-09  9:36 ` [igt-dev] ✓ Fi.CI.BAT: success for Handle " Patchwork
2023-03-11  0:24 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork
2023-03-15 16:39 ` [igt-dev] ✓ Fi.CI.BAT: success for Handle spurious HPDs (rev2) Patchwork
2023-03-16  4:34 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-03-16 17:37   ` Imre Deak

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=20230309083751.347335-2-vinod.govindapillai@intel.com \
    --to=vinod.govindapillai@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /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