summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nouveau_bo.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2023-12-12 04:32:33 +0300
committerDave Airlie <airlied@redhat.com>2023-12-12 04:32:33 +0300
commitc1ee197d64f49c9e2a6c8e6a168083c411c1362c (patch)
treeec8568a9d11ce55989c212efc4769cccc680964e /drivers/gpu/drm/nouveau/nouveau_bo.c
parenta60501d7c2d3e70b3545b9b96576628e369d8e85 (diff)
parenta39b6ac3781d46ba18193c9dbb2110f31e9bffe9 (diff)
downloadlinux-c1ee197d64f49c9e2a6c8e6a168083c411c1362c.tar.xz
Backmerge tag 'v6.7-rc5' into drm-next
Linux 6.7-rc5 Alex requested this for some amdkfd work relying on the symbols exports. Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_bo.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_bo.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_bo.c b/drivers/gpu/drm/nouveau/nouveau_bo.c
index b7dda486a7ea..00cc7d1abaa3 100644
--- a/drivers/gpu/drm/nouveau/nouveau_bo.c
+++ b/drivers/gpu/drm/nouveau/nouveau_bo.c
@@ -325,8 +325,9 @@ nouveau_bo_alloc(struct nouveau_cli *cli, u64 *size, int *align, u32 domain,
(!vmm->page[i].host || vmm->page[i].shift > PAGE_SHIFT))
continue;
- if (pi < 0)
- pi = i;
+ /* pick the last one as it will be smallest. */
+ pi = i;
+
/* Stop once the buffer is larger than the current page size. */
if (*size >= 1ULL << vmm->page[i].shift)
break;