[igt-dev] [PATCH] lib/i915/drrs: close file handler after update DRRS setting

Lee Shawn C shawn.c.lee at intel.com
Sun Oct 22 13:54:16 UTC 2023


After configure DRRS status, test tool has to release file handler
properly to avoid unexpected problem.

Cc: Tvrtko Ursulin <tvrtko.ursulin at linux.intel.com>
Cc: Vidya Srinivas <vidya.srinivas at intel.com>
Cc: Juha-Pekka Heikkila <juhapekka.heikkila at gmail.com>
Cc: Jouni Högander <jouni.hogander at intel.com>
Signed-off-by: Lee Shawn C <shawn.c.lee at intel.com>
---
 lib/i915/intel_drrs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/i915/intel_drrs.c b/lib/i915/intel_drrs.c
index 2f83e1394a61..deaec90d3f59 100644
--- a/lib/i915/intel_drrs.c
+++ b/lib/i915/intel_drrs.c
@@ -69,6 +69,7 @@ static void drrs_set(int device, enum pipe pipe, unsigned int val)
 	dir = igt_debugfs_pipe_dir(device, pipe, O_DIRECTORY);
 	igt_require_fd(dir);
 	ret = igt_sysfs_write(dir, "i915_drrs_ctl", buf, sizeof(buf) - 1);
+	close(dir);
 
 	/*
 	 * drrs_enable() is called on DRRS capable platform only,
-- 
2.34.1



More information about the igt-dev mailing list