diff options
| author | Jason A. Harmening <jah@FreeBSD.org> | 2023-11-20 23:23:58 +0000 |
|---|---|---|
| committer | Jason A. Harmening <jah@FreeBSD.org> | 2023-12-24 05:01:40 +0000 |
| commit | 2619c5ccfe1f7889f0241916bd17d06340142b05 (patch) | |
| tree | ee7b6247c330bea422d03dfc988579e57b7c2a70 /sys/dev/drm2 | |
| parent | 1a3ee6002f3e008e0bc29d04c976285434503e19 (diff) | |
Diffstat (limited to 'sys/dev/drm2')
| -rw-r--r-- | sys/dev/drm2/ttm/ttm_bo.c | 4 | ||||
| -rw-r--r-- | sys/dev/drm2/ttm/ttm_page_alloc.c | 9 |
2 files changed, 8 insertions, 5 deletions
diff --git a/sys/dev/drm2/ttm/ttm_bo.c b/sys/dev/drm2/ttm/ttm_bo.c index f60cb4f37535..b57d961338f4 100644 --- a/sys/dev/drm2/ttm/ttm_bo.c +++ b/sys/dev/drm2/ttm/ttm_bo.c @@ -1498,8 +1498,8 @@ retry: VM_MAX_ADDRESS, PAGE_SIZE, 0, VM_MEMATTR_UNCACHEABLE); if (unlikely(glob->dummy_read_page == NULL)) { - if (tries < 1 && vm_page_reclaim_contig(0, 1, 0, - VM_MAX_ADDRESS, PAGE_SIZE, 0)) { + if (tries < 1 && (vm_page_reclaim_contig(0, 1, 0, + VM_MAX_ADDRESS, PAGE_SIZE, 0) == 0)) { tries++; goto retry; } diff --git a/sys/dev/drm2/ttm/ttm_page_alloc.c b/sys/dev/drm2/ttm/ttm_page_alloc.c index 67c484218cc2..7518ecb4dfd1 100644 --- a/sys/dev/drm2/ttm/ttm_page_alloc.c +++ b/sys/dev/drm2/ttm/ttm_page_alloc.c @@ -158,16 +158,19 @@ static vm_page_t ttm_vm_page_alloc_dma32(int req, vm_memattr_t memattr) { vm_page_t p; - int tries; + int err, tries; for (tries = 0; ; tries++) { p = vm_page_alloc_noobj_contig(req, 1, 0, 0xffffffff, PAGE_SIZE, 0, memattr); if (p != NULL || tries > 2) return (p); - if (!vm_page_reclaim_contig(req, 1, 0, 0xffffffff, - PAGE_SIZE, 0)) + err = vm_page_reclaim_contig(req, 1, 0, 0xffffffff, + PAGE_SIZE, 0); + if (err == ENOMEM) vm_wait(NULL); + else if (err != 0) + return (NULL); } } |
