drm/xe: Let's avoid i915_utils in the xe_force_wake.
authorRodrigo Vivi <rodrigo.vivi@intel.com>
Thu, 12 Jan 2023 22:25:10 +0000 (17:25 -0500)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 12 Dec 2023 19:05:59 +0000 (14:05 -0500)
We can run the bit operation locally without yet another macro.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
drivers/gpu/drm/xe/xe_force_wake.c

index a203eabba4e29877e9e5e9fa7e218ebfd807841a..b87bf3b4cd52d70d306739c6265f266bc9ab547c 100644 (file)
 #include "xe_mmio.h"
 #include "gt/intel_gt_regs.h"
 
-/*
- * FIXME: This header has been deemed evil and we need to kill it. Temporarily
- * including so we can use '__mask_next_bit'.
- */
-#include "i915_utils.h"
 
 #define XE_FORCE_WAKE_ACK_TIMEOUT_MS   50
 
@@ -145,9 +140,9 @@ static int domain_sleep_wait(struct xe_gt *gt,
 }
 
 #define for_each_fw_domain_masked(domain__, mask__, fw__, tmp__) \
-       for (tmp__ = (mask__); tmp__ ;) \
+       for (tmp__ = (mask__); tmp__; tmp__ &= ~BIT(ffs(tmp__) - 1)) \
                for_each_if((domain__ = ((fw__)->domains + \
-                                        __mask_next_bit(tmp__))) && \
+                                        (ffs(tmp__) - 1))) && \
                                         domain__->reg_ctl)
 
 int xe_force_wake_get(struct xe_force_wake *fw,