From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org, jeevan.b@intel.com
Cc: Bhanuprakash Modem <bhanuprakash.modem@intel.com>,
Kunal Joshi <kunal1.joshi@intel.com>
Subject: [i-g-t V6 3/8] lib/igt_kms: New helper to check force joiner status
Date: Tue, 18 Jun 2024 13:52:43 +0530 [thread overview]
Message-ID: <20240618082248.4070611-4-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20240618082248.4070611-1-bhanuprakash.modem@intel.com>
Add a new function to check the force joiner status
on selected connecter, so that it would be helpful to
check the force joiner status from other places too.
V2: - Add few debug prints
V3: - Rebase
Cc: Kunal Joshi <kunal1.joshi@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
lib/igt_kms.c | 34 ++++++++++++++++++++++++++++++++++
lib/igt_kms.h | 1 +
2 files changed, 35 insertions(+)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index c0aa92eb5..9fdfadde1 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6359,6 +6359,40 @@ bool igt_has_force_joiner_debugfs(int drmfd, char *conn_name)
return ret >= 0;
}
+/**
+ * igt_check_force_joiner_status
+ * @drmfd: file descriptor of the DRM device.
+ * @connector_name: connector to check.
+ *
+ * Checks if the force big joiner is enabled.
+ *
+ * Returns: True if the force big joiner is enabled, False otherwise.
+ */
+bool igt_check_force_joiner_status(int drmfd, char *connector_name)
+{
+ char buf[512];
+ int debugfs_fd, ret;
+
+ if (!connector_name)
+ return false;
+
+ debugfs_fd = igt_debugfs_connector_dir(drmfd, connector_name, O_RDONLY);
+ if (debugfs_fd < 0) {
+ igt_debug("Could not open debugfs for connector: %s\n", connector_name);
+ return false;
+ }
+
+ ret = igt_debugfs_simple_read(debugfs_fd, "i915_bigjoiner_force_enable", buf, sizeof(buf));
+ close(debugfs_fd);
+
+ if (ret < 0) {
+ igt_debug("Could not read i915_bigjoiner_force_enable for connector: %s\n", connector_name);
+ return false;
+ }
+
+ return strstr(buf, "Y");
+}
+
/**
* igt_check_bigjoiner_support:
* @display: a pointer to an #igt_display_t structure
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 979cf1300..501d48763 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1216,6 +1216,7 @@ bool igt_bigjoiner_possible(drmModeModeInfo *mode, int max_dotclock);
bool bigjoiner_mode_found(int drm_fd, drmModeConnector *connector,
int max_dotclock, drmModeModeInfo *mode);
bool igt_has_force_joiner_debugfs(int drmfd, char *conn_name);
+bool igt_check_force_joiner_status(int drmfd, char *connector_name);
bool igt_check_bigjoiner_support(igt_display_t *display);
bool igt_parse_mode_string(const char *mode_string, drmModeModeInfo *mode);
bool intel_pipe_output_combo_valid(igt_display_t *display);
--
2.43.2
next prev parent reply other threads:[~2024-06-18 8:31 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-18 8:22 [i-g-t V6 0/8] Force joiner support in bigjoiner checks Bhanuprakash Modem
2024-06-18 8:22 ` [i-g-t V6 1/8] lib/igt_kms: Split the bigjoiner check into multiple Bhanuprakash Modem
2024-06-24 18:15 ` B, Jeevan
2024-06-18 8:22 ` [i-g-t V6 2/8] lib/igt_kms: Update force joiner debugfs check Bhanuprakash Modem
2024-06-18 8:22 ` Bhanuprakash Modem [this message]
2024-06-27 6:50 ` [i-g-t V6 3/8] lib/igt_kms: New helper to check force joiner status B, Jeevan
2024-06-18 8:22 ` [i-g-t V6 4/8] lib/igt_kms: Force joiner support in bigjoiner checks Bhanuprakash Modem
2024-06-27 6:54 ` B, Jeevan
2024-06-18 8:22 ` [i-g-t V6 5/8] tests/intel/kms_pm_lpsp: " Bhanuprakash Modem
2024-06-27 6:58 ` B, Jeevan
2024-06-18 8:22 ` [i-g-t V6 6/8] tests/kms_flip: " Bhanuprakash Modem
2024-06-27 7:04 ` B, Jeevan
2024-06-27 7:20 ` Modem, Bhanuprakash
2024-06-27 8:28 ` B, Jeevan
2024-06-18 8:22 ` [i-g-t V6 7/8] tests/kms_setmode: " Bhanuprakash Modem
2024-06-27 7:05 ` B, Jeevan
2024-06-27 8:29 ` B, Jeevan
2024-06-18 8:22 ` [i-g-t V6 8/8] HAX: Test force joiner on BAT Bhanuprakash Modem
2024-06-18 13:54 ` ✓ CI.xeBAT: success for Force joiner support in bigjoiner checks (rev8) Patchwork
2024-06-18 13:58 ` ✓ Fi.CI.BAT: " Patchwork
2024-06-18 21:35 ` ✗ Fi.CI.IGT: failure " Patchwork
2024-06-19 2:24 ` ✗ CI.xeFULL: " Patchwork
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=20240618082248.4070611-4-bhanuprakash.modem@intel.com \
--to=bhanuprakash.modem@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=jeevan.b@intel.com \
--cc=kunal1.joshi@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