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
Subject: [igt-dev] [PATCH i-g-t] tests/i915/kms_dsc: add has_dsc()
Date: Thu, 18 May 2023 10:57:22 +0530	[thread overview]
Message-ID: <20230518052722.249768-1-swati2.sharma@intel.com> (raw)

Instead of assuming dsc is supported gen11+, lets use has_dsc
flag in i915_capability to check h/w support.

Signed-off-by: Swati Sharma <swati2.sharma@intel.com>
---
 tests/i915/kms_dsc.c | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/tests/i915/kms_dsc.c b/tests/i915/kms_dsc.c
index 3ce28f84..ad698f27 100644
--- a/tests/i915/kms_dsc.c
+++ b/tests/i915/kms_dsc.c
@@ -253,6 +253,24 @@ static void test_dsc(data_t *data, enum dsc_test_type test_type, int bpc,
 	}
 }
 
+static bool has_dsc(data_t *data)
+{
+	char buf[4096];
+	int dir, res;
+
+	dir = igt_debugfs_dir(data->drm_fd);
+	igt_assert(dir >= 0);
+
+	igt_require_intel(data->drm_fd);
+
+	res = igt_debugfs_simple_read(dir, "i915_capabilities",
+				      buf, sizeof(buf));
+	igt_require(res > 0);
+	close(dir);
+
+	return strstr(buf, "has_dsc: yes");
+}
+
 igt_main
 {
 	data_t data = {};
@@ -265,7 +283,7 @@ igt_main
 		igt_install_exit_handler(kms_dsc_exit_handler);
 		igt_display_require(&data.display, data.drm_fd);
 		igt_display_require_output(&data.display);
-		igt_require(data.disp_ver >= 11);
+		igt_require(has_dsc(&data));
 	}
 
 	igt_describe("Tests basic display stream compression functionality if supported "
-- 
2.25.1

             reply	other threads:[~2023-05-18  5:27 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-05-18  5:27 Swati Sharma [this message]
2023-05-18  6:18 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/kms_dsc: add has_dsc() Patchwork
2023-05-18 17:32 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-05-30  5:40 ` [igt-dev] [PATCH i-g-t] " Nautiyal, Ankit K

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=20230518052722.249768-1-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