Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/xe: Remove xe_ggtt_node_allocated

With the intermediate state gone, no longer useful. Just check against
NULL where needed.

After looking carefully, the check for allocated in xe_fb_pin.c is
unneeded. vma->node is never NULL. The check is specifically only
to check if vma->node == the bo's root tile ggtt_obj.

Reviewed-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Link: https://patch.msgid.link/20260206112108.1453809-12-dev@lankhorst.se
Signed-off-by: Maarten Lankhorst <dev@lankhorst.se>

+7 -26
+1 -2
drivers/gpu/drm/xe/display/xe_fb_pin.c
··· 352 352 353 353 if (vma->dpt) 354 354 xe_bo_unpin_map_no_vm(vma->dpt); 355 - else if (!xe_ggtt_node_allocated(vma->bo->ggtt_node[tile_id]) || 356 - vma->bo->ggtt_node[tile_id] != vma->node) 355 + else if (vma->bo->ggtt_node[tile_id] != vma->node) 357 356 xe_ggtt_node_remove(vma->node, false); 358 357 359 358 ttm_bo_reserve(&vma->bo->ttm, false, false, NULL);
-17
drivers/gpu/drm/xe/xe_ggtt.c
··· 666 666 } 667 667 668 668 /** 669 - * xe_ggtt_node_allocated - Check if node is allocated in GGTT 670 - * @node: the &xe_ggtt_node to be inspected 671 - * 672 - * Return: True if allocated, False otherwise. 673 - */ 674 - bool xe_ggtt_node_allocated(const struct xe_ggtt_node *node) 675 - { 676 - if (!node || !node->ggtt) 677 - return false; 678 - 679 - return drm_mm_node_allocated(&node->base); 680 - } 681 - 682 - /** 683 669 * xe_ggtt_node_pt_size() - Get the size of page table entries needed to map a GGTT node. 684 670 * @node: the &xe_ggtt_node 685 671 * ··· 956 970 u64 pte = xe_encode_vfid_pte(vfid); 957 971 958 972 lockdep_assert_held(&ggtt->lock); 959 - 960 - if (!xe_ggtt_node_allocated(node)) 961 - return; 962 973 963 974 while (start < end) { 964 975 ggtt->pt_ops->ggtt_set_pte(ggtt, start, pte);
-1
drivers/gpu/drm/xe/xe_ggtt.h
··· 30 30 u64 size, u32 align, 31 31 xe_ggtt_transform_cb transform, void *arg); 32 32 void xe_ggtt_node_remove(struct xe_ggtt_node *node, bool invalidate); 33 - bool xe_ggtt_node_allocated(const struct xe_ggtt_node *node); 34 33 size_t xe_ggtt_node_pt_size(const struct xe_ggtt_node *node); 35 34 void xe_ggtt_map_bo_unlocked(struct xe_ggtt *ggtt, struct xe_bo *bo); 36 35 int xe_ggtt_insert_bo(struct xe_ggtt *ggtt, struct xe_bo *bo, struct drm_exec *exec);
+6 -6
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c
··· 279 279 { 280 280 struct xe_ggtt_node *node = config->ggtt_region; 281 281 282 - if (!xe_ggtt_node_allocated(node)) 282 + if (!node) 283 283 return 0; 284 284 285 285 return encode_ggtt(cfg, xe_ggtt_node_addr(node), xe_ggtt_node_size(node), details); ··· 503 503 504 504 size = round_up(size, alignment); 505 505 506 - if (xe_ggtt_node_allocated(config->ggtt_region)) { 506 + if (config->ggtt_region) { 507 507 err = pf_distribute_config_ggtt(tile, vfid, 0, 0); 508 508 if (unlikely(err)) 509 509 return err; ··· 514 514 if (unlikely(err)) 515 515 return err; 516 516 } 517 - xe_gt_assert(gt, !xe_ggtt_node_allocated(config->ggtt_region)); 517 + xe_gt_assert(gt, !config->ggtt_region); 518 518 519 519 if (!size) 520 520 return 0; ··· 544 544 struct xe_ggtt_node *node = config->ggtt_region; 545 545 546 546 xe_gt_assert(gt, xe_gt_is_main_type(gt)); 547 - return xe_ggtt_node_allocated(node) ? xe_ggtt_node_size(node) : 0; 547 + return node ? xe_ggtt_node_size(node) : 0; 548 548 } 549 549 550 550 /** ··· 2558 2558 2559 2559 static void pf_sanitize_ggtt(struct xe_ggtt_node *ggtt_region, unsigned int vfid) 2560 2560 { 2561 - if (xe_ggtt_node_allocated(ggtt_region)) 2561 + if (ggtt_region) 2562 2562 xe_ggtt_assign(ggtt_region, vfid); 2563 2563 } 2564 2564 ··· 3017 3017 3018 3018 for (n = 1; n <= total_vfs; n++) { 3019 3019 config = &gt->sriov.pf.vfs[n].config; 3020 - if (!xe_ggtt_node_allocated(config->ggtt_region)) 3020 + if (!config->ggtt_region) 3021 3021 continue; 3022 3022 3023 3023 string_get_size(xe_ggtt_node_size(config->ggtt_region), 1, STRING_UNITS_2,