Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Swati Sharma <swati2.sharma@intel.com>
To: igt-dev@lists.freedesktop.org
Cc: Swati Sharma <swati2.sharma@intel.com>
Subject: [PATCH i-g-t 3/4] lib/dsc: Add igt_get_dsc_sink_compressed_bpp()
Date: Fri, 31 Jul 2026 17:51:44 +0530	[thread overview]
Message-ID: <20260731122145.4099468-4-swati2.sharma@intel.com> (raw)
In-Reply-To: <20260731122145.4099468-1-swati2.sharma@intel.com>

Function is added to return compressed bpp after
parsing i915_display_info debugfs.

v2: Rebase

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

diff --git a/lib/igt_dsc.c b/lib/igt_dsc.c
index 93b67655f..d30730f5c 100644
--- a/lib/igt_dsc.c
+++ b/lib/igt_dsc.c
@@ -375,3 +375,41 @@ int igt_get_dsc_sink_max_slice_count(int drmfd, char *connector_name)
 
 	return max_slice_count;
 }
+
+/**
+ * igt_get_dsc_sink_compressed_bpp:
+ * @drmfd: A drm file descriptor
+ * @pipe: display pipe
+ *
+ * Returns: The dsc sink compressed bpp.
+ */
+float igt_get_dsc_sink_compressed_bpp(int drmfd, enum pipe pipe)
+{
+	char buf[8192];
+	char dest[20];
+	char *start_loc1, *start_loc2;
+	int dir, res;
+	float comp_bpp = 0;
+
+	snprintf(dest, sizeof(dest), ":pipe %s", kmstest_pipe_name(pipe));
+
+	igt_require_intel(drmfd);
+
+	dir = igt_debugfs_dir(drmfd);
+	igt_assert_lte(0, dir);
+
+	res = igt_debugfs_simple_read(dir, "i915_display_info", buf, sizeof(buf));
+	close(dir);
+	igt_require(res > 0);
+
+	start_loc1 = strstr(buf, dest);
+	igt_require_f(start_loc1, "Pipe %s not found in i915_display_info\n",
+		      kmstest_pipe_name(pipe));
+
+	start_loc2 = strstr(start_loc1, "dsc-dss: compressed-bpp:");
+	igt_assert(start_loc2);
+	igt_assert_eq(sscanf(start_loc2, "dsc-dss: compressed-bpp:%f", &comp_bpp), 1);
+	igt_assert(comp_bpp > 0);
+
+	return comp_bpp;
+}
diff --git a/lib/igt_dsc.h b/lib/igt_dsc.h
index 0ba06d8c5..f895af7f3 100644
--- a/lib/igt_dsc.h
+++ b/lib/igt_dsc.h
@@ -31,5 +31,6 @@ bool igt_is_force_dsc_fractional_bpp_enabled(int drmfd, char *connector_name);
 int igt_force_dsc_fractional_bpp_enable(int drmfd, char *connector_name);
 int igt_get_dsc_fractional_bpp_debugfs_fd(int drmfd, char *connector_name);
 int igt_get_dsc_sink_max_slice_count(int drmfd, char *connector_name);
+float igt_get_dsc_sink_compressed_bpp(int drmfd, enum pipe pipe);
 
 #endif
-- 
2.25.1


  parent reply	other threads:[~2026-07-31 12:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-31 12:21 [PATCH i-g-t 0/4] Add DSC compressed BPP subtest Swati Sharma
2026-07-31 12:21 ` [PATCH i-g-t 1/4] lib/dsc: Add igt_force_dsc_enable_compressed_bpp() Swati Sharma
2026-07-31 12:21 ` [PATCH i-g-t 2/4] tests/intel/kms_dsc_helper: Add helper to force compressed BPP Swati Sharma
2026-07-31 12:21 ` Swati Sharma [this message]
2026-07-31 12:21 ` [PATCH i-g-t 4/4] tests/intel/kms_dsc: Add dsc-compressed-bpp subtest Swati Sharma
2026-07-31 13:00 ` ✓ Xe.CI.BAT: success for Add DSC compressed BPP subtest (rev2) Patchwork
2026-07-31 13:28 ` ✗ i915.CI.BAT: failure " Patchwork
2026-07-31 14:00 ` ✗ Xe.CI.FULL: " Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260731122145.4099468-4-swati2.sharma@intel.com \
    --to=swati2.sharma@intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox