Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [igt-dev] [i-g-t V2] lib/igt_kms: Don't read max dotclock on non-display platforms
@ 2023-11-15 14:02 Bhanuprakash Modem
  2023-11-15 18:02 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_kms: Don't read max dotclock on non-display platforms (rev2) Patchwork
                   ` (3 more replies)
  0 siblings, 4 replies; 6+ messages in thread
From: Bhanuprakash Modem @ 2023-11-15 14:02 UTC (permalink / raw)
  To: igt-dev

On non-display platforms, there is no point in checking for
max dotclock.

V2: Fix resource leak

Fixes: https://gitlab.freedesktop.org/drm/intel/-/issues/9672
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 lib/igt_kms.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 89510ff22..0aa8f4a46 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -6055,10 +6055,18 @@ int igt_get_max_dotclock(int fd)
 	char buf[4096];
 	char *s;
 	int dir, res, max_dotclock = 0;
+	drmModeRes *resources;
 
 	if (!is_intel_device(fd))
 		return max_dotclock;
 
+	/* If there is no display, then no point to check for dotclock. */
+	resources = drmModeGetResources(fd);
+	if (!resources)
+		return max_dotclock;
+	else
+		drmModeFreeResources(resources);
+
 	dir = igt_debugfs_dir(fd);
 	igt_require(dir);
 
-- 
2.40.0

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2023-11-17  4:01 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-11-15 14:02 [igt-dev] [i-g-t V2] lib/igt_kms: Don't read max dotclock on non-display platforms Bhanuprakash Modem
2023-11-15 18:02 ` [igt-dev] ✓ Fi.CI.BAT: success for lib/igt_kms: Don't read max dotclock on non-display platforms (rev2) Patchwork
2023-11-15 18:03 ` [igt-dev] ✓ CI.xeBAT: " Patchwork
2023-11-15 20:46 ` [igt-dev] [i-g-t V2] lib/igt_kms: Don't read max dotclock on non-display platforms Ville Syrjälä
2023-11-16  3:30   ` Modem, Bhanuprakash
2023-11-17  4:01 ` [igt-dev] ✗ Fi.CI.IGT: failure for lib/igt_kms: Don't read max dotclock on non-display platforms (rev2) Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox