[PATCH i-g-t 1/2] lib/igt_kms: Added library functions for aux-less ALPM status
Jeevan B
jeevan.b at intel.com
Fri Sep 20 09:45:20 UTC 2024
Added helper functions to check aux-less alpm status to check
weather it is enabled or disabled.
Signed-off-by: Jeevan B <jeevan.b at intel.com>
---
lib/igt_kms.c | 23 +++++++++++++++++++++++
lib/igt_kms.h | 1 +
2 files changed, 24 insertions(+)
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index b40470c02..be6d6536a 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6094,6 +6094,29 @@ bool igt_get_i915_edp_lobf_status(int drmfd, char *connector_name)
return strstr(buf, "LOBF status: enabled");
}
+/**
+ * igt_get_aux_less_alpm_status
+ * @drmfd: A drm file descriptor
+ * @connector_name: Name of the libdrm connector we're going to use
+ *
+ * Return: True if its enabled.
+ */
+bool igt_get_aux_less_alpm_status(int drmfd, char *connector_name)
+{
+ char buf[24];
+ int fd, res;
+
+ fd = igt_debugfs_connector_dir(drmfd, connector_name, O_RDONLY);
+ igt_assert(fd >= 0);
+
+ res = igt_debugfs_simple_read(fd, "i915_edp_lobf_info", buf, sizeof(buf));
+ igt_require(res > 0);
+
+ close(fd);
+
+ return strstr(buf, "Aux-less alpm status: enabled");
+}
+
/**
* igt_get_output_max_bpc:
* @drmfd: A drm file descriptor
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 25ba50916..8bbb6225b 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1196,6 +1196,7 @@ void igt_dump_connectors_fd(int drmfd);
void igt_dump_crtcs_fd(int drmfd);
bool igt_override_all_active_output_modes_to_fit_bw(igt_display_t *display);
bool igt_get_i915_edp_lobf_status(int drmfd, char *connector_name);
+bool igt_get_aux_less_alpm_status(int drmfd, char *connector_name);
unsigned int igt_get_output_max_bpc(int drmfd, char *connector_name);
unsigned int igt_get_pipe_current_bpc(int drmfd, enum pipe pipe);
void igt_assert_output_bpc_equal(int drmfd, enum pipe pipe,
--
2.25.1
More information about the igt-dev
mailing list