<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
</head>
<body>
<p>Hello Jeevan<br>
</p>
<div class="moz-cite-prefix">On 7/22/2024 1:20 PM, Jeevan B wrote:<br>
</div>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">Added helper functions to check LOBF status to check weather
it is enabled or disabled.
v2: rename function name.
Signed-off-by: Jeevan B <a class="moz-txt-link-rfc2396E" href="mailto:jeevan.b@intel.com"><jeevan.b@intel.com></a>
---
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 64318ef7f..e030b35a6 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6071,6 +6071,29 @@ void igt_dump_crtcs_fd(int drmfd)
drmModeFreeResources(mode_resources);
}
+/**
+ * igt_get_i915_edp_lobf_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_i915_edp_lobf_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);</pre>
</blockquote>
<pre class="moz-quote-pre" wrap=""></pre>
Do we have any constraints for <span style="white-space: pre-wrap">i915_edp_lobf_inf, like platform etc etc?
If so lets have has_</span><span style="white-space: pre-wrap">i915_edp_lobf_info</span>so
we can skip instead of asserting.<br>
<br>
Apart from that, LGTM<br>
Reviewed-by: Kunal Joshi <a class="moz-txt-link-rfc2396E" href="mailto:kunal1.joshi@intel.com"><kunal1.joshi@intel.com></a>
<blockquote type="cite">
<pre class="moz-quote-pre" wrap="">
+
+ res = igt_debugfs_simple_read(fd, "i915_edp_lobf_info", buf, sizeof(buf));
+ igt_require(res > 0);
+
+ close(fd);
+
+ return strstr(buf, "LOBF 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 501d48763..e8582a45b 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -1195,6 +1195,7 @@ void igt_require_pipe(igt_display_t *display,
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);
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,
</pre>
</blockquote>
</body>
</html>