asahi: assert page alignment in vm_bind
kernel should check but it's easier to debug on the userspace side. Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/33682>
This commit is contained in:
committed by
Marge Bot
parent
d0a7bff906
commit
c02235124f
@@ -120,6 +120,10 @@ agx_bo_bind(struct agx_device *dev, struct agx_bo *bo, uint64_t addr,
|
||||
.addr = addr,
|
||||
};
|
||||
|
||||
assert((size_B % 16384) == 0 && "page alignment required");
|
||||
assert((offset_B % 16384) == 0 && "page alignment required");
|
||||
assert((addr % 16384) == 0 && "page alignment required");
|
||||
|
||||
int ret = drmIoctl(dev->fd, DRM_IOCTL_ASAHI_GEM_BIND, &gem_bind);
|
||||
if (ret) {
|
||||
fprintf(stderr, "DRM_IOCTL_ASAHI_GEM_BIND failed: %m (handle=%d)\n",
|
||||
|
||||
Reference in New Issue
Block a user