[PATCH v3 5/5] drm/xe/query: use PAGE_SIZE as the minimum page alignment
Simon Richter
Simon.Richter at hogyros.de
Mon Jul 28 22:02:59 UTC 2025
Hi,
[removed stable at vger from Cc list]
On 7/28/25 22:45, Rodrigo Vivi wrote:
> honest question: if it is vram needing 64k we give 64k alignment, otherwise
> nowadays regardless if it is vram or system memory we give 4k.
It's supposed to be the largest of the requirements, I think. The code
(kind of falsely) assumes that 64k is the largest we will ever see.
"Kind of", because anything above 64k requires all the ELF files on the
system to use a larger alignment as well, so we're in "really special"
territory here.
16k is also a valid CPU alignment on ppc64 and aarch64, so that needs to
be handled as well.
> what should happen with non-64k vram request on these systems? really give
> the cpu alignemnt or continue with the 4k for gpu?
Depends on whether we want to be able to mmap the vram later, which I
guess we do.
We could relax this to 4k when actually allocating if
DRM_XE_GEM_CREATE_FLAG_NEEDS_VISIBLE_VRAM isn't set, but
info[DRM_XE_QUERY_CONFIG_MIN_ALIGNMENT] is what Mesa uses to determine
what size BO to request, and the ioctl handler has
if (XE_IOCTL_DBG(xe, args->size & ~PAGE_MASK))
return -EINVAL;
so setting the query value to PAGE_SIZE is the minimal change that will
make Mesa do the right thing.
The alternative is to relax the check in the ioctl back to 4k and align
the size in ___xe_bo_create_locked depending on XE_BO_FLAG_NEEDS_CPU_ACCESS.
Simon
More information about the Intel-xe
mailing list