mirror of
https://github.com/torvalds/linux.git
synced 2025-11-02 17:49:03 +02:00
drm/xe/sriov: support non-contig VRAM provisioning
Currently we can run into issues with provisioning VRAM region, due to requiring contig VRAM BO underneath. We sometimes see that allocation (multiple GB) can fail even when there is enough free space. We don't need CPU access to the buffer in the first place, so can forgo pin_map and therefore also the contig requirement. Keep the same behavior with save and restore during suspend/resume (which can now be done with blitter). We also need the VRAM to occupy the same pages so we don't need to re-program the LMTT, so should still remain pinned (also we don't want something to try evict it). With that covert over to plain pinned kernel object. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Satyanarayana K V P <satyanarayana.k.v.p@intel.com> Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com> Cc: Matthew Brost <matthew.brost@intel.com> Reviewed-by: Satyanarayana K V P <satyanarayana.k.v.p@intel.com> Link: https://lore.kernel.org/r/20250403102440.266113-16-matthew.auld@intel.com
This commit is contained in:
parent
52a36e7ed6
commit
1e32ffbc9d
1 changed files with 14 additions and 6 deletions
|
|
@ -1444,15 +1444,23 @@ static int pf_provision_vf_lmem(struct xe_gt *gt, unsigned int vfid, u64 size)
|
|||
return 0;
|
||||
|
||||
xe_gt_assert(gt, pf_get_lmem_alignment(gt) == SZ_2M);
|
||||
bo = xe_bo_create_pin_map(xe, tile, NULL,
|
||||
bo = xe_bo_create_locked(xe, tile, NULL,
|
||||
ALIGN(size, PAGE_SIZE),
|
||||
ttm_bo_type_kernel,
|
||||
XE_BO_FLAG_VRAM_IF_DGFX(tile) |
|
||||
XE_BO_FLAG_NEEDS_2M |
|
||||
XE_BO_FLAG_PINNED);
|
||||
XE_BO_FLAG_PINNED |
|
||||
XE_BO_FLAG_PINNED_LATE_RESTORE);
|
||||
if (IS_ERR(bo))
|
||||
return PTR_ERR(bo);
|
||||
|
||||
err = xe_bo_pin(bo);
|
||||
xe_bo_unlock(bo);
|
||||
if (unlikely(err)) {
|
||||
xe_bo_put(bo);
|
||||
return err;
|
||||
}
|
||||
|
||||
config->lmem_obj = bo;
|
||||
|
||||
if (xe_device_has_lmtt(xe)) {
|
||||
|
|
|
|||
Loading…
Reference in a new issue