Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: igt-dev@lists.freedesktop.org
Subject: [igt-dev] [i-g-t V3 2/2] lib/igt_kms: Read max dotclock info from i915_cdclk_info only
Date: Thu, 16 Nov 2023 10:21:13 +0530	[thread overview]
Message-ID: <20231116045113.1590173-2-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20231116045113.1590173-1-bhanuprakash.modem@intel.com>

If fail to read 'i915_cdclk_info' debugfs, simply return
max dotclock as 0, and no need to fallback to read from
'i915_frequency_info'.

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 lib/igt_kms.c | 13 +++----------
 1 file changed, 3 insertions(+), 10 deletions(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index b2208ac54..13bb58dbd 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6046,7 +6046,7 @@ bool igt_max_bpc_constraint(igt_display_t *display, enum pipe pipe,
  * @fd: A drm file descriptor
  *
  * Get the Max pixel clock frequency from intel specific debugfs
- * "i915_frequency_info".
+ * "i915_cdclk_info".
  *
  * Returns: Max supported pixel clock frequency.
  */
@@ -6070,19 +6070,12 @@ int igt_get_max_dotclock(int fd)
 	dir = igt_debugfs_dir(fd);
 	igt_require(dir);
 
-	/*
-	 * Display specific clock frequency info is moved to i915_cdclk_info,
-	 * On older kernels if this debugfs is not found, fallback to read from
-	 * i915_frequency_info.
-	 */
 	res = igt_debugfs_simple_read(dir, "i915_cdclk_info",
 				      buf, sizeof(buf));
-	if (res <= 0)
-		res = igt_debugfs_simple_read(dir, "i915_frequency_info",
-					      buf, sizeof(buf));
 	close(dir);
 
-	igt_require(res > 0);
+	if (res <= 0)
+		return max_dotclock;
 
 	igt_assert(s = strstr(buf, "Max pixel clock frequency:"));
 	igt_assert_eq(sscanf(s, "Max pixel clock frequency: %d kHz", &max_dotclock), 1);
-- 
2.40.0

  reply	other threads:[~2023-11-16  5:01 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-16  4:51 [igt-dev] [i-g-t V3 1/2] lib/igt_kms: Don't read max dotclock on non-display platforms Bhanuprakash Modem
2023-11-16  4:51 ` Bhanuprakash Modem [this message]
2023-11-16  6:15 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,V3,1/2] " Patchwork
2023-11-17  7:03 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2023-11-17 11:09 ` [igt-dev] ✓ CI.xeBAT: " 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=20231116045113.1590173-2-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@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