[PATCH i-g-t 1/3] lib/dsc: Add helpers to disable force dsc
Chaitanya Kumar Borah
chaitanya.kumar.borah at intel.com
Mon Aug 11 07:58:48 UTC 2025
Add helpers to disable "force dsc" and verify that it is disabled
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah at intel.com>
---
lib/igt_dsc.c | 25 +++++++++++++++++++++++++
lib/igt_dsc.h | 2 ++
2 files changed, 27 insertions(+)
diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
index 4caad39db..3754eef07 100644
--- a/lib/igt_dsc.c
+++ b/lib/igt_dsc.c
@@ -124,6 +124,31 @@ int igt_force_dsc_enable(int drmfd, char *connector_name)
return write_dsc_debugfs(drmfd, connector_name, "i915_dsc_fec_support", "1");
}
+/**
+ * igt_is_force_dsc_disabled:
+ * @drmfd: A drm file descriptor
+ * @connector_name: Name of the libdrm connector we're going to use
+ *
+ * Returns: True if DSC is force enable is disabled (via debugfs) for the given connector,
+ * false otherwise.
+ */
+bool igt_is_force_dsc_disabled(int drmfd, char *connector_name)
+{
+ return check_dsc_debugfs(drmfd, connector_name, "Force_DSC_Enable: no");
+}
+
+/**
+ * igt_force_dsc_disable:
+ * @drmfd: A drm file descriptor
+ * @connector_name: Name of the libdrm connector we're going to use
+ *
+ * Returns: 0 on success or negative error code, in case of failure.
+ */
+int igt_force_dsc_disable(int drmfd, char *connector_name)
+{
+ return write_dsc_debugfs(drmfd, connector_name, "i915_dsc_fec_support", "0");
+}
+
/**
* igt_force_dsc_enable_bpc:
* @drmfd: A drm file descriptor
diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
index 3cf2d4e76..f63345848 100644
--- a/lib/igt_dsc.h
+++ b/lib/igt_dsc.h
@@ -17,6 +17,8 @@ bool igt_is_dsc_enabled(int drmfd, char *connector_name);
bool igt_is_force_dsc_enabled(int drmfd, char *connector_name);
int igt_force_dsc_enable(int drmfd, char *connector_name);
int igt_force_dsc_enable_bpc(int drmfd, char *connector_name, int bpc);
+int igt_force_dsc_disable(int drmfd, char *connector_name);
+bool igt_is_force_dsc_disabled(int drmfd, char *connector_name);
int igt_get_dsc_debugfs_fd(int drmfd, char *connector_name);
bool igt_is_dsc_output_format_supported_by_sink(int drmfd, char *connector_name,
enum dsc_output_format output_format);
--
2.25.1
More information about the igt-dev
mailing list