drm/xe/pf: Use migration-friendly GGTT auto-provisioning
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Wed, 12 Nov 2025 12:44:08 +0000 (13:44 +0100)
committerMichal Wajdeczko <michal.wajdeczko@intel.com>
Thu, 13 Nov 2025 13:32:34 +0000 (14:32 +0100)
commite448372e8a8ed2708ac4f85d74979885e47d5566
tree1f2a1b2975c3c9eafa929505d466d4baa67b8f0e
parentaaecfadc22cca4c7ad381b1df457e8857c01fe14
drm/xe/pf: Use migration-friendly GGTT auto-provisioning

Instead of trying very hard to find the largest fair GGTT size that
could be allocated for VFs on the current tile, pick some smaller
rounded down to power-of-two value that is more likely to be
provisioned in the same manner by the other PF instance:

  num VFs | GGTT space (MiB)
  --------+-----------------
   63..57 | 56
   56..29 | 64
   28..15 | 128
   14..8  | 256
    7..4  | 512
    3..2  | 1024
       1  | 2048 (regular PF)
       1  | 3584 (admin only PF)

Note that due to FW/HW limitations we can't share all 4GiB GGTT
address space with VFs, so for the larger (>7) number of the VFs
the change in the outcome is happening at different points than
we have in case of GuC contexts/doorbells IDs.

Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Piotr Piórkowski <piotr.piorkowski@intel.com>
Link: https://patch.msgid.link/20251112124408.8094-1-michal.wajdeczko@intel.com
drivers/gpu/drm/xe/tests/xe_gt_sriov_pf_config_kunit.c
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c