Skip to content

Commit 12267f8

Browse files
mbernatowiczmwiniars
authored andcommitted
drm/xe/tests: Make cross-device dma-buf BOs CPU-visible on small BAR
Small-BAR systems (e.g., SR-IOV VFs in VMs) expose only a subset of VRAM via PCI/BAR. Exporting a BO outside that window fails, and the selftests also do CPU fill/verify. Set XE_BO_FLAG_NEEDS_CPU_ACCESS for cross-device variants to force CPU-mappable placement and keep tests reliable. Large-BAR/P2P setups are unaffected. Suggested-by: Matthew Auld <matthew.auld@intel.com> Signed-off-by: Marcin Bernatowicz <marcin.bernatowicz@linux.intel.com> Cc: Matthew Auld <matthew.auld@intel.com> Reviewed-by: Matthew Auld <matthew.auld@intel.com> Link: https://lore.kernel.org/r/20250814145950.430231-1-marcin.bernatowicz@linux.intel.com Signed-off-by: Michał Winiarski <michal.winiarski@intel.com>
1 parent 81a45cb commit 12267f8

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/gpu/drm/xe/tests/xe_dma_buf.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ static const struct dma_buf_attach_ops nop2p_attach_ops = {
204204
static const struct dma_buf_test_params test_params[] = {
205205
{.mem_mask = XE_BO_FLAG_VRAM0,
206206
.attach_ops = &xe_dma_buf_attach_ops},
207-
{.mem_mask = XE_BO_FLAG_VRAM0,
207+
{.mem_mask = XE_BO_FLAG_VRAM0 | XE_BO_FLAG_NEEDS_CPU_ACCESS,
208208
.attach_ops = &xe_dma_buf_attach_ops,
209209
.force_different_devices = true},
210210

@@ -236,7 +236,8 @@ static const struct dma_buf_test_params test_params[] = {
236236

237237
{.mem_mask = XE_BO_FLAG_SYSTEM | XE_BO_FLAG_VRAM0,
238238
.attach_ops = &xe_dma_buf_attach_ops},
239-
{.mem_mask = XE_BO_FLAG_SYSTEM | XE_BO_FLAG_VRAM0,
239+
{.mem_mask = XE_BO_FLAG_SYSTEM | XE_BO_FLAG_VRAM0 |
240+
XE_BO_FLAG_NEEDS_CPU_ACCESS,
240241
.attach_ops = &xe_dma_buf_attach_ops,
241242
.force_different_devices = true},
242243

0 commit comments

Comments
 (0)