[PATCH v5 2/7] lib/i915/intel_fbc: Add fbc supported check based on wa
Mohammed Thasleem
mohammed.thasleem at intel.com
Mon Jun 30 13:41:40 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)
v5: Updated function discription and return logic. (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 | 27 +++++++++++++++++++++++++++
lib/i915/intel_fbc.h | 1 +
2 files changed, 28 insertions(+)
diff --git a/lib/i915/intel_fbc.c b/lib/i915/intel_fbc.c
index a8ded0a59..a1a6de90e 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,29 @@ 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 check if WA is present on some GT, which in turn make
+ * FBC not possible
+ *
+ * Returns:
+ * true: if WA is applied and FBC id disabled
+ * false: otherwise
+ */
+bool intel_is_fbc_disabled_by_wa(int fd)
+{
+ int wa;
+ const char *wa_fbc_disabled = "16023588340";
+
+ if (!is_xe_device(fd))
+ return false;
+
+ 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.25.1
More information about the igt-dev
mailing list