]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
drm/xe: switch xe_pagefault_queue_init() to using bitmap_weighted_or()
authorYury Norov <ynorov@nvidia.com>
Mon, 2 Mar 2026 01:11:58 +0000 (20:11 -0500)
committerYury Norov <ynorov@nvidia.com>
Thu, 9 Apr 2026 17:28:05 +0000 (13:28 -0400)
The function calls bitmap_or() immediately followed by bitmap_weight().
Switch to using the dedicated bitmap_weighted_or() and save one bitmap
traverse.

Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Reviewed-by: Aleksandr Loktionov <aleksandr.loktionov@intel.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Signed-off-by: Yury Norov <ynorov@nvidia.com>
drivers/gpu/drm/xe/xe_pagefault.c

index 6bee53d6ffc37465b79afc4ba2c6dcf2ab851029..c4ce3cfe2164683d17ad40e27f968d9d85485bec 100644 (file)
@@ -285,10 +285,9 @@ static int xe_pagefault_queue_init(struct xe_device *xe,
                xe_dss_mask_t all_dss;
                int num_dss, num_eus;
 
-               bitmap_or(all_dss, gt->fuse_topo.g_dss_mask,
+               num_dss = bitmap_weighted_or(all_dss, gt->fuse_topo.g_dss_mask,
                          gt->fuse_topo.c_dss_mask, XE_MAX_DSS_FUSE_BITS);
 
-               num_dss = bitmap_weight(all_dss, XE_MAX_DSS_FUSE_BITS);
                num_eus = bitmap_weight(gt->fuse_topo.eu_mask_per_dss,
                                        XE_MAX_EU_FUSE_BITS) * num_dss;