Skip to content

Preliminary support for separate VRAM region for kernel allocations on tiles

Piórkowski, Piotr intel-xe 5 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v5 Latest5 patches 0 repliesNew
  2. v45 patches 7 repliesSuperseded
  3. v34 patches 3 repliesSuperseded
Earlier versions · 2
VersionPostedPatchesRepliesStatus
v24 patches0 repliesSuperseded
v14 patches3 repliesSuperseded

Changes in v5 from the cover letter

- rename "Combine vm->xef and XE_LRC_CREATE_USER_CTX checks to detect userspace context" to "Combine userspace context check"
- remove unused function xe_tile_has_separate_kernel_vram
- Simplify the conditions in __xe_bo_fixed_placement

Patches in v5 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5drm/xe: Add initial support for separate kernel VRAM region on the tiledrivers/gpu/drm/xe/xe_bo.c drivers/gpu/drm/xe/xe_bo.h drivers/gpu/drm/xe/xe_device_types.h +2 more+75 -290 replies
2/5drm/xe: Introduce new BO flag XE_BO_FLAG_FORCE_USER_VRAMdrivers/gpu/drm/xe/xe_bo.c drivers/gpu/drm/xe/xe_bo.h+5 -40 replies
3/5drm/xe: Force user context allocations in user VRAMdrivers/gpu/drm/xe/xe_exec_queue.c drivers/gpu/drm/xe/xe_lrc.c drivers/gpu/drm/xe/xe_lrc.h +1 more+13 -50 replies
4/5drm/xe/pf: Force use user VRAM for LMEM provisioningdrivers/gpu/drm/xe/xe_gt_sriov_pf_config.c+2 -10 replies
5/5drm/xe: Combine userspace context checkdrivers/gpu/drm/xe/xe_lrc.c+2 -40 replies

Reviews trailers per patch

All 5 patches have a Reviewed-by or Acked-by.

PatchMatthew Auld
1/5R-b
2/5R-b
3/5R-b
4/5R-b
5/5R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v5 thread

Cover letter [PATCH v5 0/5] Preliminary support for separate VRAM region for kernel allocations on tiles

From: Piotr Piórkowski <[email protected]>

Until now, all VRAM BO allocations, whether from userspace or the kernel, were placed in the same VRAM region assigned to a tile. However, in some scenarios, it may be necessary to separate these allocations and place kernel BOs in a dedicated VRAM region.

This series introduces initial support for such separation by allowing an additional VRAM region for kernel BOs to be assigned to tiles. In this implementation, such BOs are identified by the ttm_bo_type_kernel flag.

To maintain flexibility, this series introduces a new BO flag:
XE_BO_FLAG_FORCE_USER_VRAM. It forces BO allocations into the general-purpose VRAM region, overriding the new default behavior. This override currently applies to BOs associated with user contexts and BOs used for VF memory.

To preserve backward compatibility on platforms that do not have a dedicated kernel VRAM region, the kernel_vram pointer will fall back to the general-purpose VRAM region.

v1 -> v2:
- update commit message of "drm/xe: Introduce new BO flag XE_BO_FLAG_FORCE_USER_VRAM"
- replaced for_each_bo_flag_vram with the improved for_each_set_bo_vram_flag helper
- moved the VRAM flag iteration macro definition into xe_bo.c
- drop unused bo_flgas from bo_vram_flags_to_vram_placement in
"drm/xe: Add initial support for separate kernel VRAM region on the tile"
- use hweight32 helper in __xe_bo_fixed_placement for readability

v2 -> v3:
- rebase

v3 -> v4:
- add 'drm/xe: Combine vm->xef and XE_LRC_CREATE_USER_CTX checks to detect userspace context'
- remove unnecessary VRAM fixup id
v4 -> v5:
- rename "Combine vm->xef and XE_LRC_CREATE_USER_CTX checks to detect userspace context" to "Combine userspace context check"
- remove unused function xe_tile_has_separate_kernel_vram
- Simplify the conditions in __xe_bo_fixed_placement

Piotr Piórkowski (5):
drm/xe: Add initial support for separate kernel VRAM region on the
tile
drm/xe: Introduce new BO flag XE_BO_FLAG_FORCE_USER_VRAM drm/xe: Force user context allocations in user VRAM drm/xe/pf: Force use user VRAM for LMEM provisioning drm/xe: Combine userspace context check

 drivers/gpu/drm/xe/xe_bo.c                 | 78 ++++++++++++++--------
 drivers/gpu/drm/xe/xe_bo.h                 |  3 +-
 drivers/gpu/drm/xe/xe_device_types.h       | 10 ++-
 drivers/gpu/drm/xe/xe_exec_queue.c         |  7 +-
 drivers/gpu/drm/xe/xe_gt_sriov_pf_config.c |  3 +-
 drivers/gpu/drm/xe/xe_lrc.c                |  5 +-
 drivers/gpu/drm/xe/xe_lrc.h                |  6 +-
 drivers/gpu/drm/xe/xe_pt.c                 |  2 +-
 drivers/gpu/drm/xe/xe_tile.c               |  8 +++
 drivers/gpu/drm/xe/xe_vram.c               |  6 +-
 10 files changed, 91 insertions(+), 37 deletions(-)
Signature · 1 line
2.34.1