[PATCH v4 2/7] lib/i915/intel_fbc: Add fbc supported check based on wa

Mohammed Thasleem mohammed.thasleem at intel.com
Fri Jun 27 06:04:41 UTC 2025


This will check the fbc supported based on given workarunds.

v2: Add intel_wa header file.
v3: Add xe check. (Kamil)
v4: Updated function name with intel_is_fbc_disabled_by_wa. (Kamil)

Signed-off-by: Mohammed Thasleem <mohammed.thasleem at intel.com>
Reviewed-by: Kunal Joshi <kunal1.joshi at intel.com>
---
 lib/i915/intel_fbc.c | 25 +++++++++++++++++++++++++
 lib/i915/intel_fbc.h |  1 +
 2 files changed, 26 insertions(+)

diff --git a/lib/i915/intel_fbc.c b/lib/i915/intel_fbc.c
index a8ded0a59..722899432 100644
--- a/lib/i915/intel_fbc.c
+++ b/lib/i915/intel_fbc.c
@@ -9,6 +9,7 @@
 #include "igt_psr.h"
 
 #include "intel_fbc.h"
+#include "intel_wa.h"
 
 #define FBC_STATUS_BUF_LEN 128
 
@@ -200,3 +201,27 @@ bool intel_fbc_supported_for_psr_mode(int disp_ver, enum psr_mode mode)
 
 	return fbc_supported;
 }
+
+/**
+ * intel_is_fbc_disabled_by_wa
+ *
+ * @fd: fd of the device
+ *
+ * This function pass the WA to igt_has_intel_wa to check WA on available GTs
+ *
+ * Returns:
+ * true if wa is not equal to 1, and false if wa is equal to 1
+ */
+bool intel_is_fbc_disabled_by_wa(int fd)
+{
+	int wa;
+	const char *wa_fbc_disabled = "16023588340";
+
+	if (!is_xe_device(fd))
+		return true;
+
+	wa = igt_has_intel_wa(fd, wa_fbc_disabled);
+	igt_assert_f(wa >= 0, "WA path not found on GTs\n");
+
+	return wa != 1;
+}
diff --git a/lib/i915/intel_fbc.h b/lib/i915/intel_fbc.h
index fcafe6049..fe9edcbc3 100644
--- a/lib/i915/intel_fbc.h
+++ b/lib/i915/intel_fbc.h
@@ -19,5 +19,6 @@ bool intel_fbc_is_enabled(int device, enum pipe pipe, int log_level);
 void intel_fbc_max_plane_size(int fd, uint32_t *width, uint32_t *height);
 bool intel_fbc_plane_size_supported(int device, uint32_t width, uint32_t height);
 bool intel_fbc_supported_for_psr_mode(int disp_ver, enum psr_mode mode);
+bool intel_is_fbc_disabled_by_wa(int fd);
 
 #endif
-- 
2.34.1



More information about the igt-dev mailing list