mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 11:08:03 +02:00
fd/replay: Error when VMA AS allocation fails
It's possible for large allocations to hit the maximum address space size especially with a fake AS, these failures are silent and can cause a hard to debug segfault later down the line. Signed-off-by: Mark Collins <mark@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/28253>
This commit is contained in:
parent
e0a680162d
commit
694ed34673
1 changed files with 9 additions and 3 deletions
|
|
@ -620,7 +620,9 @@ device_submit_cmdstreams(struct device *dev)
|
|||
static void
|
||||
buffer_mem_alloc(struct device *dev, struct buffer *buf)
|
||||
{
|
||||
util_vma_heap_alloc_addr(&dev->vma, buf->iova, buf->size);
|
||||
bool success = util_vma_heap_alloc_addr(&dev->vma, buf->iova, buf->size);
|
||||
if (!success)
|
||||
errx(1, "Failed to allocate buffer");
|
||||
|
||||
if (!dev->has_set_iova) {
|
||||
uint64_t offset = buf->iova - dev->va_iova;
|
||||
|
|
@ -832,7 +834,9 @@ device_submit_cmdstreams(struct device *dev)
|
|||
static void
|
||||
buffer_mem_alloc(struct device *dev, struct buffer *buf)
|
||||
{
|
||||
util_vma_heap_alloc_addr(&dev->vma, buf->iova, buf->size);
|
||||
bool success = util_vma_heap_alloc_addr(&dev->vma, buf->iova, buf->size);
|
||||
if (!success)
|
||||
errx(1, "Failed to allocate buffer");
|
||||
|
||||
buf->map = ((uint8_t*)dev->va_map) + (buf->iova - dev->va_iova);
|
||||
}
|
||||
|
|
@ -1196,7 +1200,9 @@ device_submit_cmdstreams(struct device *dev)
|
|||
static void
|
||||
buffer_mem_alloc(struct device *dev, struct buffer *buf)
|
||||
{
|
||||
util_vma_heap_alloc_addr(&dev->vma, buf->iova, buf->size);
|
||||
bool success = util_vma_heap_alloc_addr(&dev->vma, buf->iova, buf->size);
|
||||
if (!success)
|
||||
errx(1, "Failed to allocate buffer");
|
||||
|
||||
buf->map = ((uint8_t*)dev->va_map) + (buf->iova - dev->va_iova);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue