Skip to content

Commit 5f22cc0

Browse files
committed
drm/i915: Fix mismatch between misplaced vma check and vma insert
When inserting a VMA, we restrict the placement to the low 4G unless the caller opts into using the full range. This was done to allow usersapce the opportunity to transition slowly from a 32b address space, and to avoid breaking inherent 32b assumptions of some commands. However, for insert we limited ourselves to 4G-4K, but on verification we allowed the full 4G. This causes some attempts to bind a new buffer to sporadically fail with -ENOSPC, but at other times be bound successfully. commit 48ea1e3 ("drm/i915/gen9: Set PIN_ZONE_4G end to 4GB - 1 page") suggests that there is a genuine problem with stateless addressing that cannot utilize the last page in 4G and so we purposefully excluded it. This means that the quick pin pass may cause us to utilize a buggy placement. Reported-by: CQ Tang <[email protected]> Testcase: igt/gem_exec_params/larger-than-life-batch Fixes: 48ea1e3 ("drm/i915/gen9: Set PIN_ZONE_4G end to 4GB - 1 page") Signed-off-by: Chris Wilson <[email protected]> Cc: CQ Tang <[email protected]> Reviewed-by: CQ Tang <[email protected]> Reviewed-by: Matthew Auld <[email protected]> Cc: <[email protected]> # v4.5+ Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 3b7bc18 commit 5f22cc0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/gpu/drm/i915/gem/i915_gem_execbuffer.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ eb_vma_misplaced(const struct drm_i915_gem_exec_object2 *entry,
382382
return true;
383383

384384
if (!(flags & EXEC_OBJECT_SUPPORTS_48B_ADDRESS) &&
385-
(vma->node.start + vma->node.size - 1) >> 32)
385+
(vma->node.start + vma->node.size + 4095) >> 32)
386386
return true;
387387

388388
if (flags & __EXEC_OBJECT_NEEDS_MAP &&

0 commit comments

Comments
 (0)