[igt-dev] [i-g-t] lib/i915: Fix the check for scheduler caps for timeslicing

Tejas Upadhyay tejaskumarx.surendrakumar.upadhyay at intel.com
Wed Jul 14 11:51:33 UTC 2021


Semaphore and preemption both are required and the check
was missing required check logic.

Signed-off-by: Tejas Upadhyay <tejaskumarx.surendrakumar.upadhyay at intel.com>
---
 lib/i915/gem_scheduler.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lib/i915/gem_scheduler.c b/lib/i915/gem_scheduler.c
index 6dfa3676..cdddf42a 100644
--- a/lib/i915/gem_scheduler.c
+++ b/lib/i915/gem_scheduler.c
@@ -140,9 +140,11 @@ bool gem_scheduler_has_engine_busy_stats(int fd)
  */
 bool gem_scheduler_has_timeslicing(int fd)
 {
-	return ((gem_scheduler_capability(fd) &
+	return (((gem_scheduler_capability(fd) &
 	        (I915_SCHEDULER_CAP_PREEMPTION |
-		 I915_SCHEDULER_CAP_SEMAPHORES))
+		 I915_SCHEDULER_CAP_SEMAPHORES)) ==
+		(I915_SCHEDULER_CAP_PREEMPTION |
+		I915_SCHEDULER_CAP_SEMAPHORES))
 		|| gem_has_guc_submission(fd));
 }
 
@@ -168,8 +170,6 @@ void gem_scheduler_print_capability(int fd)
 		igt_info(" - With HW semaphores enabled\n");
 	if (caps & I915_SCHEDULER_CAP_ENGINE_BUSY_STATS)
 		igt_info(" - With engine busy statistics\n");
-	if ((caps & (I915_SCHEDULER_CAP_PREEMPTION
-		  | I915_SCHEDULER_CAP_SEMAPHORES))
-		|| gem_has_guc_submission(fd))
+	if (gem_scheduler_has_timeslicing(fd))
 		igt_info(" - With timeslicing enabled\n");
 }
-- 
2.31.1



More information about the igt-dev mailing list