drm/xe/pf: Limit fair VF LMEM provisioning
authorMichal Wajdeczko <michal.wajdeczko@intel.com>
Thu, 11 Jul 2024 19:23:19 +0000 (21:23 +0200)
committerLucas De Marchi <lucas.demarchi@intel.com>
Fri, 12 Jul 2024 20:45:56 +0000 (13:45 -0700)
commit4c3fe5eae46b92e2fd961b19f7779608352e5368
tree6e101f98a131551a611b289e4f3c2d46cecb6a2c
parent43a6faa6d9b5e9139758200a79fe9c8f4aaa0c8d
drm/xe/pf: Limit fair VF LMEM provisioning

Due to the current design of the BO and VRAM manager, any object
with XE_BO_FLAG_PINNED flag, which the PF driver uses during VF
LMEM provisionining, is created with the TTM_PL_FLAG_CONTIGUOUS
flag, which may cause VRAM fragmentation that prevents subsequent
allocations of larger objects, like fair VF LMEM provisioning.

To avoid such failures, round down fair VF LMEM provisioning size
to next power of two size, to compensate what xe_ttm_vram_mgr is
doing to achieve contiguous allocations.

Fixes: ac6598aed1b3 ("drm/xe/pf: Add support to configure SR-IOV VFs")
Signed-off-by: Michal Wajdeczko <michal.wajdeczko@intel.com>
Reviewed-by: Piotr PiĆ³rkowski <piotr.piorkowski@intel.com>
Reviewed-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20240711192320.1198-2-michal.wajdeczko@intel.com
Signed-off-by: Lucas De Marchi <lucas.demarchi@intel.com>
drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c