[PATCH i-g-t 2/5] lib/dsc: Add igt_force_dsc_enable_compressed_bpp()

Swati Sharma swati2.sharma at intel.com
Wed May 21 07:28:33 UTC 2025


Function is added to force compressed bpp via debugfs
intel_force_link_bpp.

Signed-off-by: Swati Sharma <swati2.sharma at intel.com>
---
 lib/igt_dsc.c | 18 ++++++++++++++++++
 lib/igt_dsc.h |  1 +
 2 files changed, 19 insertions(+)

diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
index 4caad39db..21677b0e0 100644
--- a/lib/igt_dsc.c
+++ b/lib/igt_dsc.c
@@ -6,6 +6,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <string.h>
+#include "drmtest.h"
 #include "igt_core.h"
 #include "igt_dsc.h"
 #include "igt_sysfs.h"
@@ -141,6 +142,23 @@ int igt_force_dsc_enable_bpc(int drmfd, char *connector_name, int bpc)
 	return write_dsc_debugfs(drmfd, connector_name, "i915_dsc_bpc", buf);
 }
 
+/**
+ * igt_force_dsc_enable_compressed_bpp:
+ * @drmfd: A drm file descriptor
+ * @connector_name: Name of the libdrm connector we're going to use
+ * @bpp: Compressed BPP
+ *
+ * Returns: 0 on success or negative error code, in case of failure.
+ */
+int igt_force_dsc_enable_compressed_bpp(int drmfd, char *connector_name, float bpp)
+{
+	char buf[20] = {0};
+
+	sprintf(buf, "%.2f", bpp);
+
+	return write_dsc_debugfs(drmfd, connector_name, "intel_force_link_bpp", buf);
+}
+
 /**
  * igt_get_dsc_debugfs_fd:
  * @drmfd: A drm file descriptor
diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
index 3cf2d4e76..ab5d27b06 100644
--- a/lib/igt_dsc.h
+++ b/lib/igt_dsc.h
@@ -17,6 +17,7 @@ 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_enable_compressed_bpp(int drmfd, char *connector_name, float bpp);
 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