mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 11:48:06 +02:00
zink: only uncommit sparse pages that have been committed
avoid spamming drivers unnecessary with submits since this is expensive Reviewed-by: Dave Airlie <airlied@redhat.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15716>
This commit is contained in:
parent
3dcb80da9d
commit
b76ad3efa0
1 changed files with 10 additions and 7 deletions
|
|
@ -785,13 +785,8 @@ buffer_bo_commit(struct zink_screen *screen, struct zink_resource *res, uint32_t
|
|||
}
|
||||
}
|
||||
} else {
|
||||
if (!buffer_commit_single(screen, res, NULL,
|
||||
(uint64_t)va_page * ZINK_SPARSE_BUFFER_PAGE_SIZE,
|
||||
(uint64_t)(end_va_page - va_page) * ZINK_SPARSE_BUFFER_PAGE_SIZE, false)) {
|
||||
ok = false;
|
||||
goto out;
|
||||
}
|
||||
|
||||
bool done = false;
|
||||
uint32_t base_page = va_page;
|
||||
while (va_page < end_va_page) {
|
||||
struct zink_sparse_backing *backing;
|
||||
uint32_t backing_start;
|
||||
|
|
@ -803,6 +798,14 @@ buffer_bo_commit(struct zink_screen *screen, struct zink_resource *res, uint32_t
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!done && !buffer_commit_single(screen, res, NULL,
|
||||
(uint64_t)base_page * ZINK_SPARSE_BUFFER_PAGE_SIZE,
|
||||
(uint64_t)(end_va_page - base_page) * ZINK_SPARSE_BUFFER_PAGE_SIZE, false)) {
|
||||
ok = false;
|
||||
goto out;
|
||||
}
|
||||
done = true;
|
||||
|
||||
/* Group contiguous spans of pages. */
|
||||
backing = comm[va_page].backing;
|
||||
backing_start = comm[va_page].page;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue